Bug 15397

Summary: reproducibility failures in rust with v1.75
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Sundeep Kokkonda <sundeep.kokkonda>
Component: devtools / tool chainAssignee: Sundeep Kokkonda <sundeep.kokkonda>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: unspecified   
Target Milestone: 5.0 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Sundeep Kokkonda 2024-02-12 03:15:56 UTC
reproducibility tests are failed from v1.75 on-wards.
https://lists.openembedded.org/g/openembedded-core/message/193092

Same is observed with 1.76 update also.
https://lists.openembedded.org/g/openembedded-core/message/195281

Reproducibility test failures should be fixed.
Comment 1 Sundeep Kokkonda 2024-02-12 03:18:21 UTC
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 reproducing.

Further discussion is on-going with upstream.
https://github.com/rust-lang/rust/issues/120825
Comment 2 Sundeep Kokkonda 2024-02-26 14:44:31 UTC
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.
/rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/vendor/darling_macro/src/lib.rs

Where as in 1.75 this is having absolute path names
/home/skokkond/rust/rustc-1.75.0-src/vendor/darling_macro/src/lib.rs


Updated the analysis so far in rust community:
https://github.com/rust-lang/rust/issues/120825#issuecomment-1964307219
Comment 4 Sundeep Kokkonda 2024-03-18 04:12:02 UTC
Issue fixed with above mentioned commits in Comment #3.
Comment 5 Randy MacLeod 2024-03-19 20:34:52 UTC
Sundeep, 
I've re-opened the bug so you can provide links to a branch other than master-next.  As you know the commit id on master-next can change.
Please update and resolved the bug again.
Thanks.
Comment 6 Randy MacLeod 2024-03-21 15:03:50 UTC
-> Needinfo
Comment 7 Sundeep Kokkonda 2024-03-21 15:14:01 UTC
Issue fixed with below commit.
https://git.openembedded.org/openembedded-core/commit/?id=2eceaa4b6ca398ec233b18c1064970bdf68a9258
Comment 8 Randy MacLeod 2024-03-22 00:26:18 UTC
Thanks Sundeep.