#66819 closed defect (fixed)

go 1.20.0 doesn't build on High Sierra

Reported by: blair (Blair Zajac) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: herbygillot (Herby Gillot), mascguy (Christopher Nielsen)
Port: go

Description

# port -v upgrade --enforce-variants outdated
--->  Computing dependencies for go.
--->  Fetching distfiles for go
--->  Verifying checksums for go
--->  Checksumming go1.20.src.tar.gz
--->  Extracting go
--->  Extracting go1.20.src.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_lang_go/go/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/go/go1.20.src.tar.gz' | /usr/bin/tar -xf -
--->  Configuring go
--->  Building go
Executing:  cd "/opt/local/var/macports/build/_Users_bz_macports-ports.git_lang_go/go/work/go/src" && ./make.bash
Building Go cmd/dist using /opt/local/lib/go-1.4. (go1.4.3 darwin/amd64)
can't load package: package ./cmd/dist: found packages build.go (main) and notgo117.go (building_Go_requires_Go_1_17_13_or_later) in /opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_lang_go/go/work/go/src/cmd/dist
Command failed:  cd "/opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_lang_go/go/work/go/src" && ./make.bash
Exit code: 1
Error: Failed to build go: command execution failed

/opt/local/lib/go-1.4 does exist on my system.

Change History (18)

comment:1 Changed 21 months ago by herbygillot (Herby Gillot)

I had discovered this exact same issue in a PR I opened to update Go: https://github.com/macports/macports-ports/pull/17559

But @ci42 summarily updated to 1.20 here: https://github.com/macports/macports-ports/commit/01d73a14bfda876e2524d2099605d18b1d61aa4c

@ci42, please fix.

comment:2 Changed 21 months ago by herbygillot (Herby Gillot)

Cc: herbygillot added

comment:3 Changed 21 months ago by blair (Blair Zajac)

What's the diff between your PR and the commit that upgraded to 1.20? Can you rebase your PR on the current HEAD?

comment:4 Changed 21 months ago by herbygillot (Herby Gillot)

The point I was making was that I ran into this same error in my PR, and because of that, I held off from committing.

@ci42 on the other hand just committed the update right off the bat into master. This same pattern has happened before causing issues to end users.

comment:5 Changed 21 months ago by rswail (Ron Wail)

Duplicate just closed for Big Sur same error.

comment:6 Changed 21 months ago by herbygillot (Herby Gillot)

In 432d42769a9cd82ae5e172993bf6da786fd0f21f/macports-ports (master):

go: build using pre-built binary bootstrap

See: #66819

comment:7 Changed 21 months ago by herbygillot (Herby Gillot)

I committed a change that should improve the situation. @rswall, @blair, can you confirm?

comment:8 Changed 21 months ago by kencu (Ken)

Moving ports forward while trying to maintain support for older systems can be challenging...

I think our benchmark has to be moving ports forward. Otherwise, MacPorts becomes irrelevant. Testing on what the CI system supports is really all we can ask maintainers to do.

If such an update breaks older systems, which inevitably will happen, then those of us with those systems and with interest can rally and either fix them, fix legacysupport, or help provide a build or binary fallback implementation.

But I think we can't put too much weight on older systems support to the point where we lose maintainers or maintainer's interest because they are afraid their update will break older system they can't test on and don't care about...we'll lose everyone, eventually.

Some of the really core ports have "devel" versions as you know, to give people a heads-up about wreckage that is coming. If interested people don't pay attention and don't try to fix these devel ports when errors show up, well, caveat emptor, really

comment:9 Changed 21 months ago by herbygillot (Herby Gillot)

I agree 100%, @kencu. But the problem here is not in regards to older systems.

The update directly committed broke supported systems for x86_64. Go 1.20 supports High Sierra and higher for x86_64.

This could have been caught ahead of time in CI, which I was trying to do via the PR I referenced, but that was completely ignored and an update just committed to master outright. This is the second time this has happened with the Go port specifically, requiring cleanup & fixes after the fact.

Like Rust, this is a very key toolchain port, and when it's broken, many other ports downstream are affected, and maintainers can no longer test their updates to their downstream ports in CI (especially in this case, our Github CI is x86_64 only, so effectively anything Go was untestable).

comment:10 Changed 18 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:11 Changed 18 months ago by mascguy (Christopher Nielsen)

Has this been fixed?

comment:12 Changed 18 months ago by mascguy (Christopher Nielsen)

On a related note, even if this has been fixed for go, does go-devel also need to be fixed...?

comment:13 Changed 18 months ago by blair (Blair Zajac)

I retired my High Sierra boot disk as I didn't need it any more so cannot check if go or go-devel compiles there now.

comment:14 in reply to:  13 Changed 18 months ago by mascguy (Christopher Nielsen)

Replying to blair:

I retired my High Sierra boot disk as I didn't need it any more so cannot check if go or go-devel compiles there now.

No worries, I already knew the answer: Yes, go-devel needs to be fixed:

https://ports.macports.org/port/go-devel/details/

comment:15 Changed 18 months ago by herbygillot (Herby Gillot)

As of this moment in time, both go-devel and go are at version 1.20.4 (Go 1.20 branch).

Go requires Go to build.

The last version of Go that could be built from scratch with a C compiler is Go 1.4 (the go-1.4 port). Go 1.17 is the last version of Go that could be built using go-1.4. From Go 1.18 onward, you must build using Go 1.17 or higher. (https://github.com/golang/go/issues/44505)

For Go 1.20, we build and bootstrap it using a downloaded binary of the same version of Go.

Older versions of macOS lack certain API functions and capabilities that Go 1.20 expects, so the downloaded binary fails to execute.

comment:16 Changed 18 months ago by kencu (Ken)

on my 10.13 system:

$ uname -a
Darwin Kens-MacBook-Pro-2.local 17.7.0 Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64 x86_64
$ port -v installed go
The following ports are currently installed:
  go @1.20.4_0 (active) requested_variants='' platform='darwin 17' archs='x86_64' date='2023-05-23T00:00:29-0400'

$ which go
/opt/local/bin/go

$ go version
go version go1.20.4 darwin/amd64

so everything seems ok? Let me dig a bit deeper...

comment:17 Changed 18 months ago by kencu (Ken)

yes, I just built go on 10.13 and it built through without any problem.

comment:18 Changed 18 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

and the build on 10.13 was successful on the buildbot too:

https://ports.macports.org/port/go/builds/

so I guess this ticket can be closed.

the next update of go may well break 10.13 again though.

Note: See TracTickets for help on using tickets.