Open tyb0807 opened 7 months ago
Welcome, and thanks for the issue! If you can post a full git repo we can clone and run, that'd help to be able to debug. It looks like you're wiring up a zig
C++ toolchain?
I'm also seeing this (albeit with a WORKSPACE based config) when trying to use zig
to make a hermetic cc toolchain work. The core of the issue seems to be the fact that a hermetic cc_toolchain
kinda by definition needs to not depend on the host -- generally where one receives the host SDK from.
The relevant issue are these ones:
This really only crops up if you try and go full hermetic with BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
since otherwise the host sysroot is picked up via probably some xcrun
shenanigans.
Until then (or until the rules_rust
team drops https://github.com/bazelbuild/rules_rust/blob/67b3571d7e5e341de337317d84a6bec6b9d02ed7/rust/platform/triple_mappings.bzl#L180 this line) it'll be impossible to compile with a no-host hermetic CC toolchain since the don't detect host toolchain thing is an --action_env
thing, which makes it global in a way that i'm unable to see how to specifically exclude rules_rust
from.
@DhashS consider trying a LLVM toolchain setup with sysroot as it usually creates less fuzz.
See this example: https://github.com/marvin-hansen/examples/tree/main/rust-tutorial/01-hello-clang
For a LLVM with sysroot, see the cross compile example: https://github.com/marvin-hansen/examples/tree/main/rust-tutorial/02-hello-cross
Hi,
I'm very new to the field, so please let me know if the information I communicate here is useful enough for debugging.
I have the following dependency in
MODULE.bazel
When running a simple
blaze test
command, I get the following error (I've omitted the more verbose parts):Does anybody know what's happening here, and how to fix this please?