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

can't reproduce build with a custom target #10760

Closed
shkoo opened this issue Jun 15, 2022 · 1 comment
Closed

can't reproduce build with a custom target #10760

shkoo opened this issue Jun 15, 2022 · 1 comment
Labels
C-bug Category: bug

Comments

@shkoo
Copy link
Contributor

shkoo commented Jun 15, 2022

Problem

When compiling to a custom target based on a JSON target spec, Cargo seems to hash the full pathname of the JSON target spec into its metadata hash. This makes it very difficult to reproduce these builds on different machines with different filesystem layouts.

Ideally builds could be reproducible no matter what the full pathname is of the JSON target spec.

Steps

cargo new path-repro
cd path-repro
for i in a b
do
    mkdir $i
    rustc --print=target-spec-json -Z unstable-options |grep -v is-builtin > $i/x86_64-unknown-linux-gnu.json
    cargo +nightly rustc --release --target-dir=build-$i --target=$i/x86_64-unknown-linux-gnu.json -Z build-std -- --emit=asm
done
diff -u build-?/*/release/deps/path_repro*.s

Possible Solution(s)

I think this should be fixed by #10746

Notes

No response

Version

$ cargo version --verbose
cargo 1.63.0-nightly (4d92f07f3 2022-06-09)
release: 1.63.0-nightly
commit-hash: 4d92f07f34ba7fb7d7f207564942508f46c225d3
commit-date: 2022-06-09
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1n)
os: Ubuntu 20.04 (focal) [64-bit]
@shkoo shkoo added the C-bug Category: bug label Jun 15, 2022
@weihanglo
Copy link
Member

Fixed with #10746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants