From 28e4d1961ec5d579aca710f66ba63d0d5b38eb68 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Tue, 16 Sep 2025 18:35:36 +0200 Subject: [PATCH] ci/build-rust: strip rust libs and binaries Stripping the libs saves 39 MiB and stripping the binaries saves 29 MiB per toolchain installed. Part-of: --- .gitlab-ci/container/build-rust.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci/container/build-rust.sh b/.gitlab-ci/container/build-rust.sh index 6ca41ca1c90..f0af7c1f39f 100644 --- a/.gitlab-ci/container/build-rust.sh +++ b/.gitlab-ci/container/build-rust.sh @@ -42,6 +42,9 @@ then rustup toolchain install --profile minimal --component clippy,rustfmt $MINIMUM_SUPPORTED_RUST_VERSION fi +find "$HOME"/.rustup/toolchains/*/lib -type f -name "*.so" -exec strip {} \; +find "$HOME"/.rustup/toolchains -type f -executable -exec strip {} \; + # Set up a config script for cross compiling -- cargo needs your system cc for # linking in cross builds, but doesn't know what you want to use for system cc. cat > "$HOME/.cargo/config" <