Skip to content
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

Modifying a target specification file should recompile of all the relevant crates #2616

Closed
japaric opened this issue Apr 25, 2016 · 2 comments · Fixed by #9223
Closed

Modifying a target specification file should recompile of all the relevant crates #2616

japaric opened this issue Apr 25, 2016 · 2 comments · Fixed by #9223
Labels
A-rebuild-detection Area: rebuild detection and fingerprinting A-target-spec Area: target JSON spec files C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-build

Comments

@japaric
Copy link
Member

japaric commented Apr 25, 2016

Currently it doesn't rebuild any crate.

STR

$ cargo install xargo
$ git clone https://github.com/japaric/cu
$ git checkout 2f63509838b57af8b9bea890c02cfcc41fc74e32
$ xargo build --target stm32f100
   Compiling rlibc v1.0.0
   Compiling compiler-rt v0.1.0 (file:///home/japaric/rust/cu/compiler-rt)
   Compiling cu v0.1.0 (file:///home/japaric/rust/cu)

$ edit stm32f100.json  # add a newline or whatever

$ xargo build --target stm32f100 --verbose
       Fresh rlibc v1.0.0
       Fresh compiler-rt v0.1.0 (file:///home/japaric/rust/cu/compiler-rt)
       Fresh cu v0.1.0 (file:///home/japaric/rust/cu)

Meta

$ rustc -V
rustc 1.10.0-nightly (b5ba5923f 2016-04-21)

$ cargo -V
cargo 0.11.0-nightly (867627c 2016-04-21)

recompile all the relevant crates

Should everything be recompiled? Everything that was compiled with --target $custom_target must be recompiled. But, what about build scripts? I think they can't rely on the contents of $custom_target.json right now, so they probably shouldn't be recompiled/rerun.

cc @alexcrichton

@alexcrichton
Copy link
Member

Ah yeah this is currently "expected" albeit not necessarily intentional behavior. Targets are completely opaque strings to Cargo (it doesn't try to parse or figure out what it is at all, so Cargo doesn't even know that the target spec is coming from a local file.

Cargo could probably leverage rust-lang/rust#32847 however to add this to the fingerprint for all crates.

@ehuss
Copy link
Contributor

ehuss commented Apr 8, 2020

Noted in #8085, when fixing this, the rustc_cache will also need to be updated when the spec changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rebuild-detection Area: rebuild detection and fingerprinting A-target-spec Area: target JSON spec files C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants