Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #14432 - weihanglo:target-applies-to-host, r=epage
fix: -Cmetadata includes whether extra rustflags is same as host ### What does this PR try to resolve? Fixes #14253 The root cause is described in <#14253 (comment)>: > `-Ztarget-applies-to-host --config target-applies-to-host=false` make it possible to build two units for the same output directory with different rustflags (one with artifact/target rustflags, one with none/host rust flags). Those flags aren't included in the `-Cmetadata` hash which is used to disambiguate different versions of crates, resulting in a conflict. The actual error being produced appears to be the result of two invocations of `rustc` racing and clobbering each other… While we don't hash RUSTFLAGS because it may contain absolute paths that hurts reproducibility, we track whether a unit's RUSTFLAGS is from host config, so that we can generate a different metadata hash for runtime and compile-time units. ### How should we test and review this PR? This hack is only enabled when `target-applies-to-host=false` and when compile kind is the host platform, so the shouldn't affect any stable behavior.
- Loading branch information