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
First of of all, huge thank you for putting this project example online, it has been a tremendous help! 🙌
I am now able to successfully cross-compile basic Linux targets from MacOS. However, when my binary contains more advanced external crates, I get some platform errors. The postgres crate is one example.
can't find crate for futures_macro
--> external/raze__futures_util__0_3_19/src/async_await/stream_select_mod.rs:6:9
|
6 | pub use futures_macro::stream_select_internal;
| ^^^^^^^^^^^^^ can't find crate
|
= note: extern location for futures_macro is of an unknown type: bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/raze__futures_macro__0_3_19/libfutures_macro-152066848.dylib
= help: file name should be lib*.rlib or lib*..so
The error is caused because, for the futures_macro crate, a .dylib file was generated instead of a .rlib file.
I tried to reproduce the error by creating my own macro and use the rust_proc_macro rule.
Running bazel build //:macro now builds a valid .dylib file. However, bazel build //:macro --platforms //build/platform:musl fails with the following error:
First of of all, huge thank you for putting this project example online, it has been a tremendous help! 🙌
I am now able to successfully cross-compile basic Linux targets from MacOS. However, when my binary contains more advanced external crates, I get some platform errors. The postgres crate is one example.
In this case the error is:
bazel build //cargo:postgres --platforms //build/platform:musl
The error is caused because, for the futures_macro crate, a
.dylib
file was generated instead of a.rlib
file.I tried to reproduce the error by creating my own macro and use the
rust_proc_macro
rule.Let's say I have this
src/lib.rs
and BUILD.bazel like this:
Running
bazel build //:macro
now builds a valid.dylib
file. However,bazel build //:macro --platforms //build/platform:musl
fails with the following error:Any idea on how to extend the musl toolchain for
rust_proc_macro
to work? 🙏The text was updated successfully, but these errors were encountered: