[Haskell-cafe] Issue building with ghc-9.8.2 and packages unix, directory, filepath and os-string

Daniel Trstenjak daniel.trstenjak at gmail.com
Thu May 30 07:54:21 UTC 2024


Hi,

I'm trying to get my program to compile with ghc-9.8.2. Raising the
upper bounds of my dependencies I'm running into a compile error
for the unix-2.8.5.1 package:

[15 of 53] Compiling System.Posix.Env.PosixString ( /home/dan/sources/unix-2.8.5.1/dist-newstyle/build/x86_64-linux/ghc-9.8.2/unix-2.8.5.1/build/System/Posix/Env/PosixString.hs, /home/dan/sources/unix-2.8.5.1/dist-newstyle/build/x86_64-linux/ghc-9.8.2/unix-2.8.5.1/build/System/Posix/Env/PosixString.o, /home/dan/sources/unix-2.8.5.1/dist-newstyle/build/x86_64-linux/ghc-9.8.2/unix-2.8.5.1/build/System/Posix/Env/PosixString.dyn_o )

System/Posix/Env/PosixString.hsc:45:1: error: [GHC-87110]
    Could not load module ‘System.OsString.Internal.Types’.
    It is a member of the hidden package ‘os-string-2.0.3’.
    Perhaps you need to add ‘os-string’ to the build-depends in your .cabal file.
    It is a member of the hidden package ‘filepath-1.4.200.1’.
    Perhaps you need to add ‘filepath’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
   |
45 | import System.OsString.Internal.Types
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System/Posix/Env/PosixString.hsc:47:1: error: [GHC-61948]
    Could not find module ‘System.OsString.Data.ByteString.Short’.
    Perhaps you meant
      System.OsString.Data.ByteString.Short (needs flag -package-id os-string-2.0.3)
      System.OsPath.Data.ByteString.Short (needs flag -package-id filepath-1.4.200.1)
      System.OsString.Data.ByteString.Short.Word16 (needs flag -package-id os-string-2.0.3)
   |
47 | import qualified "os-string" System.OsString.Data.ByteString.Short as B
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System/Posix/PosixPath/FilePath.hsc:50:1: error: [GHC-61948]
    Could not find module ‘System.OsString.Data.ByteString.Short’.
    Perhaps you meant
      System.OsString.Data.ByteString.Short (needs flag -package-id os-string-2.0.3)
      System.OsPath.Data.ByteString.Short (needs flag -package-id filepath-1.4.200.1)
      System.OsString.Data.ByteString.Short.Word16 (needs flag -package-id os-string-2.0.3)
   |
50 | import "os-string" System.OsString.Data.ByteString.Short as BSS
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System/Posix/PosixPath/FilePath.hsc:55:1: error: [GHC-87110]
    Could not load module ‘System.OsString.Internal.Types’.
    It is a member of the hidden package ‘os-string-2.0.3’.
    Perhaps you need to add ‘os-string’ to the build-depends in your .cabal file.
    It is a member of the hidden package ‘filepath-1.4.200.1’.
    Perhaps you need to add ‘filepath’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
   |
55 | import System.OsString.Internal.Types (PosixString(..), pattern PS)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I can get rid of this compile error and a similar one for the directory
package by setting the flag os-string in my cabal.project file:
   constraints: unix +os-string, directory +os-string

Now I'm wondering what is the right way to handle this case?
Thanks for any hints!

Greetings,
Daniel


More information about the Haskell-Cafe mailing list