5 source "$CI_PROJECT_DIR/.gitlab/common.sh"
7 if [[ "$(uname)" == "Linux" ]]; then
8 export PATH
="/opt/ghc/${GHC_VERSION}/bin:${PATH}"
9 # Not all runners use ci-images, so ghcup is used.
11 .
"$CI_PROJECT_DIR/.gitlab/ghcup.sh"
14 export CABAL_DIR
="$CI_PROJECT_DIR/cabal"
18 export CABAL_DIR
="$(cygpath -w "$CABAL_DIR")"
28 # https://github.com/haskell/cabal/issues/7313#issuecomment-811851884
30 # https://github.com/haskellari/lukko/issues/17
32 # $PLATFORM comes from CI.
33 if [ "$(getconf LONG_BIT)" = "32" -o "${PLATFORM:=xxx}" = "x86_64-linux-centos7" ] ; then
34 echo 'constraints: lukko -ofd-locking' >> cabal.release.project.
local
37 # In February 2024, cabal started using zlib-0.7.0.0, which uses pkg-config by
38 # default. The GitLab CI environment doesn't (yet) supply pkg-config, and zlib
39 # does just fine without it on modern GHCs. That said, the CI environment
40 # probably *should* have pkg-config installed. See
41 # https://github.com/haskell/cabal/issues/9774.
42 echo 'constraints: zlib -pkg-config' >> cabal.release.project.
local
43 # Furthermore, on Windows, zlib claims that libz is shipped with GHC, so it just
44 # uses @extra-libraries: z@ if pkg-config is False. If you are reading this
45 # comment, however, this didn't work. Thus we switch to using the bundled libz,
46 # as was done in zlib <0.7.0.0.
49 echo 'constraints: zlib +bundled-c-zlib' >> cabal.release.project.
local
55 --enable-executable-stripping
56 --project-file=cabal.release.project
60 run cabal update hackage.haskell.org
,HEAD
61 run cabal v2-build
${args[@]} cabal-install
63 mkdir
"$CI_PROJECT_DIR/out"
64 cp "$(cabal list-bin ${args[@]} cabal-install:exe:cabal)" "$CI_PROJECT_DIR/out/cabal$EXE_EXT"
65 cp dist-newstyle
/cache
/plan.json
"$CI_PROJECT_DIR/out/plan.json"
66 cd "$CI_PROJECT_DIR/out/"
69 TARBALL_PREFIX
="cabal-install-$("$CI_PROJECT_DIR/out
/cabal
" --numeric-version)"
70 case "${TARBALL_EXT}" in
72 zip "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json
75 tar caf
"${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json
78 fail
"Unknown TARBALL_EXT: ${TARBALL_EXT}"