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

Non-reproducible builds #5351

Open
jgalenson opened this issue Jul 13, 2020 · 4 comments
Open

Non-reproducible builds #5351

jgalenson opened this issue Jul 13, 2020 · 4 comments
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@jgalenson
Copy link

If I make two different copies of rust-analyzer, set them both to build with --remap-path-prefix by adding it to rustflags in .cargo/config, and build them with cargo xtask install, I see multiple differences in the output files, including librust_analyzer.rlib and a number of the rlibs in release/deps. Many of the rlib differences are non-obvious differences in rmeta files.

Now that this is part of the rustc tree, this affects rust-lang/rust#34902.

@jonas-schievink
Copy link
Contributor

With this patch the output of two consecutive builds is identical:

--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,8 @@ members = [ "crates/*", "xtask/" ]
 # disabling debug info speeds up builds a bunch,
 # and we don't rely on it for debugging that much.
 debug = 0
+incremental = false
+codegen-units = 1
 
 [profile.release]

Therefore, closing as a rustc bug.

@jgalenson
Copy link
Author

jgalenson commented Jul 13, 2020

I still see differences with that patch, both in target/debug (just libxtask-*.rlib) and in target/release (same as before). For one thing, doesn't that not affect the release build?

To make it more clear, I'm not talking about two repeated builds of the same directory but two builds of different directories. That is, clone the repo, make a copy of it in a different location, add --remap-path-prefix to both, build both, and compare the outputs.

@jonas-schievink
Copy link
Contributor

Hmm, I see. Are you sure this is not a rustc bug?

@jgalenson
Copy link
Author

No, I'm not sure. But the steps I described in the first comment here reproduce for me when I clone this project by itself, so I don't think it's a bug in the rustc build system, if that's what you meant. The cause of the non-reproducibility could be due to a bug in rustc itself, of course, but it also could be due to something here; it's not obvious to me which is the case.

@flodiebold flodiebold added the S-actionable Someone could pick this issue up and work on it right now label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

3 participants