From 855623d8cce4db8655af58bed5d52c64d38608c5 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Wed, 11 Oct 2023 12:56:20 +0800 Subject: [PATCH] rust: Improve Host/Install speed * Compress dist archives with gzip instead of xz; gzip is faster to compress and decompress * Use a for loop instead of calling find to extract archives * Use libdeflate's gzip to decompress instead of gzip * Limit search for install scripts to top level of extracted archives This also runs the install scripts with bash instead of sh, in accordance with the shebang lines inside the scripts. Signed-off-by: Jeffery To --- lang/rust/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 37fe20aeb..b27c2fc09 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -65,7 +65,7 @@ HOST_CONFIGURE_ARGS = \ --sysconfdir=$(CARGO_HOME)/etc \ --datadir=$(CARGO_HOME)/share \ --mandir=$(CARGO_HOME)/man \ - --dist-compression-formats=xz \ + --dist-compression-formats=gz \ --enable-missing-tools \ --disable-sanitizers \ --release-channel=stable \ @@ -91,8 +91,11 @@ endef define Host/Install ( \ cd $(HOST_BUILD_DIR)/build/dist ; \ - find -iname "*.xz" -exec tar -xJf {} \; ; \ - find ./* -type f -name install.sh -execdir sh {} --prefix=$(CARGO_HOME) --disable-ldconfig \; ; \ + for targz in *.tar.gz; do \ + $(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc "$$$$targz" | tar -xf - ; \ + done ; \ + find . -mindepth 2 -maxdepth 2 -type f -name install.sh \ + -execdir bash '{}' --prefix=$(CARGO_HOME) --disable-ldconfig \; ; \ \ sed -e 's|@RUSTC_TARGET_ARCH@|$(RUSTC_TARGET_ARCH)|g' \ -e 's|@TARGET_CC_NOCACHE@|$(TARGET_CC_NOCACHE)|g' \