Skip to content

Commit 26a345a

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 "src/gcc" Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1 parent 1db86a3 commit 26a345a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

meta/recipes-devtools/rust/rust-source.inc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11
1313

1414
RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src"
1515

16+
#After updating to Rust 1.85 we can revert this removal of "src/gcc"
17+
remove_gcc_directory() {
18+
# Ensure the gcc directory exists
19+
gcc_dir="${S}/src/gcc"
20+
if [ -d "$gcc_dir" ]; then
21+
rm -rf "$gcc_dir"
22+
fi
23+
}
24+
# Add postfunc to the do_unpack task
25+
do_unpack[postfuncs] += "remove_gcc_directory"
26+
1627
UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html"
1728
UPSTREAM_CHECK_REGEX = "rustc-(?P<pver>\d+(\.\d+)+)-src"
1829

0 commit comments

Comments
 (0)