GHC 9.4 (or Cabal 3.8?) fails on preprocessed files

In my libarchive:

vanessa@vanessa-desktop /development/haskell/libarchive 🌸 cabal build -w ghc-9.4
Resolving dependencies...
Build profile: -w ghc-9.4.1 -O1
In order, the following will be built (use -v for more details):
 - libarchive-3.0.4.0 (lib:libarchive) (first run)
[1 of 2] Compiling Main             ( /development/haskell/libarchive/dist-newstyle/build/x86_64-linux/ghc-9.4.1/libarchive-3.0.4.0/setup/setup.hs, /development/haskell/libarchive/dist-newstyle/build/x86_64-linux/ghc-9.4.1/libarchive-3.0.4.0/setup/Main.o )
[2 of 2] Linking /development/haskell/libarchive/dist-newstyle/build/x86_64-linux/ghc-9.4.1/libarchive-3.0.4.0/setup/setup
Configuring libarchive-3.0.4.0...
Preprocessing library for libarchive-3.0.4.0..
Building library for libarchive-3.0.4.0..

<no location info>: error:
    module ‘Codec.Archive.Types’ cannot be found locally

I get a similar error with .cpphs files in another project of mine.

Not sure where the error is but it’s new :thinking:

1 Like

What if you move it to exposed-modules?

1 Like

Unfortunately no! In both cases the problem is still there.

This reproduces with the latest Hackage release of libarchive and GHC 9.4.1 / cabal 3.8.1. When changed to GHC 9.2.3, the problem goes away. I’d report it on the GHC tracker.

1 Like