From cb46ad7abed63e9e398f28326407afd57d313eb6 Mon Sep 17 00:00:00 2001 From: cflmy Date: Tue, 22 Sep 2026 16:40:39 +0800 Subject: [PATCH] fix(ppa): trim bundled Rust to build essentials; clean extract on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Launchpad builds only need rustc + cargo + rust-std (debian/rules PATH), but install.sh was still shipping rust-docs-json-preview / rustfmt / rls (~1G). Also drop the 1.5G extract dir via EXIT trap when install fails — the leftover is what filled /tmp last run. Co-authored-by: Cursor --- scripts/ppa-build-source.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/ppa-build-source.sh b/scripts/ppa-build-source.sh index f544010..53a58a3 100755 --- a/scripts/ppa-build-source.sh +++ b/scripts/ppa-build-source.sh @@ -200,17 +200,25 @@ PY rm -rf third_party/rust mkdir -p third_party RUST_EXTRACT="$(mktemp -d "${TMPDIR:-/tmp}/marqdo-rust.XXXXXX")" + # Always drop the ~1.5G extract dir, even on failure (tmpfs fills up otherwise). + trap 'rm -rf "$RUST_EXTRACT"' EXIT tar -xzf "$RUST_TARBALL" -C "$RUST_EXTRACT" INSTALL_SH="$(find "$RUST_EXTRACT" -maxdepth 2 -name install.sh | head -1)" if [ -z "$INSTALL_SH" ]; then echo "error: install.sh not found in ${RUST_TARBALL}" >&2 exit 1 fi + # Launchpad builds need only rustc + cargo + rust-std (debian/rules PATH). + # Skip docs/json-docs/rustfmt/rls — ~1G of dead weight in the orig tarball. bash "$INSTALL_SH" \ --prefix="$PKG_ROOT/third_party/rust" \ --without=rust-docs \ + --without=rust-docs-json-preview \ + --without=rustfmt-preview \ + --without=rls-preview \ --disable-ldconfig rm -rf "$RUST_EXTRACT" + trap - EXIT "$PKG_ROOT/third_party/rust/bin/rustc" --version "$PKG_ROOT/third_party/rust/bin/cargo" --version