From f2bc55a5e394b1f2a9af97f1bfc46e38ed86aa26 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Thu, 19 Oct 2023 15:13:25 +0100 Subject: [PATCH] Leave tarballs as-is, remove Brotli, don't re-gzip (#199) These files will no longer be downloaded millions of times, so there is no need to spend CPU time maximising compression. --- .circleci/config.yml | 2 +- .github/workflows/build-release.yml | 15 +-------------- build/lin.sh | 6 ------ build/win.sh | 6 ------ integrity-json.sh | 10 ---------- integrity.sh | 2 +- platforms/linux-arm64v8/Dockerfile | 2 -- platforms/linux-armv6/Dockerfile | 2 -- platforms/linux-armv7/Dockerfile | 2 -- platforms/linux-s390x/Dockerfile | 2 -- platforms/linux-x64/Dockerfile | 2 -- platforms/linuxmusl-arm64v8/Dockerfile | 2 -- platforms/linuxmusl-x64/Dockerfile | 2 -- platforms/win32/Dockerfile | 2 +- 14 files changed, 4 insertions(+), 53 deletions(-) delete mode 100755 integrity-json.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 2876f9ab..7f7aa613 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,4 +23,4 @@ jobs: - when: condition: <> steps: - - run: gh release upload --repo lovell/sharp-libvips $CIRCLE_TAG *.tar.gz *.tar.br *.integrity + - run: gh release upload --repo lovell/sharp-libvips $CIRCLE_TAG *.tar.gz *.integrity diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index e3283325..8596f064 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -43,7 +43,7 @@ jobs: if: runner.os == 'macOS' run: | pip3 install meson ninja - brew install advancecomp automake brotli nasm pkg-config + brew install automake nasm pkg-config - name: Build ${{ matrix.platform }} id: build-release run: ./build.sh $(cat LIBVIPS_VERSION) ${{ matrix.platform }} @@ -63,19 +63,6 @@ jobs: omitNameDuringUpdate: true prerelease: true token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Release Asset (.tar.br) - id: upload-release-asset-br - if: startsWith(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: libvips-*-${{ matrix.platform }}.tar.br - artifactContentType: application/x-brotli - artifactErrorsFailBuild: true - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - token: ${{ secrets.GITHUB_TOKEN }} - name: Upload Release Asset (.integrity) id: upload-release-asset-integrity if: startsWith(github.ref, 'refs/tags/v') diff --git a/build/lin.sh b/build/lin.sh index 97ab0516..cb68fd60 100755 --- a/build/lin.sh +++ b/build/lin.sh @@ -566,11 +566,5 @@ tar chzf ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \ *.json \ THIRD-PARTY-NOTICES.md -# Recompress using AdvanceCOMP, ~5% smaller -advdef --recompress --shrink-insane ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz - -# Recompress using Brotli, ~15% smaller -gunzip -c ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz | brotli -o ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.br - # Allow tarballs to be read outside container chmod 644 ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.* diff --git a/build/win.sh b/build/win.sh index 623e1c8f..cb6c85a4 100755 --- a/build/win.sh +++ b/build/win.sh @@ -48,12 +48,6 @@ tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \ *.json \ THIRD-PARTY-NOTICES.md -# Recompress using AdvanceCOMP, ~5% smaller -advdef --recompress --shrink-insane /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz - -# Recompress using Brotli, ~15% smaller -gunzip -c /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz | brotli -o /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.br - # Allow tarballs to be read outside container chmod 644 /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.* diff --git a/integrity-json.sh b/integrity-json.sh deleted file mode 100755 index 20bfbace..00000000 --- a/integrity-json.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -e - -LIBVIPS_VERSION=$(cat LIBVIPS_VERSION) - -for url in $(curl -sL https://api.github.com/repos/lovell/sharp-libvips/releases | jq -r --arg NAME "v$LIBVIPS_VERSION" '.[] | select(.name == $NAME) | .assets[] | select(.name | contains(".br.integrity")) | .browser_download_url'); do - PLATFORM_AND_ARCH=$(echo $url | cut -d'.' -f6 | cut -d'-' -f2,3) - CHECKSUM=$(curl -Ls $url) - echo "\"$PLATFORM_AND_ARCH\": \"$CHECKSUM\"," -done diff --git a/integrity.sh b/integrity.sh index 0d450ebe..70543c14 100755 --- a/integrity.sh +++ b/integrity.sh @@ -8,6 +8,6 @@ integrity() { printf "$CHECKSUM" > $1.integrity } -for tarball in *.tar.{br,gz}; do +for tarball in *.tar.gz; do integrity $tarball done diff --git a/platforms/linux-arm64v8/Dockerfile b/platforms/linux-arm64v8/Dockerfile index 867a9cb0..d77e603a 100644 --- a/platforms/linux-arm64v8/Dockerfile +++ b/platforms/linux-arm64v8/Dockerfile @@ -15,10 +15,8 @@ RUN \ amazon-linux-extras install epel -y && \ yum install -y --setopt=tsflags=nodocs \ --exclude=gcc \ - advancecomp \ autoconf \ automake \ - brotli \ bzip2 \ cmake3 \ curl \ diff --git a/platforms/linux-armv6/Dockerfile b/platforms/linux-armv6/Dockerfile index d36ccb00..df4c708b 100644 --- a/platforms/linux-armv6/Dockerfile +++ b/platforms/linux-armv6/Dockerfile @@ -16,10 +16,8 @@ RUN \ dpkg --add-architecture armhf && \ apt-get update && \ apt-get install -y \ - advancecomp \ autoconf \ autopoint \ - brotli \ cmake \ gettext \ git \ diff --git a/platforms/linux-armv7/Dockerfile b/platforms/linux-armv7/Dockerfile index 2d1410d9..e18ed492 100644 --- a/platforms/linux-armv7/Dockerfile +++ b/platforms/linux-armv7/Dockerfile @@ -16,10 +16,8 @@ RUN \ dpkg --add-architecture armhf && \ apt-get update && \ apt-get install -y \ - advancecomp \ autoconf \ autopoint \ - brotli \ cmake \ crossbuild-essential-armhf \ gettext \ diff --git a/platforms/linux-s390x/Dockerfile b/platforms/linux-s390x/Dockerfile index 86499bc0..93b40156 100644 --- a/platforms/linux-s390x/Dockerfile +++ b/platforms/linux-s390x/Dockerfile @@ -16,10 +16,8 @@ RUN \ dpkg --add-architecture s390x && \ apt-get update && \ apt-get install -y \ - advancecomp \ autoconf \ autopoint \ - brotli \ cmake \ crossbuild-essential-s390x \ gettext \ diff --git a/platforms/linux-x64/Dockerfile b/platforms/linux-x64/Dockerfile index 5fdcc96d..4c2156b9 100644 --- a/platforms/linux-x64/Dockerfile +++ b/platforms/linux-x64/Dockerfile @@ -15,10 +15,8 @@ RUN \ amazon-linux-extras install epel -y && \ yum install -y --setopt=tsflags=nodocs \ --exclude=gcc \ - advancecomp \ autoconf \ automake \ - brotli \ bzip2 \ cmake3 \ curl \ diff --git a/platforms/linuxmusl-arm64v8/Dockerfile b/platforms/linuxmusl-arm64v8/Dockerfile index b9a48978..e06ee32a 100644 --- a/platforms/linuxmusl-arm64v8/Dockerfile +++ b/platforms/linuxmusl-arm64v8/Dockerfile @@ -16,7 +16,6 @@ RUN \ autoconf \ automake \ binutils \ - brotli \ build-base \ cmake \ coreutils \ @@ -32,7 +31,6 @@ RUN \ py3-pip \ python3 \ && \ - apk --update --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.17/community/ add advancecomp && \ curl -Ls https://github.com/lovell/aarch64-linux-musl-crosstools/archive/main.tar.gz | tar -hxzC / --strip-components=2 && \ ln -s /usr/bin/pkg-config /bin/aarch64-linux-musl-pkg-config && \ curl https://sh.rustup.rs -sSf | sh -s -- -y \ diff --git a/platforms/linuxmusl-x64/Dockerfile b/platforms/linuxmusl-x64/Dockerfile index 7630c52c..fb016f8d 100644 --- a/platforms/linuxmusl-x64/Dockerfile +++ b/platforms/linuxmusl-x64/Dockerfile @@ -16,7 +16,6 @@ RUN \ autoconf \ automake \ binutils \ - brotli \ build-base \ cmake \ coreutils \ @@ -33,7 +32,6 @@ RUN \ py3-pip \ python3 \ && \ - apk --update --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.17/community/ add advancecomp && \ curl https://sh.rustup.rs -sSf | sh -s -- -y \ --no-modify-path \ --profile minimal \ diff --git a/platforms/win32/Dockerfile b/platforms/win32/Dockerfile index 7ac99922..58316606 100644 --- a/platforms/win32/Dockerfile +++ b/platforms/win32/Dockerfile @@ -3,4 +3,4 @@ LABEL maintainer="Lovell Fuller " # Create Debian-based container suitable for post-processing Windows binaries -RUN apt-get update && apt-get install -y advancecomp brotli curl zip +RUN apt-get update && apt-get install -y curl zip