Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.6k
    • Issues 5.6k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 642
    • Merge requests 642
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18550

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.

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