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

remap-path-prefix affects dep-info #63329

Closed
ehuss opened this issue Aug 6, 2019 · 0 comments · Fixed by #63342
Closed

remap-path-prefix affects dep-info #63329

ehuss opened this issue Aug 6, 2019 · 0 comments · Fixed by #63342
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ehuss
Copy link
Contributor

ehuss commented Aug 6, 2019

The --remap-path-prefix flag affects paths in dep-info files. This causes some problems witth Cargo.

Cargo uses these paths to detect if any source file has been modified. Since the common use case for --remap-path-prefix is to rewrite to some artificial path (like /rustc/$HASH which rust distributions use), this causes them to point to non-existent paths, which Cargo cannot check.

In some cases, this doesn't matter. Workspace members are built with relative paths which (usually) won't match the remap value. However, registry or vendored paths will get remapped. Cargo won't find the path, so it will always assume it needs to rebuilt, breaking it's rebuild detection.

I think dep-info paths should not be remapped. I think it keeps with the spirit of reproducible builds (the binaries aren't affected, this is just a side-channel build-system file). However, I'm not certain. I also don't know how hard this will be to implement.

Oh, and -Z binary-dep-depinfo doesn't seem to be affected by --remap-path-prefix.

@jonas-schievink jonas-schievink added A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 6, 2019
Centril added a commit to Centril/rust that referenced this issue Aug 8, 2019
…ichton

Don't use remap-path-prefix in dep-info files.

This changes it so that dep-info files do not use remapped paths.

Having remapped paths causes problems with Cargo because if you remap to a nonexistent path (like `/rustc/$HASH` which rustc distributions do), then Cargo's change tracking thinks the files don't exist and will always rebuild.

I don't actually know if this is a good idea. I think it makes sense, but I do not know what the exact requirements are for reproducible builds. I consider these files separate from the binary artifacts generated, and as a build-system helper, so it seems reasonable to me.

I'm also not sure if this needs a test. I'll definitely add one on the cargo side if this is merged.

Closes rust-lang#63329
Centril added a commit to Centril/rust that referenced this issue Aug 8, 2019
…ichton

Don't use remap-path-prefix in dep-info files.

This changes it so that dep-info files do not use remapped paths.

Having remapped paths causes problems with Cargo because if you remap to a nonexistent path (like `/rustc/$HASH` which rustc distributions do), then Cargo's change tracking thinks the files don't exist and will always rebuild.

I don't actually know if this is a good idea. I think it makes sense, but I do not know what the exact requirements are for reproducible builds. I consider these files separate from the binary artifacts generated, and as a build-system helper, so it seems reasonable to me.

I'm also not sure if this needs a test. I'll definitely add one on the cargo side if this is merged.

Closes rust-lang#63329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants