-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Introduce -Zsplit-metadata option #93945
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit bf8a8f82a73414610384b4e36323c0966db8e908 with merge 86e45ec336f0ccde044af1ace8b3c425239d01f2... |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
💔 Test failed - checks-actions |
// The file was present and created by the same compiler version, but we | ||
// couldn't load it for some reason. Give a hard error instead of silently | ||
// ignoring it, but only if we would have given an error anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment doesn't make sense with the code below it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure where it came from. Maybe it was correct in an old draft? I finished a draft from September last year just now.
Dylib metadata compression increases code complexity and will become less important once -Zsplit-metadata is introduced
I don't think it is necessary anymore. As I understand it from issue 39504 the original problem was that rustbuild changed a hardlink in the cargo build dir to point to copy in the sysroot while cargo may have hardlinked it to the original first. I don't think this happens anymore and as such this workaround is no longer necessary.
If a crate is both an rlib and cdylib, the metadata loader would previously incorrectly assume that it is possible to link against the cdylib. Cdylibs don't export all symbols required for linking as rust library. Possibly fixes issue number 82151
This will make it easier to report rustc versions for older metadata formats.
This will split the crate metadata out of library files. Instead only the svh is preserved to allow for loading the right rmeta file. This significicantly reduces library size. In addition it allows for cheaper checks if different library files are the same crate.
bf8a8f8
to
af25358
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit af25358 with merge 3e62ae8cce9be671b29a9715b3d390e4ad0c92d2... |
This comment has been minimized.
This comment has been minimized.
Would this allow metadata to be reused between |
Unfortunately not. Among other things rustc skips MIR encoding of generic and inline functions in check mode I believe. |
8738e49
to
5f0a9f8
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6a21ba1
to
c0d8f3e
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
I think what happens is that when |
☔ The latest upstream changes (presumably #94103) made this pull request unmergeable. Please resolve the merge conflicts. |
closing this due to inactivity |
Introduce -Zsplit-metadata option This will split the crate metadata out of library files. Instead only the svh and a bit of extra metadata is preserved to allow for loading the right rmeta file. This significantly reduces library size. In addition it allows for cheaper checks if different library files are the same crate. A fair amount of the complexity in this PR is to work around the fact that cargo doesn't directly support this option yet. Fixes rust-lang#23366 Fixes rust-lang#57076 Revives rust-lang#93945
Opened #120855 to revive this. |
This will split the crate metadata out of library files. Instead only the svh is preserved to allow for loading the right rmeta file. This significicantly reduces library size. In addition it allows for cheaper checks if different library files are the same crate.
Fixes #23366
Fixes #57076
Fixes #10786 (through 453d9a0bf778e385b45ecced681a71315fe8517e)
Should fix #82151 (through 453d9a0bf778e385b45ecced681a71315fe8517e, unconfirmed)