Page MenuHomeFreeBSD

Introduce versioned Go ports

Authored by dmgk on May 29 2022, 10:48 PM.
Referenced Files
Unknown Object (File)
Fri, Feb 9, 7:07 PM
Unknown Object (File)
Tue, Jan 30, 8:40 PM
Unknown Object (File)
Jan 12 2024, 12:28 AM
Unknown Object (File)
Jan 8 2024, 9:34 AM
Unknown Object (File)
Dec 23 2023, 9:02 AM
Unknown Object (File)
Dec 20 2023, 10:35 AM
Unknown Object (File)
Nov 23 2023, 10:36 PM
Unknown Object (File)
Nov 23 2023, 10:36 PM



After Go 1.18 release, lang/go117 was added to the tree because some ports
weren't buildable with go118. I was hoping we can get rid of go117 before
go119 release, but it looks like it's not going to happen. Currently, about 25
ports fail to build with the current go master and it is unlikely that the
situation will improve. The main culprit is
which is tied to the Go version [1] and many upstreams are slow to update their
dependencies. It is very likely that even after go119 release, we will still
have ports that require go117 to build.

Given the above, I think it is time to introduce proper Go ports versioning
and this review:

  • adds support for selecting Go port version in USES=go;
  • sets default Go version (GO_DEFAULT) in Mk/
  • converts lang/go-devel port to the master and lang/go{117,118} ports to simple slave ports;
  • convert lang/go to a meta-port that provides go and gofmt symlinks to the current default version.

Other changes in this review (which I will commit separately) are port build
fixes, they

  • add 1.17 to USES=go for ports that still need go117 and remove GO_PORT;
  • add missing ${SETENV} ${MAKE_ENV} to repair BINARY_ALIAS;
  • remove explicit dependencies on lang/go.


Test Plan


Diff Detail

R11 FreeBSD ports repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

dmgk requested review of this revision.May 29 2022, 10:48 PM
83 ↗(On Diff #106455)

It's no need to change. It isn't "go build". It's auxiliary utility.

83 ↗(On Diff #106455)

wire appears to be calling go, so it needs to know where to find it:

===>  Generating wire_gen.go
wire: err: go command required, not found: exec: "go": executable file not found in $PATH: stderr:
wire: generate failed
*** Error code 1 added inline comments.
83 ↗(On Diff #106455)

You are right. Confirmed. Thx.

biology/ncbi-entrez-direct looks fine.


in order to keep the "PORTNAME should be the software name" moto, you should probably change this, and then only set PKGNAMESUFFIX in the slave ports.


This could probably be replaced with something like this:

GO_SUFFIX=      ${GO_DEFAULT:Mdevel:?-devel:${GO_DEFAULT:S/.//}}

removing the need for the .pre/.post includes.


You should probably add lang/go to the depends_blacklist function in Mk/Scripts/ and then drop this line.

dmgk marked 3 inline comments as done.Jun 3 2022, 9:24 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 6 2022, 6:22 PM
This revision was automatically updated to reflect the committed changes.