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

Hash the remapped sysroot instead of the original. #63505

Merged
merged 2 commits into from
Aug 17, 2019

Conversation

jgalenson
Copy link

One of the reasons that rustc builds are not reproducible is because the --sysroot path is dependent on the current directory. We can fix this by hashing the remapped sysroot instead of the original when applicable.

Note that with this patch, the hash will stay the same if both the sysroot and the remapped path change. However, given that if the contents of the sysroot change the hash will also stay the same, this might be acceptable. I would appreciate feedback on the best way to do this.

This helps #34902, although it does not fix it by itself.

This will help reproducible builds, as the sysroot depends on the
working directory.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2019
@cramertj
Copy link
Member

This LGTM, but just to be sure, r? @alexcrichton

@alexcrichton
Copy link
Member

Thanks for the PR! Since the sysroot argument is only used to load other libraries, which are themselves all tracked, I think we may be able to get by from just skipping the sysroot hashing entirely?

As suggested by @alexcrichton, the sysroot only loads libraries that
are themselves tracked.
@jgalenson
Copy link
Author

I didn't know the other libraries were themselves tracked; that does make this cleaner. All the tests seemed to pass locally, so here it is.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 13, 2019

📌 Commit 692c0bf has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2019
@jgalenson
Copy link
Author

There's a problem with the test runner: the Azure dashboard shows the test as having passed about 20 hours ago, but the Github dashboard doesn't see it. Can the test be restarted or something?

@alexcrichton
Copy link
Member

That's ok those are just PR tests, this is in the queue to be tested and merged in full.

@jgalenson
Copy link
Author

Ah, okay. Thanks!

Centril added a commit to Centril/rust that referenced this pull request Aug 15, 2019
Hash the remapped sysroot instead of the original.

One of the reasons that rustc builds are not reproducible is because the --sysroot path is dependent on the current directory.  We can fix this by hashing the remapped sysroot instead of the original when applicable.

Note that with this patch, the hash will stay the same if both the sysroot and the remapped path change.  However, given that if the contents of the sysroot change the hash will also stay the same, this might be acceptable.  I would appreciate feedback on the best way to do this.

This helps rust-lang#34902, although it does not fix it by itself.
@Centril
Copy link
Contributor

Centril commented Aug 16, 2019

@bors p=1

Centril added a commit to Centril/rust that referenced this pull request Aug 17, 2019
Hash the remapped sysroot instead of the original.

One of the reasons that rustc builds are not reproducible is because the --sysroot path is dependent on the current directory.  We can fix this by hashing the remapped sysroot instead of the original when applicable.

Note that with this patch, the hash will stay the same if both the sysroot and the remapped path change.  However, given that if the contents of the sysroot change the hash will also stay the same, this might be acceptable.  I would appreciate feedback on the best way to do this.

This helps rust-lang#34902, although it does not fix it by itself.
@bors
Copy link
Contributor

bors commented Aug 17, 2019

⌛ Testing commit 692c0bf with merge 50cc578efa01a276f3869cf28cc0aa543f3d8462...

Centril added a commit to Centril/rust that referenced this pull request Aug 17, 2019
Hash the remapped sysroot instead of the original.

One of the reasons that rustc builds are not reproducible is because the --sysroot path is dependent on the current directory.  We can fix this by hashing the remapped sysroot instead of the original when applicable.

Note that with this patch, the hash will stay the same if both the sysroot and the remapped path change.  However, given that if the contents of the sysroot change the hash will also stay the same, this might be acceptable.  I would appreciate feedback on the best way to do this.

This helps rust-lang#34902, although it does not fix it by itself.
@Centril
Copy link
Contributor

Centril commented Aug 17, 2019

@bors retry rolled up.

bors added a commit that referenced this pull request Aug 17, 2019
Rollup of 4 pull requests

Successful merges:

 - #62737 (Override Cycle::try_fold)
 - #63505 (Hash the remapped sysroot instead of the original.)
 - #63559 (rustc_codegen_utils: account for 1-indexed anonymous lifetimes in v0 mangling.)
 - #63621 (Modify librustc_llvm to pass -DNDEBUG while compiling.)

Failed merges:

r? @ghost
@RalfJung
Copy link
Member

Looks like the PR title / description no longer reflects the PR content?

@bors
Copy link
Contributor

bors commented Aug 17, 2019

☔ The latest upstream changes (presumably #63655) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 17, 2019
@bors bors merged commit 692c0bf into rust-lang:master Aug 17, 2019
@jgalenson jgalenson deleted the sysroot-hash branch August 17, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants