Open
Description
Problem
I have a crate with a .cargo/config.toml
to enable tracing unstable features:
[build]
rustflags = ["--cfg", "tracing_unstable"]
However I use this crate as part of a workspace. So I also put the previous config.toml in my workspace .cargo/config.toml
.
Now everytime I save, rust-analyzer build every crate if I did a cargo check in the crate directory.
I found that it's because the rustflags are not merged properly:
INFO cargo::core::compiler::fingerprint: dirty: RustflagsChanged { old: ["--cfg", "tracing_unstable"], new: ["--cfg", "tracing_unstable", "--cfg", "tracing_unstable"] }
Steps
- Create a workspace and put the following content in
.cargo/config.toml
:
[build]
rustflags = ["--cfg", "tracing_unstable"]
- Create a crate
foo
and put the following content infoo/.cargo/config.toml
:
[build]
rustflags = ["--cfg", "tracing_unstable"]
- Now
cargo check
in the workspace and in thefoo
crate are rebuilding every crate instead of using previously built ones.
Possible Solution(s)
When appending rustflags, check for possible duplicates to avoid multiple same values counting as different ones.
Notes
No response
Version
cargo 1.78.0-nightly (ccc84ccec 2024-02-07)
release: 1.78.0-nightly
commit-hash: ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b
commit-date: 2024-02-07
host: x86_64-pc-windows-msvc
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.6.0-DEV (sys:0.4.71+curl-8.6.0 vendored ssl:Schannel)
os: Windows 10.0.22621 (Windows 11 Professional) [64-bit]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: rustflagsArea: rustflagsCategory: bugCategory: bugExperience: HardExperience: HardStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.