From 3b39690fefcdb9e98359a490a4b2189735cfc326 Mon Sep 17 00:00:00 2001 From: Howard Wu Date: Sun, 26 Mar 2023 22:44:33 +0800 Subject: [PATCH] Remove support for the compression format `tar.xz` This format has a very large memory requirement for generation, about 16GB, even with a fallback to a single-threaded compression step, which would be very slow. This format is not widely used on Windows, and decompression is a pain. The 7z format has a better balance of size and performance requirements. --- docs/README.md | 8 ++++---- scripts/build.sh | 10 ---------- scripts/install_deps.sh | 2 -- scripts/run.sh | 3 +-- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/README.md b/docs/README.md index 3c2890c..39659ec 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,10 +8,10 @@ The following dependencies are required: - | DistrOS | | | | | - |:-------------------:|---------------------------------------------------------------------------|------------|------------|--------------| - | Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `xz-utils` | `qemu-utils` | - | openSUSE Tumbleweed | Same as above | `dialog` | `xz` | `qemu-tools` | + | DistrOS | | | | + |:-------------------:|---------------------------------------------------------------------------|------------|--------------| + | Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip` | `whiptail` | `qemu-utils` | + | openSUSE Tumbleweed | Same as above | `dialog` | `qemu-tools` | The python3 library `requests` is used. diff --git a/scripts/build.sh b/scripts/build.sh index 4934eb9..ac55120 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -188,7 +188,6 @@ ROOT_SOL_MAP=( COMPRESS_FORMAT_MAP=( "7z" - "xz" "zip" ) @@ -886,21 +885,12 @@ if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then fi if [ -n "$COMPRESS_FORMAT" ]; then FILE_EXT=".$COMPRESS_FORMAT" - if [ "$FILE_EXT" = ".xz" ]; then - FILE_EXT=".tar$FILE_EXT" - fi OUTPUT_PATH="$OUTPUT_PATH$FILE_EXT" fi rm -f "${OUTPUT_PATH:?}" || abort if [ "$COMPRESS_FORMAT" = "7z" ]; then echo "Compressing with 7z" 7z a "${OUTPUT_PATH:?}" "$WORK_DIR/wsa/$artifact_name" || abort - elif [ "$COMPRESS_FORMAT" = "xz" ]; then - echo "Compressing with tar xz" - if ! (tar -cP -I 'xz -9 -T0' -f "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name"); then - echo "Out of memory? Trying again with single threads...." - tar -cPJvf "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort - fi elif [ "$COMPRESS_FORMAT" = "zip" ]; then echo "Compressing with zip" 7z -tzip a "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index f73bc3a..a25e36c 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -46,7 +46,6 @@ check_dependencies() { command -v aria2c >/dev/null 2>&1 || NEED_INSTALL+=("aria2") command -v 7z >/dev/null 2>&1 || NEED_INSTALL+=("p7zip-full") command -v setfattr >/dev/null 2>&1 || NEED_INSTALL+=("attr") - command -v xz >/dev/null 2>&1 || NEED_INSTALL+=("xz-utils") command -v unzip >/dev/null 2>&1 || NEED_INSTALL+=("unzip") command -v qemu-img >/dev/null 2>&1 || NEED_INSTALL+=("qemu-utils") } @@ -112,7 +111,6 @@ if [ -n "${NEED_INSTALL[*]}" ]; then { NEED_INSTALL_FIX=${NEED_INSTALL_FIX//setools/setools-console} 2>&1 NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1 - NEED_INSTALL_FIX=${NEED_INSTALL_FIX//xz-utils/xz} 2>&1 NEED_INSTALL_FIX=${NEED_INSTALL_FIX//qemu-utils/qemu-tools} 2>&1 } >>/dev/null diff --git a/scripts/run.sh b/scripts/run.sh index 8e9103f..9ea4dc6 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -133,9 +133,8 @@ if [ "$COMPRESS_OUTPUT" = "--compress" ]; then COMPRESS_FORMAT=$( Radiolist '([title]="Compress format" [default]="7z")' \ - 'zip' "Zip" 'off' \ '7z' "7-Zip" 'on' \ - 'xz' "tar.xz" 'off' + 'zip' "Zip" 'off' ) fi