ghc-lib icon indicating copy to clipboard operation
ghc-lib copied to clipboard

Build fails on WASM

Open brandonchinn178 opened this issue 3 months ago • 6 comments

Got a failure when building ghc-lib-parser with GHC WASM. Not sure if it's a ghc-lib-parser issue or a GHC WASM issue, but I figured I'd start here

https://github.com/fourmolu/fourmolu/actions/runs/17982289343/job/51151331706?pr=490

Failed to build ghc-lib-parser-9.12.2.20250421.

 compiler/GHC/Tc/Errors/Ppr.hs:44:1: error: [GHC-61948]
    Could not find module ‘GHC.Internal.TH.Ppr’.
    Perhaps you meant
      GHC.Internal.TH.Lib (from ghc-internal-9.1202.0)
      GHC.Internal.Ptr (from ghc-internal-9.1202.0)
      GHC.Internal.TH.Lift (from ghc-internal-9.1202.0)
    Use -v to see a list of the files searched for.
   |
44 | import qualified GHC.Internal.TH.Ppr as TH
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

brandonchinn178 avatar Sep 24 '25 16:09 brandonchinn178

what's the build compiler version? i see

    if impl(ghc < 9.12.1)
      hs-source-dirs:
        libraries/ghc-internal/src
        libraries/ghc-boot-th-internal
      exposed-modules:
            GHC.Internal.ForeignSrcLang
            GHC.Internal.LanguageExtensions
            GHC.Internal.Lexeme
            GHC.Internal.TH.Syntax
            GHC.Internal.TH.Ppr
            GHC.Internal.TH.PprLib
            GHC.Internal.TH.Lib.Map

in that cabal file. you might try doing surgery on it to see if we can wriggle past this problem?do let us know!

shayne-fletcher avatar Sep 24 '25 22:09 shayne-fletcher

Oh is that new? This is with ghc-9.12.2.20250922. It passed on an earlier run that used ghc-9.12.2.20250828.

brandonchinn178 avatar Sep 24 '25 22:09 brandonchinn178

that's a regression in upstream 9.12.3-rc1; the wasm releases are always rebased on upstream release branches. also see https://gitlab.haskell.org/ghc/head.hackage/-/blob/master/patches/ghc-lib-parser-9.12.2.20250421.patch#L31

TerrorJack avatar Sep 26 '25 22:09 TerrorJack

@TerrorJack Thanks, how do I apply that patch in my build?

brandonchinn178 avatar Sep 26 '25 22:09 brandonchinn178

a source-repository-package for the time being; though maybe doing an upstream hackage release on the 9.12 branch would solve this?

TerrorJack avatar Sep 26 '25 22:09 TerrorJack

Pinning GHC WASM seems to have worked for now: https://github.com/fourmolu/fourmolu/commit/f2787f8d2b849e699e86d717626bd92405307c44

brandonchinn178 avatar Sep 27 '25 17:09 brandonchinn178