Skip to content
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

Cross-compilation with Bzlmod not working #2518

Open
ar3s3ru opened this issue Feb 25, 2024 · 2 comments
Open

Cross-compilation with Bzlmod not working #2518

ar3s3ru opened this issue Feb 25, 2024 · 2 comments
Labels

Comments

@ar3s3ru
Copy link

ar3s3ru commented Feb 25, 2024

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

@firekind
Copy link

I've had a similar issue as well, If I remember correctly, switching from hermetic_cc_toolchain to using the locally installed clang had worked.
Although, my situation was reversed. we had to target darwin-arm64 from linux-arm64, but the error was the same.

@ar3s3ru
Copy link
Author

ar3s3ru commented Mar 29, 2024

@firekind if you were targeting darwin, then you likely hit this issue: uber/hermetic_cc_toolchain#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants