-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Verify that all crate sources are in sync #113695
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
Verify that all crate sources are in sync #113695
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
} else if m.len() == 1 { | ||
return Ok(Some(m.into_iter().next().unwrap())); |
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 is the meat of the change. By removing this the rest of the function will check compatibility of the candidates with the slot which contains the svh of the rlib that has already been loaded by the call of extract_one
for the rlib.
@bors try @rust-timer queue This now loads crate metadata for libstd.so when linking, but not when compiling rlibs. |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 6a6fa0d0619dbaa9f73e590131dd5bc50e4be9a8 with merge b0d1df2c2e875462902ed1ccb6318a28dd82d484... |
This comment has been minimized.
This comment has been minimized.
r=me assuming the perf run shows that this doesn't slow things down too much. (We should be willing to accept a performance hit here to get the benefits outlined, especially considering the kinds of problems people are hitting here in practice.) |
Does this help with #10786? Should it? |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Yes |
Finished benchmarking commit (b0d1df2c2e875462902ed1ccb6318a28dd82d484): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 659.454s -> 658.736s (-0.11%) |
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
Let's try with dylib metadata compression disabled to see how much of the perf loss is from dylib metadata decompression. This doubles the size of libstd.so from 6.4MB to 12MB which is not all that much compared to the total size of all standard library crates combined. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 77b8a7fdb3a84054a2ddf60a5ff7c774ec5dd5d1 with merge 2da07d23d194da9a54d3161894b3db0bd64bcb43... |
Fixed all review comments. |
@bors r=pnkfelix,petrochenkov |
⌛ Testing commit 8c9a8b6 with merge e094c70bbf1faa6bb972d7ecfd47860795d6c7a2... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b14fd23): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 649.877s -> 649.458s (-0.06%) |
This should mention size increase somewhere in header: as i found size diff around 2x, bisected to here and found, that this was expected. |
Done @klensy |
Compression of dylibs was removed in rust-lang/rust#113695 (and decompression removed in rust-lang/rust#132402).
Compression of dylibs was removed in rust-lang#113695 (and decompression removed in rust-lang#132402).
This ensures that rustc will not attempt to link against a cdylib as if it is a rust dylib when an rlib for the same crate is available. Previously rustc didn't actually check if any further formats of a crate which has been loaded are of the same version and if they are actually valid. This caused a cdylib to be interpreted as rust dylib as soon as the corresponding rlib was loaded. As cdylibs don't export any rust symbols, linking would fail if rustc decides to link against the cdylib rather than the rlib.
Two crates depended on the previous behavior by separately compiling a test crate as both rlib and dylib. These have been changed to capture their original spirit to the best of my ability while still working when rustc verifies that all crates are in sync. It is unlikely that build systems depend on the current behavior and in any case we are taking a lot of measures to ensure that any change to either the source or the compilation options (including crate type) results in rustc rejecting it as incompatible. We merely didn't do this check here for now obsolete perf reasons.
Note: This increases the size of rust dylibs as their crate metadata is no longer compressed. Cdylibs don't have crate metadata and as such are unaffected.
Fixes #10786
Fixes #82151
Fixes #82972
Closes bevy-cheatbook/bevy-cheatbook#114