-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MUSL Bazelmod Example fails to compile on Ubuntu 20.04 with GLIBC 2.31 #2863
Comments
This is an interestingly different error from the others - the failure here is when building process_wrapper (an exec-config tool), which is using musl as the C++ toolchain, but is using the gnu rust toolchain. Passing I suspect this would also be fixed by registering a C++ toolchain (e.g. the LLVM toolchain) which allows for non-cross-compilation. But I agree that this should probably work out of the box, or at least we should give a way to not register the gnu -> gnu rust toolchain so that the musl one gets picked by default if you don't have a non-musl non-cross-compiling C++ toolchain... |
Thank you @illicitonion When I add the --host_platform=//platforms:linux_x86_64_musl flag, I get another gazillion errors of various kinds in my VM. I've replicated the exact same error on two different Linux VM's
|
Just a quick update, I managed to get a much larger and way more complex repo (>70 crates) to build with multiple MUSL cross targets; However, it only worked without MUSL linking and just compiling. I still cannot pinpoint this issue, but it seems to be more of a static linking issue rather than anything else. A quick look into the Rust issue tracker, though, reveled an abyss of complex issues related to static linking so I really don't know about this. I mean, the way I see it is that MUSL fills a massive gap left by LLVM for several platform triplets so I suppose documenting some examples accordingly should at lest enable a lot of use cases where static linking isn't required, but an LLVM target isn't available either so it looks net positive to me. Would it be worth to add some MUSL non-static linking examples to the Bzlmod folders? Thoughts? |
Repro:
https://github.com/marvin-hansen/rules_rust_fork/tree/bzlmod-musl/examples/bzlmod/musl_hello_world
Distro: Ubuntu 20,04
Platform: x86_64 GNU/Linux
The repro was tested in a VM in Orbstack (MacOS) since I don't have an Intel box around anymore.
rules_rust: commit 6086030c
aspect_bazel_lib: 2.5.0
toolchains_musl: 0.1.17 (also tested with 0.1.19)
CARGO_BAZEL_REPIN=true bazel build //...
bazel build //...
Error:
The error message suggests the libgc binary is incompatible with musl libc.
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
GNU ld (GNU Binutils for Ubuntu) 2.34
ldd (Ubuntu GLIBC 2.31-0ubuntu9.16) 2.31
The MUSL config is an exact carbon copy of the WORKSPACE example
just moved into a WORKSPACE.bazemod file; the original WORKSPACE example compiles
on the same VM so don't know what to say here.
After having tried a gazillion different MUSL Bzlmod configurations over the past two months to no avail,
I think it is simply most honest to put a note in the documentation that MUSL cannot be used with Bazelmod and just leave it there.
The text was updated successfully, but these errors were encountered: