Closed berkus closed 5 years ago
These two ways are already different in rustc/cargo: With RUST_TARGET_PATH the target is treated as built-in target and no hash is appended. By passing a path to a json file, rustc understands that this a custom target and appends a hash (of the canonical file path) to differentiate between different custom targets with same file name (e.g. ~/foo/my-target.json
and ~/bar/my-target.json
).
I guess this has little chance to be fixed, given that cargo/rustc relies on this behavior.
The problem manifests when specifying the target in two different, but equivalent ways; which are then treated as non-equivalent by tooling:
Case 1
Case 2
The target points at the same file in the end, however, when building with the first command line and then switching to a second one, the tooling fails with:
After
cargo clean
the rebuild succeeds.It seems that fingerprints are calculated entirely differently, while they should be the same.