-
Notifications
You must be signed in to change notification settings - Fork 23
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
rust-flags specified in cargo configs are ignored by autocfg. #15
Comments
It's going to get really hairy if we try to duplicate cargo's logic for finding all applicable Maybe we should make a Cargo feature request to set its resolved |
Hairy indeed! It might be possible to do something with the cargo rustc command. I just tried the following: $ cat .cargo/config $ cargo rustc --target thumbv7neon-unknown-linux-gnueabihf -- --print sysroot Sadly cargo can't handle there being no Cargo.toml and it sets a bunch of flags. It is possible to set: [lib] in Cargo.toml but there is no way of actually passing stdin to rustc. |
Using Going back to a dummy crate, it needs to be a subdirectory of the original crate to inherit the same |
See also rust-lang/cargo#7501 |
You're right. I my particular case I'm using the global cargo config and then it works. But not for crate specific configs. It also doesn't seem to be possible to make cargo stop linking so it's going to be a bit more fragile. |
audiocfg does not have support for using anything but the RUSTFLAGS environment variable: cuviper/autocfg#15
See also rust-lang/cargo#4423 TL;DR: cargo doesn’t make a good distinction between host rustflags and target rustflags, which I imagine would complicate matters here further. |
Since Rust/Cargo 1.55 (rust-lang/cargo#9601) and |
When invoking rustc autocfg adds rustflags from the RUSTFLAGS environment variable. This makes things like setting --sysroot work.
The problem is flags can also be specified in the cargo configurations:
https://doc.rust-lang.org/cargo/reference/config.html
These do not seem to be picked up properly by autocfg, so some crates (indexmap in my case) cannot detect features properly if you set important flags like --sysroot in ~/.cargo/config or .cargo/config or any of the other paths used.
The text was updated successfully, but these errors were encountered: