Skip to content

make rlib object names deterministic - #165202

Open
paradoxicalguy wants to merge 1 commit into
rust-lang:mainfrom
paradoxicalguy:fix/deterministic-rlib-members
Open

paradoxicalguy wants to merge 1 commit into
rust-lang:mainfrom
paradoxicalguy:fix/deterministic-rlib-members

Conversation

@paradoxicalguy

Copy link
Copy Markdown
Member

previously, rustc's random temporary object filenames leaked into .rlib archive member names and lib.rmeta-link.
with debuginfo enabled, absolute temporary paths also leaked into CodeView S_OBJNAME, making builds non-reproducible.

this change uses stable object names in archives, metadata, and CodeView while keeping temporary files unchanged.

result: byte-identical .rlibs across different build directories, tested with 16 CGUs and -Cdebuginfo=2. added a regression test; normal linking and ThinLTO also pass.

r? @bjorn3

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 30, 2026
@rust-log-analyzer

This comment has been minimized.

@paradoxicalguy
paradoxicalguy force-pushed the fix/deterministic-rlib-members branch from 153421a to f2cf989 Compare October 30, 2026 19:13
@rust-log-analyzer

This comment has been minimized.

@paradoxicalguy

Copy link
Copy Markdown
Member Author

:/ okay

@paradoxicalguy
paradoxicalguy force-pushed the fix/deterministic-rlib-members branch from f2cf989 to a634851 Compare October 30, 2026 21:39
@paradoxicalguy

Copy link
Copy Markdown
Member Author

updated the tests affected by the new deterministic object naming; adjusted the expected diagnostics in lto-duplicate-symbols, archive member matching in cross-lang-lto, and llvm ir filename matching in pgo-embed-bc-lto.

validated locally on with the full run-make, ui, incremental, llvm codegen, and codegen-units suites

@rust-bors

This comment has been minimized.

@paradoxicalguy
paradoxicalguy force-pushed the fix/deterministic-rlib-members branch from a634851 to 24b5f82 Compare November 1, 2026 11:42
@rustbot

rustbot commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@paradoxicalguy

Copy link
Copy Markdown
Member Author

@bjorn3
image

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants