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
31 # for some reason the subshell doesn't pick up the arm64 environment on darwin
32 # and starts installing x86_64 GHC
35 case "$(/usr/bin/arch)" in
37 curl
--proto '=https' --tlsv1.2
-sSf https
://get-ghcup.haskell.org | arch
-arm64 /bin
/bash
40 curl
--proto '=https' --tlsv1.2
-sSf https
://get-ghcup.haskell.org | sh
45 curl
--proto '=https' --tlsv1.2
-sSf https
://get-ghcup.haskell.org | sh
49 # https://github.com/haskell/cabal/issues/7313#issuecomment-811851884
51 # https://github.com/haskellari/lukko/issues/17
53 # $PLATFORM comes from CI.
54 if [ "$(getconf LONG_BIT)" = "32" -o "${PLATFORM:=xxx}" = "x86_64-linux-centos7" ] ; then
55 echo 'constraints: lukko -ofd-locking' >> cabal.project.release.
local
61 --enable-executable-stripping
62 --project-file=cabal.project.release
66 run cabal v2-build
${args[@]} cabal-install
68 mkdir
"$CI_PROJECT_DIR/out"
69 cp "$(cabal list-bin ${args[@]} cabal-install:exe:cabal)" "$CI_PROJECT_DIR/out/cabal$EXE_EXT"
70 cp dist-newstyle
/cache
/plan.json
"$CI_PROJECT_DIR/out/plan.json"
71 cd "$CI_PROJECT_DIR/out/"
74 TARBALL_PREFIX
="cabal-install-$("$CI_PROJECT_DIR/out
/cabal
" --numeric-version)"
75 case "${TARBALL_EXT}" in
77 zip "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json
80 tar caf
"${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json
83 fail
"Unknown TARBALL_EXT: ${TARBALL_EXT}"