bazelbuild / bazelbuild/rules_rust
Cross-compilation with Bzlmod not working
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Hi folks, I'm experimenting with `rules_rust` to build a monolithic Rust app I'm working on.
One of the requirements I have is to target both `linux-arm64` and `linux-amd64` as deployment environments.
I'm developing locally on an M1 machine, so `darwin-arm64`.
I've added the `hermetic_cc_toolchain` Zig toolchains for cross-compilation, and added two explicit build targets (`repro-app_linux-arm64` & `repro-app_linux-amd64` in the example below) to build for both environments with `bazel build`.
However, I'm having issues while running either that or `bazel test //...`
This is the error I get:
```
= note: ld: library not found for -liconv
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
```
I've created a small example to reproduce the issue: https://github.com/ar3s3ru/repro-rules-rust-cross-compile
Contributor guide
Assessment
This issue has not been assessed yet.