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
I'm specifying Rust flags for target features in .cargo/config.toml and they aren't propagated to CARGO_CFG_TARGET_FEATURE env variable in build.rs if I protect flags with the given target_arch ([target.'cfg(target_arch="x86_64")']). It works correctly if I put flags under [build] section.
The problem is that cargo is unable to use the rustflags from config for computing the cfg values because that could change which [target] tables are included from the config. Cargo could potentially do that in a loop until it converges to a fixed point, but I think that's unlikely.
At a minimum, I think there could be better documentation for this.
Problem
I'm specifying Rust flags for target features in
.cargo/config.toml
and they aren't propagated toCARGO_CFG_TARGET_FEATURE
env variable inbuild.rs
if I protect flags with the giventarget_arch
([target.'cfg(target_arch="x86_64")']
). It works correctly if I put flags under[build]
section.Steps
I put together this simple example: https://github.com/EdvardD/cargo-build-rs-rustflags.
To reproduce:
git clone https://github.com/EdvardD/cargo-build-rs-rustflags.git && cd cargo-build-rs-rustflags && ./test.sh
Possible Solution(s)
No response
Notes
Version
The text was updated successfully, but these errors were encountered: