opened 01:16AM - 08 Apr 24 UTC
0.kind: bug
6.topic: haskell
### Describe the bug
Build failure on `installPhase` on projects that use `-fpl…ugin=Some.Plugin.Module.Here` flag in library's `ghc-options`.
Appeared after recent haskellPackages update that bumped default GHC to 9.6.
`cabal build` inside `shellFor` shell still working.
<details>
<summary>Failure log</summary>
```bash
Running phase: buildPhase
Preprocessing library for example-0.1.0.0..
Building library for example-0.1.0.0..
[1 of 1] Compiling Lib ( lib/Lib.hs, dist/build/Lib.o, dist/build/Lib.dyn_o )
@nix { "action": "setPhase", "phase": "checkPhase" }
Running phase: checkPhase
Package has no test suites.
@nix { "action": "setPhase", "phase": "haddockPhase" }
Running phase: haddockPhase
@nix { "action": "setPhase", "phase": "installPhase" }
Running phase: installPhase
Installing library in /nix/store/qcmqhpfphzlc7ww25dgqv1rksi3dlgy6-example-0.1.0.0/lib/ghc-9.6.4/lib/x86_64-linux-ghc-9.6.4/exa>
Error: Setup: '/nix/store/p64ngk1v9d63lnrnyq0cynjd8jdk5jfa-ghc-9.6.4/bin/ghc'
exited with an error:
<command line>: Could not load module ‘GHC.TypeLits.Normalise’
It is a member of the hidden package ‘ghc-typelits-natnormalise-0.7.9’.
Perhaps you need to add ‘ghc-typelits-natnormalise’ to the build-depends in
your .cabal file.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
```
</details>
[Minimal failing example here](https://github.com/Diamondy4/nix-broken-ghc-plugin-example).
[Same example but on pre-default GHC 9.6 nixpkgs commit](https://github.com/Diamondy4/nix-broken-ghc-plugin-example/tree/working-old-nix-ghc) builds successfully with default GHC 9.4.
### Steps To Reproduce
Steps to reproduce the behavior:
1. Add any GHC plugin to library's build-depends
2. Add that GHC plugin to library's ghc-options as "-fplugin=Some.Plugin.Module.Here"
3. Build it
### Expected behavior
Successful build as it was before recent haskell-updates merge (before default GHC 9.6)
### Additional context
Tested with effectful-plugin and ghc-typelits-natnormalise.
### Notify maintainers
<!--
Please @ people who are in the `meta.maintainers` list of the offending package or module.
If in doubt, check `git blame` for whoever last touched something.
-->
@NixOS/haskell @ncfavier @cdepillabout @expipiplus1 @maralorn @sternenseemann
### Metadata
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
```console
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 6.8.4-cachyos, NixOS, 24.05 (Uakari), 24.05.20240403.fd281bd`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.21.1`
- nixpkgs: `/nix/store/n2g5cqwv8qf5p6vjxny6pg3blbdij12k-source`
```
---
Add a :+1: [reaction] to [issues you find important].
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[issues you find important]: https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc