File tree Expand file tree Collapse file tree 5 files changed +954
-1
lines changed Expand file tree Collapse file tree 5 files changed +954
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eux
4+
5+ uname -a
6+ uname -p
7+ uname
8+ pwd
9+ env
10+
11+ if [ " ${RUNNER_OS} " = Windows ] ; then
12+ ext=" .exe"
13+ else
14+ ext=" "
15+ fi
16+
17+ # build
18+ ghcup --no-verbose install ghc --set --install-targets " install_bin install_lib update_package_db" " ${GHC_VERSION} "
19+ sed -i.bak -e ' /DELETE MARKER FOR CI/,/END DELETE/d' cabal.project # see comment in cabal.project
20+ cabal update
21+ cabal user-config diff
22+ cabal user-config init -f
23+ " ghc-${GHC_VERSION} " --info
24+ " ghc" --info
25+
26+ # https://github.com/haskell/cabal/issues/7313#issuecomment-811851884
27+ if [ " $( getconf LONG_BIT) " == " 32" ] || [ " ${DISTRO} " == " CentOS" ] ; then
28+ echo ' constraints: lukko -ofd-locking' >> cabal.release.project.local
29+ fi
30+
31+ # shellcheck disable=SC2206
32+ args=(
33+ -w " ghc-$GHC_VERSION "
34+ --disable-profiling
35+ --enable-executable-stripping
36+ --project-file=cabal.release.project
37+ ${ADD_CABAL_ARGS}
38+ )
39+
40+ cabal v2-build " ${args[@]} " cabal-install
41+
42+ mkdir -p " out"
43+ # shellcheck disable=SC2154
44+ cp " $( cabal list-bin " ${args[@]} " cabal-install:exe:cabal) " " out/cabal$ext "
45+ cp dist-newstyle/cache/plan.json " out/plan.json"
46+ cd " out/"
47+
48+ # create tarball/zip
49+ TARBALL_PREFIX=" cabal-install-$( " ./cabal" --numeric-version) "
50+ case " ${TARBALL_EXT} " in
51+ zip)
52+ zip " ${TARBALL_PREFIX} -${ARTIFACT} .${TARBALL_EXT} " " cabal${ext} " plan.json
53+ ;;
54+ tar.xz)
55+ tar caf " ${TARBALL_PREFIX} -${ARTIFACT} .${TARBALL_EXT} " " cabal${ext} " plan.json
56+ ;;
57+ * )
58+ fail " Unknown TARBALL_EXT: ${TARBALL_EXT} "
59+ ;;
60+ esac
61+
62+ rm " cabal${ext} " plan.json
63+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eux
4+
5+ env
6+ pwd
7+ ls -lah
8+
9+ cd out
10+ case " ${TARBALL_EXT} " in
11+ zip)
12+ unzip ./cabal-install-* -" ${ARTIFACT} .${TARBALL_EXT} "
13+ ;;
14+ tar.xz)
15+ tar xf ./cabal-install-* -" ${ARTIFACT} .${TARBALL_EXT} "
16+ ;;
17+ * )
18+ fail " Unknown TARBALL_EXT: ${TARBALL_EXT} "
19+ ;;
20+ esac
21+ cd ..
22+
23+ ghcup --no-verbose install ghc --set --install-targets " install_bin install_lib update_package_db" " ${GHC_VERSION} "
24+
25+ cabal update
26+
27+ # TODO: we want to avoid building here... we should just
28+ # be using the previously built 'cabal-tests' binary
29+ cabal run ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \
30+ --with-cabal " $( pwd) /out/cabal" \
31+ --intree-cabal-lib " $( pwd) " \
32+ --test-tmp " $( pwd) /testdb" \
33+ -j " $( nproc) "
34+
You can’t perform that action at this time.
0 commit comments