Skip to content

Build failure in Haskell libraries using -fplugin flag #302464

@Diamondy4

Description

@Diamondy4

Describe the bug

Build failure on installPhase on projects that use -fplugin=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.

Failure log
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.

Minimal failing example here.
Same example but on pre-default GHC 9.6 nixpkgs commit 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

@NixOS/haskell @ncfavier @cdepillabout @expipiplus1 @maralorn @sternenseemann

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[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 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: haskellGeneral-purpose, statically typed, purely functional programming language

    Type

    No type

    Projects

    Status

    Waiting

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions