Opened 4 years ago

Closed 4 years ago

#60682 closed defect (fixed)

v2ray overrides the build phase

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: casouri (Yuan Fu)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: i0ntempest
Port: v2ray

Description

The v2ray portfile overrides the build phase. It seems like this would bypass some desirable aspects of the golang 1.0 portgroup, such as properly setting the CC and GOARCH environment variables. Can it use the build phase normally instead of overriding it?

Change History (8)

comment:1 Changed 4 years ago by i0ntempest

v2ray port needs to build 2 binaries using different options, can macports do this without overriding the build phase?

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I see... I am not familiar with how go software is normally built but it would be hard for me to believe that the go build system can't accommodate this.

comment:3 Changed 4 years ago by i0ntempest

Unfortunately I'm not either. I'll try if adding build args can do this, if not maybe the go portgroup needs to be changed to allow this.

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Well the port currently does this:

build {
    system -W ${worksrcpath}/main "env CGO_ENABLED=0 go build -o ./v2ray -ldflags \"-s -w\""
    system -W ${worksrcpath}/infra/control/main "env CGO_ENABLED=0 go build -o ./v2ctl -tags confonly -ldflags \"-s -w\""
}

Is there some v2ray documentation that said to do that?

comment:5 Changed 4 years ago by i0ntempest

Yes, this is the official compile guide: https://www.v2ray.com/developer/intro/compile.html

comment:6 Changed 4 years ago by casouri (Yuan Fu)

unfortunately, I don't know enough Go to make changes to the build command. Maybe someone else with that knowledge can. I'd be happy to change the portfile accordingly.

comment:7 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Yeah it's probably something that needs to be taken to the developers of v2ray. They should provide a single command that can build everything. (Just like in a project that use make correctly you would run make all or just make and it would make everything; you don't have to run multiple make commands in separate directories.)

comment:8 Changed 4 years ago by i0ntempest

Resolution: fixed
Status: assignedclosed

In b6057febb7c91aac123c9a08ea8f64cc068aa9be/macports-ports (master):

v2ray: update to 4.31.0 & migrate to the new repo & ... (https://github.com/macports/macports-ports/pull/8721)

vendor go dependencies & use full build.env, proper build.cmd
Closes: #60682

Note: See TracTickets for help on using tickets.