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
Using msvc and crt-static #929
Comments
@wravery this sounds wrong to me, it does not match what I understand about cargo config. Can you double check the behavior you observed on your end? Can you provide a more detailed reproducible description of what you are doing to observe that behavior? Here is what I did to confirm that this is not the behavior I get. Add a dependency on https://docs.rs/crate/print-target-feature/0.1.0/source/build.rs which just prints out the value of CARGO_CFG_TARGET_FEATURE from its build.rs: [package]
name = "repro"
version = "0.0.0"
[dependencies]
print-target-feature = "*" Building CARGO_CFG_TARGET_FEATURE="fxsr,sse,sse2" Then adding .cargo/config.toml: [target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+crt-static"] building CARGO_CFG_TARGET_FEATURE="crt-static,fxsr,sse,sse2" |
Assuming we do find that .cargo/config.toml's crt-static setting is not observable to certain dependencies (in a way that does not apply to the |
OK, let me try to isolate a project structure that reproduces this behavior. |
I was wrong about the cause, my However, it still isn't getting picked up by |
Actually, that's just setting metadata. I don't think it should change the behavior of cargo. |
The verbose output I'm looking at seems to come from the
It's passing |
Good catch — link-cplusplus is kind of sketchy and I would be prepared to believe that whatever it does doesn't do the right thing in the presence of crt-static. If you track down what is going on, I would accept a fix in the link-cplusplus crate (code or documentation). |
Looks like the bug is in println!("target_feature:crt-static: {:?}", cfg!(target_feature = "crt-static"));
println!("env:CARGO_CFG_TARGET_FEATURE: {:?}", env::var("CARGO_CFG_TARGET_FEATURE")); and here's the ouput:
The |
That's from a standalone build of |
Moved from #927 (comment).
The text was updated successfully, but these errors were encountered: