linker path appears hardcoded in GHC 8.10.2 on Windows
I've been running into the following error while compiling some packages with cabal and GHC 8.10.2 on Windows 10:
Failed to build zlib-0.6.2.2.
Build log (
C:\Users\sheaf\AppData\Roaming\cabal\logs\ghc-8.10.2\zlib-0.6.2.2-103b2d214bd84472273997a76139b44663433e3e.log
):
Preprocessing library for zlib-0.6.2.2..
Building library for zlib-0.6.2.2..
[1 of 5] Compiling Codec.Compression.Zlib.Stream ( dist\build\Codec\Compression\Zlib\Stream.hs, dist\build\Codec\Compression\Zlib\Stream.o )
ghc.exe: could not execute: C:/GitLabRunner/builds/2WeHDSFP/0/ghc/ghc/inplace/mingw/bin/ld.exe
So it seems that the Haskell GitLab runner path for the linker is mistakenly hardcoded somewhere?
I tried changing the linker location with -pgml
and --with-ld
, but those options seemingly had no impact on this issue.
To reproduce, run cabal build
on a package containing a dependency on zlib
. For instance:
Bug.cabal
cabal-version: 3.0
name: LinkerBug
version: 0.1.0.0
executable LinkerBug
hs-source-dirs:
.
main-is:
Main.hs
build-depends:
base
, zlib
Main.hs
module Main where
main :: IO ()
main = pure ()
and then run cabal build --with-compiler="ghc-8.10.2"
(or the full path to the GHC 8.10.2 executable if not in PATH). On my end, that produces the error quoted at the top of this post.
Curiously, running cabal build zlib --with-compiler="ghc-8.10.2"
does not cause any issues, yet after doing so cabal
still decides to recompile zlib
in the previous example, so it doesn't allow working around the issue.