Skip to content

Runtime failure on windows with zlib-0.7.0.0 when missing zlib library

First reported by https://github.com/haskell/zlib/issues/65

GHC doesn't fail compilation of a binary depending on zlib-0.7.0.0, although the linking of the zlib system depedency failed. The issue exists at least on GHC 9.2.8 through GHC 9.6.

There is no message when running cabal build, but opening a repl session fails with the message:

ghc-9.4.8.exe: Could not load `zlib1.dll'. Reason: addDLL: zlib1.dll or dependencies not loaded. (Win32 error 126)

I was able to reproduce the issue on Win 10, GHC 9.4.8 and cabal 3.10.2.1, but was unable to reproduce the issue on any windows GitHub CI runners.

I briefly investigated, the main change seems to be that zlib haskell library switched to using extra-libraries on windows, which should alwasy exist as GHC ships with zlib on windows. Likewise, I verified the library exists, too.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information