-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
The bindeps feature with cdylib artefact doesn't work when cross compiling for musl target #15095
Comments
It seems that bindeps does not respect specified |
There are two halves to this:
|
The problem I'm trying to solve with bindeps is that I have a workspace with multiple cdylib crates, some of which depends on other cdylib crates in the same workspace and I need to control build order of the crates, because the dependent I've tried bindeps and at first it seems did a trick, in Is there any way to make one cdylib crate dependent by another cdylib crate and specify resulting artifact (.lib/.so) in I've tried to locate |
If you use bindep you get the path to the compiled cdylib as env var passed to your build.rs, right? |
Yes, that is right. With bindeps and |
I've found, that it is possible to specify [build-dependencies]
foo = { path = "../foo", artifact = "cdylib", version = "*", target = "target" } That way my problem is solved and cross compilation works. |
AFAICT this is no longer a concern for rust-lang/rust, but sending this over to the cargo issue tracker for the
bit for further triage by T-cargo. @rustbot transfer cargo |
@rustbot label: +S-triage |
I have a workspace with two crates:
extern "C"
functionsfoo
library (as shared library)The
bar
crate uses unstablebindeps
feature of cargo to specify build dependency on artefactcdylib
offoo
library in Cargo.toml.Everything works fine when built for native toolchain, but when I build
bar
with specifying a--target aarch64-unknown-linux-musl
for cross compiling, then I get an error:In the error above it says it can't produce cdylib for target
x86_64
, even though I specifiedaarch64
.If I build
foo
library, it compiled successfully:I've attached a minimal example to reproduce that issue:
musl_cdylib.zip
It contains a workspace with
foo
andbar
crates,Dockerfile
to setup environment for cross compilation, andREADME.md
with steps to build an image.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: