Commit cc628088 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

gitlab-ci: Another approach for xz detection

parent ac25a3f6
......@@ -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:
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment