Skip to content

Commit 62c74fe

Browse files
chreekatMikolaj
authored andcommitted
Tell zlib not to use pkg-config in GitLab CI.
1 parent 6f47691 commit 62c74fe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.gitlab/ci.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ if [ "$(getconf LONG_BIT)" = "32" -o "${PLATFORM:=xxx}" = "x86_64-linux-centos7"
5757
echo 'constraints: lukko -ofd-locking' >> cabal.project.release.local
5858
fi
5959

60+
# In February 2024, cabal started using zlib-0.7.0.0, which uses pkg-config by
61+
# default. The GitLab CI environment doesn't (yet) supply pkg-config, and zlib
62+
# does just fine without it on modern GHCs. That said, the CI environment
63+
# probably *should* have pkg-config installed. See
64+
# https://github.com/haskell/cabal/issues/9774.
65+
echo 'constraints: zlib -pkg-config' >> cabal.project.release.local
66+
# Furthermore, on Windows, zlib claims that libz is shipped with GHC, so it just
67+
# uses @extra-libraries: z@ if pkg-config is False. If you are reading this
68+
# comment, however, this didn't work. Thus we switch to using the bundled libz,
69+
# as was done in zlib <0.7.0.0.
70+
case "$(uname)" in
71+
MSYS_*|MINGW*)
72+
echo 'constraints: zlib +bundled-c-zlib' >> cabal.project.release.local
73+
;;
74+
esac
75+
6076
args=(
6177
-w "ghc-$GHC_VERSION"
6278
--disable-profiling

0 commit comments

Comments
 (0)