Open cmacknz opened 2 years ago
This doesn't seem to affect builds with PLATFORMS="darwin/arm64"
, at least not when building on an M1 machine.
at least not when building on an M1 machine.
Running on arm64 Docker chooses the Docker image build for arm64, it is different than the one run on an amd64-based machine, all the tools compilers, and so on are built for a different architecture so it is not a surprise that behaves in a different way.
CGO_ENABLED=1 in a cross-compile environment could behave differently than in a native build environment, for me it is difficult to justify the use of CGO_ENABLED (see https://dave.cheney.net/tag/cgo)
To reproduce the issue in https://github.com/elastic/beats:
The command will fail with the error:
Downgrading to the Go 1.17.10 crossbuild image or setting
DEV=0
fixes the issue.There were multiple changes merged to the Go 1.17 branch between the Go 1.17.10 and Go 1.17.11 version bumps (https://github.com/elastic/golang-crossbuild/commits/1.17) that could be responsible for this: