ARM external linker must be gold (issue #15696), but is not: zig ld 0.11.0
After upgrade on https://github.com/uber/hermetic_cc_toolchain/releases/tag/v2.1.2 On linux/amd64 VM I get error when trying to build go_binary.
2023/09/30 07:07:20 ARM external linker must be gold (issue #15696), but is not: zig ld 0.11.0
link: error running subcommand external/go_sdk/pkg/tool/linux_amd64/link: exit status 1
https://github.com/golang/go/issues/15696
Rolled back to the 2.0.0 to workaround this issue.
Tested with
register_toolchains(
"@zig_sdk//toolchain:linux_amd64_gnu.2.31",
"@zig_sdk//toolchain:linux_arm64_gnu.2.31",
)
and with 2.34.
Debug output:
ERROR: /home/kublr/kublr/cluster-controller/BUILD.bazel:27:10: GoLink cluster-controller/cluster-controller failed: (Exit 1): linux-sandbox failed: error executing command
(cd /home/kublr/.cache/bazel/_bazel_kublr/69fb4c52c15303cc4e23e5352527edec/sandbox/linux-sandbox/1/execroot/kublr && \
exec env - \
CGO_ENABLED=1 \
GOARCH=arm64 \
GOEXPERIMENT=nocoverageredesign \
GOOS=linux \
GOPATH='' \
GOROOT=bazel-out/k8-fastbuild-ST-29c7f66a8f11/bin/external/io_bazel_rules_go/stdlib_ \
GOROOT_FINAL=GOROOT \
PATH=external/zig_sdk/tools:external/zig_sdk/tools/aarch64-linux-gnu.2.34:/bin:/usr/bin \
TMPDIR=/tmp \
/home/kublr/.cache/bazel/_bazel_kublr/install/a09dbb90c658248f08f9aa0eba11997d/linux-sandbox -t 15 -w /home/kublr/.cache/bazel/_bazel_kublr/69fb4c52c15303cc4e23e5352527edec/sandbox/linux-sandbox/1/execroot/kublr -w /tmp -w /dev/shm -S /home/kublr/.cache/bazel/_bazel_kublr/69fb4c52c15303cc4e23e5352527edec/sandbox/linux-sandbox/1/stats.out -D -- bazel-out/k8-opt-exec-2B5CBBC6-ST-e846b08c7501/bin/external/go_sdk/builder_reset/builder '-param=bazel-out/k8-fastbuild-ST-49c02b6fcfac/bin/cluster-controller/cluster-controller-0.params' -- -extld external/zig_sdk/tools/aarch64-linux-gnu.2.34/c++ -X 'src.kublr.io/kublr/common/pkg/version.version=1.28.0-alpha.0' '-buildid=redacted' -s -w -extldflags '-fno-lto -fsanitize-undefined-strip-path-components=-1')
Which Go/Zig version do you use with this? Can this be reproduced with tests of hermetic_cc_toolchain?
@motiejus go 1.20 zig is default toolchain version in v2.1.2
which test I should run?
@motiejus go 1.20 zig is default toolchain version in v2.1.2
which test I should run?
The point is we need to be able to reproduce the failure. Your report does not include a test case, so let's come up with one.
We have a bunch of tests in hermetic_cc_toolchain, which are currently green. Perhaps it would be easy to change one that reproduces this failure?
I can only confirm that error is in multi architecture image transformation written just like https://github.com/bazel-contrib/rules_oci/blob/main/examples/multi_arch/BUILD.bazel#L19-L26 I cant publish whole code example but the same code works well with 2.0.0 release of hermetic_cc_toolchain.
I've just added a test to reproduce this failure in https://github.com/uber/hermetic_cc_toolchain/pull/129
@lbcjbb Thank you. Much appreciated.
https://github.com/uber/hermetic_cc_toolchain/pull/129/commits/56c4e1ecf39f8e4be53fe9f7ecfc715cd9d7409e should fix this issue now.