build rustflags and target rustflags from config are not merged together #12862
Labels
A-configuration
Area: cargo config files and env vars
A-rustflags
Area: rustflags
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
In cargo config file, rustflags from sections
[target.<target>]
and[build]
cannot be used together, the one in[target.<target>]
takes precedence. Though I would expect them to be allowed together. Consider this config placed in the home directory.This causes
tokio_unstable
cfg flag to be unset when compiling cargo project.This doesn't happen if
[target.<target>]
is missing or its rustflags equal to empty array or unset.Steps
~/.cargo/config.toml
with the following contentcargo new foo
and use thismain.rs
cargo r
the string isn't printed.Possible Solution(s)
Merge together rustflags from
[target.<target>]
and[build]
sections.Notes
I would assume this also happens to other keys such as
rustdocflags
. This also happens when using multiple configs, i.e. 2 configs at~/.cargo/config.toml
andproject/.cargo/config.toml
.Version
The text was updated successfully, but these errors were encountered: