-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Description
This isn't an issue with Rust per se - however, it has implications for people building the compiler.
The libLLVM.so
shipped with the Rust compiler (libLLVM-9-rust-1.41.0-nightly.so
at the time of writing) is currently 80MB. While this seems incredibly large for a shared library, it's still only slightly larger than librustc_driver
(63MB).
This is unfortunate, but things become much worse when llvm.release-debuginfo=true
is set in config.toml.
This makes libLLVM-9-rust-1.41.0-dev-de1a7dbf6.so
take up 2.1 GB of space.
To make matters worse, we currently copy libLLVM.so
to a target directory when building the compiler:
Line 2167 in ae1b871
builder.install(&llvm_dylib_path, &dst_libdir, 0o644); |
With #67077, we may have to copy it into even more places. This represents a non-trivial amount of disk space.
I don't think there's much we can directly do about the size of libLLVM.so
, other than making sure upstream is aware of this. However, we might want to consider symlinking libLLVM.so
, rather than copying it. I know this works for shared libraries on Linux, but I'm not sure about other platforms.
Activity
tesuji commentedon Dec 7, 2019
Also in
~/.rustup/toolchains
:I think these libLLVM files in the same toolchain could be symlink too.
nagisa commentedon Dec 8, 2019
It is a well known fact to people working with LLVM that a debug build is both large in its outputs and very stressful on the toolchain. This might improve when we get good support for separated debuginfo files, but the toolchain is not quite there yet.
nagisa commentedon Dec 8, 2019
(This also likely does not affect windows as much as it does affect other platforms)
jyn514 commentedon May 20, 2023
Bootstrap is now using hard links for llvm whenever possible:
rust/src/bootstrap/lib.rs
Lines 1520 to 1524 in 77f4f82
I'm going to close this since upstream is aware of the issue, I don't see much we can do on our end.