-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rust libs are not reproducible from 1.75 #120825
Comments
Could you see if you can extract both versions of the Edit: Forgot that I removed metadata compression for dylibs a while ago. So you can just diff the |
I'm assigning myself because I'm going to try to build a tool to help with this. It might be pretty cooked. |
Attached librustc_driver-cbccc190731a002e & libcstr-13225ad2e5d1b622 libs Diff for .rustc section of librustc_driver-cbccc190731a002e (in librustc_driver the diff is huge, below image is part of it. The attached librustc_driver_report.pdf is full diff report) |
@saethlin Tool for what? |
Figuring out what these bytes are. |
Looks like some paths aren't getting remapped as they should. |
Is there a way to pull out that info, which paths, build stage, crate info etc? The verbose build log shows me the --remap-path-prefix option is passed during build of each crate and the debug statements (I added) in 4b7e0a0 also shows correct paths. |
Does this mean the |
|
Looks like the vendored crate sources don't get remapped. I found #119582 from 3 weeks ago, which fixes this. It will be in rust 1.77. |
@bjorn3 As I said in issue description, I tried build with that commit but still the issue is not solved. |
Missed that. For libcstr does it reduce the diff by removing the path changes and just not the changes in random bytes or does it not help at all? If the former, there are probably two different issues with one being fixed by that PR. |
In our build env, we are using vendored sources of rust and so we must take the path changes given in 4b7e0a0. Also, I tried build with 1.76.0 release also and the issue reproduces there as well. |
I tried reproducing this issue with 1.76.0 upstream rust sources (w/o Yocto build framework) and it's reproducing there as well. The patch 4b7e0a0 also not fixing the issue. Add below code in shell script and execute that will reproduce the issue. (Here also, the
Below are the *.so files differed with rust upstream sources and the same with Yocto build also. |
I've further analyzed the differences in 1.74 to 1.75 generated libs and intermediate files like .rlib. During the build absolute path names are found in many stages but all are replaced/remapped as per '--remap-path-prefix' command by end of the build except the '.rustc' section contents. I see that the .rustc section of 1.74 libs having the path names with '/rust/$hash' format. Below is the contents of libdarling_macro-*.so file. Where as in 1.75 this is having absolute path names I tried identifying the changes in 1.75 related to paths and found below. I reverted these commits but the issue is still there.
I find a few other commits as well (listed below). I tried reverting these, but these are having a lot of dependencies with other commits also and ended up in lot of build issues. In summary, with 1.75
Can you let us know,
|
I think eccc9e6#diff-a83e0054300d480e1f72a82b5b49c0f01c5f4e49475b0ed2427074d14c67f82cR1262 is the problem. Try removing the early return at rust/compiler/rustc_session/src/session.rs Line 909 in b8de591
|
This works... I changed to below. Just verified binary comparison and that shows binaries are identical... Not yet looked into binary section details yet. I will update you... @bjorn3 Thank you.. |
With binaries you also mean all |
Yes, I missed to mention the shared objects. I checked the .rustc section after this change and the path names inside the .so are changed back to /rust/$hash format. What exactly the below change is doing? And, can this change be included in upcoming releases? |
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) (From OE-Core rev: 37cbccfe18b0c8f614a130f923aa6a2519ec62f3) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) (From OE-Core rev: 37cbccfe18b0c8f614a130f923aa6a2519ec62f3) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) (From OE-Core rev: 37cbccfe18b0c8f614a130f923aa6a2519ec62f3) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With rust 1.75 the absolute build path is embedding into '.rustc' section and which causes reproducibility issues. Detailed issue is here. rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format.
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) (From OE-Core rev: 37cbccfe18b0c8f614a130f923aa6a2519ec62f3) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) (From OE-Core rev: a80ce6e3c023809d1ec13d19e8acb25770b54737) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
With rust 1.75 the absolute build path is embedding into '.rustc' section and which causes reproducibility issues. Detailed issue is here. rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format.
With rust 1.75 the absolute build path is embedding into '.rustc' section and which causes reproducibility issues. Detailed issue is here. rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format.
This has a fix in #121959 but it still needs a test. |
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Rollup merge of rust-lang#121959 - sundeep-kokkonda:patch-2, r=davidtwco Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]> Signed-off-by: Jose Quaresma <[email protected]> (adapted from oe-core commit a80ce6e3c023809d1ec13d19e8acb25770b54737) Signed-off-by: Scott Murray <[email protected]>
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang/rust#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang/rust#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
With 1.75 rust release, the '.rustc' section of shared object libs are embedded with absolute path names which is casuing reproducibiluty issues. This change will fix the path name format back to '/rust/$hash' as in earlier versions. Below are the links for detailed bug description & discusssion with upstream rust. rust-lang/rust#120825 (comment) rust-lang/rust#120825 (comment) (From OE-Core rev: a80ce6e3c023809d1ec13d19e8acb25770b54737) Signed-off-by: Sundeep KOKKONDA <[email protected]> Signed-off-by: Yash Shinde <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
It looks like the shell script in this comment #120825 (comment) should be converted to a test. Possibly an rmake test. |
Hello,
We're building rust in Yocto framework for a custom target, and there we are facing a reproducible issue with the libs generated during the build. When the rust is build in two different paths the generated libs are not identical, those are getting differed in .rustc section. This is observed from the rust 1.75.0 onwards.
(We've enabled remap-debuginfo option but still this issue is happening, this option was learned from issue discussion https://internals.rust-lang.org/t/librustc-driver-so-not-reproducible/19639 and this was working fine till 1.74.1)
I've analyzed the changes from 1.74.1 to 1.75.0, there are changes related to Cargo, llvm & some changes w.r.t to bolt feature/optimization are there. I've tried a few builds by reverting these changes but still the issue is reproducing.
There are a few commits in 85c0ce2 for src/bootstrap/src/core/builder.rs & src/bootstrap/src/bin/rustc.rs files which have changes related to remap-debuginfo option and I suspect this commit might causing the issue. I tried build by reverting the commit & with the latest changes in 4b7e0a0 but still issue is reproduing. There is a new RUSTC_CARGO_REGISTRY_SRC_TO_REMAP is added in this commit. I added a few debug statements in here to see the build paths passed, I can see those are passed correctly to RUSTC_CARGO_REGISTRY_SRC_TO_REMAP.
Any hints on what might cause reproducible issues with this commit on rust 1.75? Let me know if any other info is needed.
Non-reproducible libs are here:
The text was updated successfully, but these errors were encountered: