Bug 1756487

Summary: rust-std-static is significantly larger in 1.38
Product: [Fedora] Fedora Reporter: Josh Stone <jistone>
Component: rustAssignee: Josh Stone <jistone>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: igor.raits, jistone, rust-sig, TicoTimo
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rust-1.38.0-2.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-30 00:22:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Josh Stone 2019-09-27 18:23:22 UTC
Upstream, most of the compiler's internal libraries were changed in how they are built and packaged. Before, they were individual shared libraries, but now they are built as rlibs (static) and finally linked into one librust_driver.so.

However, the rust-std component is collected and installed by just grabbing *all* rlibs in the build sysroot, including all those compiler libs that are considered unstable for external users.

rust-std-static-1.37.0-1.fc32.x86_64.rpm -- Size 39623589 (37.8 MiB)
rust-std-static-1.38.0-1.fc32.x86_64.rpm -- Size 620606290 (592 MiB)

See the referenced upstream issues, as well as the pull request where I am working on reducing the included rlibs. The problem is actually much worse for us though, because we build with full compiler debuginfo. Some of that is stripped in rpmbuild like normal, in the rlib archive's .o members, but Rust-specific members also include debug metadata that is not stripped.

Comment 1 Josh Stone 2019-09-27 18:39:06 UTC
On the plus side, the main rust package is smaller with that compiler lib change:

rust-1.37.0-1.fc32.x86_64.rpm -- Size 41209126 (39.3 MiB)
rust-1.38.0-1.fc32.x86_64.rpm -- Size 19397218 (18.5 MiB)

So once we filter rust-std rlibs, the total rust toolchain size will be much smaller.

Comment 2 Josh Stone 2019-09-30 00:22:45 UTC
rust-1.38.0-2.fc32.x86_64.rpm -- Size 19393383 (18.5 MiB)
rust-std-static-1.38.0-2.fc32.x86_64.rpm -- Size 17471432 (16.7 MiB)