From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: deepesh.varatharajan@windriver.com,
openembedded-core@lists.openembedded.org
Cc: Shivaprasad.Moodalappa@windriver.com, Sundeep.Kokkonda@windriver.com
Subject: Re: [OE-core] [PATCH 1/5] rust: Fix bloat issue in recent rust updates
Date: Mon, 24 Mar 2025 22:28:09 +0000 [thread overview]
Message-ID: <3b9316c9aa4a857ecfb79f191bf766286b292548.camel@linuxfoundation.org> (raw)
In-Reply-To: <20250321132502.2607941-1-Deepesh.Varatharajan@windriver.com>
On Fri, 2025-03-21 at 06:24 -0700, Varatharajan, Deepesh via lists.openembedded.org wrote:
> From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>
> 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>
> ---
> meta/recipes-devtools/rust/rust_1.83.0.bb | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/meta/recipes-devtools/rust/rust_1.83.0.bb b/meta/recipes-devtools/rust/rust_1.83.0.bb
> index cd470b1883..aaf35692ab 100644
> --- a/meta/recipes-devtools/rust/rust_1.83.0.bb
> +++ b/meta/recipes-devtools/rust/rust_1.83.0.bb
> @@ -50,6 +50,16 @@ setup_cargo_environment () {
>
> inherit rust-target-config
>
> +do_unpack:append() {
> + import os
> + import shutil
> +
> + # Remove gcc directory after unpacking
> + gcc_dir = os.path.join(d.getVar('S'), 'src', 'gcc')
> + if os.path.isdir(gcc_dir):
> + shutil.rmtree(gcc_dir)
> +}
> +
> do_rust_setup_snapshot () {
> for installer in "${UNPACKDIR}/rust-snapshot-components/"*"/install.sh"; do
> "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig
Thanks for the patch, it is important we fix this. Unfortunately this
change isn't quite enough. We need to apply it to all users of the rust
source, so it needs to be in the rust-source.inc file, not in the rust
recipe.
Secondly, this would be better done as a postfunc for the do_unpack
task, so it can be a separate function rather than a append. For
example:
base.bbclass:do_unpack[postfuncs] += "create_source_date_epoch_stamp"
Cheers,
Richard
prev parent reply other threads:[~2025-03-24 22:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 13:24 [PATCH 1/5] rust: Fix bloat issue in recent rust updates Deepesh.Varatharajan
2025-03-21 13:24 ` [PATCH 2/5] rust: Fix build failure when multilibs are enabled Deepesh.Varatharajan
2025-03-24 9:23 ` [OE-core] " Alexander Kanavin
2025-03-24 17:48 ` Randy MacLeod
2025-03-25 8:35 ` Deepesh Varatharajan
2025-03-27 6:26 ` Deepesh Varatharajan
2025-03-25 4:44 ` Deepesh Varatharajan
2025-03-21 13:24 ` [PATCH 3/5] rust: Fix build break because of "download-rustc" and "llvm-tools" Deepesh.Varatharajan
2025-03-21 13:24 ` [PATCH 4/5] rust: Upgrade 1.83.0->1.84.1 Deepesh.Varatharajan
2025-03-21 13:24 ` [PATCH 5/5] rust: Oe-selftest changes for rust v1.84.1 Deepesh.Varatharajan
2025-03-22 6:50 ` [OE-core] [PATCH 1/5] rust: Fix bloat issue in recent rust updates Khem Raj
2025-03-24 22:28 ` Richard Purdie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b9316c9aa4a857ecfb79f191bf766286b292548.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=Shivaprasad.Moodalappa@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=deepesh.varatharajan@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox