5 source "$CI_PROJECT_DIR/.gitlab/common.sh"
7 export GHCUP_INSTALL_BASE_PREFIX
="$CI_PROJECT_DIR/toolchain"
8 export CABAL_DIR
="$CI_PROJECT_DIR/cabal"
12 export CABAL_DIR
="$(cygpath -w "$CABAL_DIR")"
13 GHCUP_BINDIR
="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin"
17 GHCUP_BINDIR
="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin"
23 mkdir
-p "$GHCUP_BINDIR"
24 export PATH
="$GHCUP_BINDIR:$PATH"
26 export BOOTSTRAP_HASKELL_NONINTERACTIVE
=1
27 export BOOTSTRAP_HASKELL_GHC_VERSION
=$GHC_VERSION
28 export BOOTSTRAP_HASKELL_CABAL_VERSION
=$CABAL_INSTALL_VERSION
29 export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG
=yes
30 # We don't use stack, and it isn't available on i386-deb9
31 export BOOTSTRAP_HASKELL_INSTALL_NO_STACK
=yes
33 # for some reason the subshell doesn't pick up the arm64 environment on darwin
34 # and starts installing x86_64 GHC
37 case "$(/usr/bin/arch)" in
39 curl
--proto '=https' --tlsv1.2
-sSf https
://get-ghcup.haskell.org | arch
-arm64 /bin
/bash
42 curl
--proto '=https' --tlsv1.2
-sSf https
://get-ghcup.haskell.org | sh
47 curl
--proto '=https' --tlsv1.2
-sSf https
://get-ghcup.haskell.org | sh
51 # https://github.com/haskell/cabal/issues/7313#issuecomment-811851884
53 # https://github.com/haskellari/lukko/issues/17
55 # $PLATFORM comes from CI.
56 if [ "$(getconf LONG_BIT)" = "32" -o "${PLATFORM:=xxx}" = "x86_64-linux-centos7" ] ; then
57 echo 'constraints: lukko -ofd-locking' >> cabal.project.release.
local
63 --enable-executable-stripping
64 --project-file=cabal.project.release
68 run cabal update hackage.haskell.org
,HEAD
69 run cabal v2-build
${args[@]} cabal-install
71 mkdir
"$CI_PROJECT_DIR/out"
72 cp "$(cabal list-bin ${args[@]} cabal-install:exe:cabal)" "$CI_PROJECT_DIR/out/cabal$EXE_EXT"
73 cp dist-newstyle
/cache
/plan.json
"$CI_PROJECT_DIR/out/plan.json"
74 cd "$CI_PROJECT_DIR/out/"
77 TARBALL_PREFIX
="cabal-install-$("$CI_PROJECT_DIR/out
/cabal
" --numeric-version)"
78 case "${TARBALL_EXT}" in
80 zip "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json
83 tar caf
"${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json
86 fail
"Unknown TARBALL_EXT: ${TARBALL_EXT}"