Page MenuHomeFreeBSD

Introduce versioned Go ports
ClosedPublic

Authored by dmgk on May 29 2022, 10:48 PM.

Details

Summary

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 github.com/lucas-clemente/quic-go
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/bsd.default-versions.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.

[1] https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions

Test Plan

exp-run

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

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

www/grafana8/Makefile
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
drtr0jan_yandex.ru added inline comments.
www/grafana8/Makefile
83 ↗(On Diff #106455)

You are right. Confirmed. Thx.

biology/ncbi-entrez-direct looks fine.

lang/go-devel/Makefile
3–7

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.

lang/go/Makefile
12–14

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.

lang/go/pkg-descr
6

You should probably add lang/go to the depends_blacklist function in Mk/Scripts/qa.sh 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.