Skip to content

Commit fdb357c

Browse files
Deepesh Varatharajanrpurdie
authored andcommitted
rust: Fix bloat issue in recent rust updates
Remove the "src/gcc" directory from the Rust source code to reduce the filesystem build space. In Rust 1.83 (and 1.84), a full GCC-14 tree was included, which caused the tar.xz archive to increase by 128 MB and the unpacked sources to grow by 1.3 GB. This was an upstream error that has been resolved in Rust 1.85. After updating to Rust 1.85 we can revert this removal of "gcc/src" Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1 parent 17ae530 commit fdb357c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

meta/recipes-devtools/rust/rust_1.83.0.bb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ setup_cargo_environment () {
5050

5151
inherit rust-target-config
5252

53+
do_unpack:append() {
54+
import os
55+
import shutil
56+
57+
# Remove gcc directory after unpacking
58+
gcc_dir = os.path.join(d.getVar('S'), 'src', 'gcc')
59+
if os.path.isdir(gcc_dir):
60+
shutil.rmtree(gcc_dir)
61+
}
62+
5363
do_rust_setup_snapshot () {
5464
for installer in "${UNPACKDIR}/rust-snapshot-components/"*"/install.sh"; do
5565
"${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig

0 commit comments

Comments
 (0)