From 2cb5d1accca23df67dd55d01416ea404ab92683b Mon Sep 17 00:00:00 2001 From: Deepesh Varatharajan Date: Thu, 27 Mar 2025 02:06:03 -0700 Subject: 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" (From OE-Core rev: 26a345adc8e050657bfa0b51ea92a3d89e698d9a) Signed-off-by: Deepesh Varatharajan Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-source.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index 838544e089..40fc237a62 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -13,6 +13,17 @@ SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11 RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src" +#After updating to Rust 1.85 we can revert this removal of "src/gcc" +remove_gcc_directory() { + # Ensure the gcc directory exists + gcc_dir="${S}/src/gcc" + if [ -d "$gcc_dir" ]; then + rm -rf "$gcc_dir" + fi +} +# Add postfunc to the do_unpack task +do_unpack[postfuncs] += "remove_gcc_directory" + UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html" UPSTREAM_CHECK_REGEX = "rustc-(?P\d+(\.\d+)+)-src" -- cgit v1.2.3-54-g00ecf