Could there be a packaging problem with GHC 9.2.4 on x86_64/macOS, relating to 'profiling'?
For my full 'journey of discovery', see Stack repository issue #5895.
In short: GitHub Action-supplied runners come with GHC, Stack and GHCup - see, for example, the macOS info. It looks like the GitHub runner for macos-latest
(only, runners for Windows and Linux do not exhibit the same thing) very recently changed from supplying Stack without GHCup's 'hooks' script to supplying Stack with GHCup's 'hooks' script. This change was manifested in Stack's CI logs reporting:
2022-10-07T09:39:46.6439200Z Using runghc located at /Users/runner/.ghcup/ghc/9.2.4/bin/runghc
when previously, it had reported:
2022-10-04T20:22:46.2355020Z Using runghc located at /Users/runner/.stack/programs/x86_64-osx/ghc-9.2.4/bin/runghc
That is fine, of course, but the change also resulted in Stack's integration tests CI complaining if stack build --profile
(only - stack build
worked fine) was used, with (obscure) error messages like:
2022-10-07T10:07:12.4256830Z filepath > Building library for filepath-1.4.2.2..
2022-10-07T10:07:12.4257240Z filepath > [1 of 3] Compiling System.FilePath.Posix
2022-10-07T10:07:12.4257530Z filepath >
2022-10-07T10:07:12.4258150Z filepath > /Users/runner/work/stack/stack/test/integration/tests/mutable-deps/files/filepath-1.4.2.2/System/FilePath/Posix.hs:64:8: error:
2022-10-07T10:07:12.4258720Z filepath > Could not find module ‘Prelude’
2022-10-07T10:07:12.4259290Z filepath > Perhaps you haven't installed the profiling libraries for package ‘base-4.16.3.0’?
2022-10-07T10:07:12.4259880Z filepath > Use -v (or `:set -v` in ghci) to see a list of the files searched for.
2022-10-07T10:07:12.4260200Z filepath > |
2022-10-07T10:07:12.4260480Z filepath > 64 | module System.FilePath.Posix
2022-10-07T10:07:12.4260770Z filepath > | ^^^^^^^^^^^^^^^^^^^^^
2022-10-07T10:07:12.4261330Z filepath >
The problem went away, if I deleted the 'hooks' scripts in the CI and allowed Stack, once again, to use the Stack-supplied version of GHC 9.2.4 published by the GHC developers.
In the past, these sorts of messages - Could not find module ‘Prelude’ Perhaps you haven't installed the profiling libraries for package ‘base-4.16.3.0’?
- have been attributed to 'packaging' problems - see for example https://discourse.haskell.org/t/stack-build-error-with-profile-option/4392 and the Stack Overflow link there. Is it possible that there could be a packaging problem with the GHCup-supplied GHC 9.2.4 for x86_64/macOS?