You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gazelle extension breaks cc toolchain resolution during cross compiling on darwin arm64 #1825
Traceback (most recent call last):
File "/virtual_builtins_bzl/common/cc/cc_toolchain_alias.bzl", line 26, column 48, in _impl
File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 219, column 17, in _find_cpp_toolchain
Error in fail: Unable to find a CC toolchain using toolchain resolution. Target: @@bazel_tools//tools/cpp:current_cc_toolchain, Platform: @@io_bazel_rules_go//go/toolchain:darwin_amd64, Exec platform: @@local_config_platform//:host
The error is gone when either
python extension is removed or
CC toolchain resolution is disabled via --noincompatible_enable_cc_toolchain_resolution
🌍 Your Environment
Operating System:
uname -a
Darwin tanx-D5VYHJD2X7 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 arm64
Output of bazel version:
Bazelisk version: development
Build label: 7.1.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Mar 21 18:08:59 2024 (1711044539)
Build timestamp: 1711044539
Build timestamp as int: 1711044539
@alexeagle has mentioned in a94deb8 that they may be working on a better version for their aspect-cli, but I am not sure if that was done and if it has, I am not sure if he has any plans (if it is feasible) on upstreaming the work to this repo.
Note, that in #1485 we discussed about the effect of that change breaking cross-compilation, but I am not sure if it is documented in README.
Activity
aignas commentedon Apr 9, 2024
From the first glance I am not sure how this is gazelle plugin's problem.
What kind of toolchains do you have cotfigured to build gazelle? I don't see anything about it in the repro.
xytan0056 commentedon Apr 10, 2024
we just use normal golang toolchain https://github.com/xytan0056/cgo_test/blob/30a62b2654561f0d08e98dbf14c2e6a7c8d55e74/WORKSPACE#L193
The problem is cross-compilation of gazelle works all good before enabling the python extension
aignas commentedon Apr 17, 2024
I think this is because we include a
.zipfile with the interpreter and the python code that parses the python files.The code in question is here: https://github.com/bazelbuild/rules_python/blob/4be00a69ae3a0c4e7ef3a5f952254bacd16d0a2a/gazelle/python/BUILD.bazel#L70
@alexeagle has mentioned in a94deb8 that they may be working on a better version for their
aspect-cli, but I am not sure if that was done and if it has, I am not sure if he has any plans (if it is feasible) on upstreaming the work to this repo.Note, that in #1485 we discussed about the effect of that change breaking cross-compilation, but I am not sure if it is documented in README.
linzhp commentedon Apr 17, 2024
Actually, the root cause is in py_binary, not the zip file. Created a separate ticket with reproduction: #1857.
aignas commentedon May 13, 2024
Closing this ticket as fixing #1857 would fix this as well.
aignas commentedon May 15, 2024
Re-opening because there is a PR that will address the cross-building of the gazelle plugin.
feat(gazelle): pure golang helper (#1895)