Open jgalenson opened 4 years ago
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.
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.
Hmm, I see. Are you sure this is not a rustc bug?
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.
If I make two different copies of rust-analyzer, set them both to build with
--remap-path-prefix
by adding it torustflags
in.cargo/config
, and build them withcargo xtask install
, I see multiple differences in the output files, includinglibrust_analyzer.rlib
and a number of the rlibs inrelease/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.