diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-12-10 13:12:17 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-16 19:33:01 -0500 |
commit | cc6280885f15c00703c4fc8305f6d47747910fc2 (patch) | |
tree | 650eb8b84c7633382f81fdaebd424544d8eed89e | |
parent | ac25a3f637d894e9b972600e8942a91570e2dcd0 (diff) | |
download | haskell-cc6280885f15c00703c4fc8305f6d47747910fc2.tar.gz |
gitlab-ci: Another approach for xz detection
-rw-r--r-- | .gitlab-ci.yml | 5 | ||||
-rwxr-xr-x | .gitlab/prepare-system.sh | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1075a06af..e27be0c2f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -649,8 +649,6 @@ validate-x86_64-linux-deb9-dwarf: variables: TEST_ENV: "x86_64-linux-deb10" BIN_DIST_PREP_TAR_COMP: "./ghc-x86_64-deb10-linux.tar.xz" - # pxz doesn't exist; it's xz --threads - XZ: "xz --threads=$CORES" cache: key: linux-x86_64-deb10 @@ -715,7 +713,6 @@ release-x86_64-linux-deb8: BUILD_SPHINX_PDF: "NO" TEST_ENV: "x86_64-linux-alpine" BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-alpine-linux.tar.xz" - XZ: "xz --threads=$CORES" # Can't use ld.gold due to #13958. CONFIGURE_ARGS: "--disable-ld-override" cache: @@ -748,8 +745,6 @@ nightly-x86_64-linux-alpine: BUILD_SPHINX_PDF: "NO" TEST_ENV: "x86_64-linux-centos7" BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-centos7-linux.tar.xz" - # pxz is not available on centos7 for reasons I can't understand - XZ: "xz" # CentOS seems to default to ascii LANG: "en_US.UTF-8" cache: diff --git a/.gitlab/prepare-system.sh b/.gitlab/prepare-system.sh index a8eabe2678..4180e6029c 100755 --- a/.gitlab/prepare-system.sh +++ b/.gitlab/prepare-system.sh @@ -13,7 +13,24 @@ if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi if [[ -z ${BUILD_FLAVOUR:-} ]]; then BUILD_FLAVOUR=perf; fi -if [[ -z ${XZ:-} ]]; then XZ=pxz; fi + +if [[ -z ${XZ:-} ]]; then + if which pxz; then + XZ="pxz" + elif which xz; then + # Check whether --threads is supported + if echo "hello" | xz --threads=$CORES >/dev/null; then + XZ="xz --threads=$CORES" + else + XZ="xz" + fi + else + echo "error: neither pxz nor xz were found" + exit 1 + fi +fi +echo "Using $XZ for compression..." + cat > mk/build.mk <<EOF V=1 |