-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
rustc-dev component recently became a lot bigger #103538
Comments
It looks like we include both llvm bitcode and object code rather than including only llvm bitcode in the rlibs for some reason. |
To avoid the object code, it needs to use |
I though passing In any case one way to solve this issue I think would be to ship .rmeta files instead of .rlib files in rustc-dev. All users of rustc-dev should be linking against librustc_driver.so anyway to avoid duplicate symbols when being loaded by rustc or when loading a codegen backend linked against librustc_driver.so. Shipping .rmeta files should even reduce the size of the rustc-dev component to below what it was before #101403 landed. |
@bjorn3 how would tools like Miri even do that (link against the .so file based on .rmeta files)? And do these .rmeta files even exist on our dist builders or would they have to be generated? |
Miri links agains librustc_driver.so already. In fact there are no .rlib or .rmeta files generated for rustc_driver as it's crate type is set to dylib. The .rmeta files are already generated as they are used for build pipelining (since a couple of months or so it is no longer possible to disable build pipelining in cargo). All that is necessary is to replace the rule that copies .rlib files to rustc-dev with one copying .rmeta files. Possibly with an assertion that there exists a .rmeta file for every .rlib file that would have been copied previously. Rustc should then automatically pick up the .rmeta files from the sysroot instead of .rlib files and should only error if librustc_driver.so isn't linked in. The error is probably not very helpful though, so maybe we should add a special case for sysroot crates suggesting rustc_driver to be added as dependency. |
Opened #105609 to fix this. |
Only include metadata for non-dynamic libraries in rustc-dev The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage. Fixes rust-lang/rust#103538
I need to download the rustc-dev component quite a lot for Miri development, and noticed that it recently became a lot bigger.
For b1ab3b7, it was 125MB in size.
Now, at 85d089b, it is 205MB in size.
Is that an expected regression? Is there a way to avoid this almost doubling of the size?
The text was updated successfully, but these errors were encountered: