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

Andrew Lelechenko andrew.lelechenko at gmail.com
Thu May 30 20:22:43 UTC 2024


Normally you do not need to set `constraints: unix +os-string, directory +os-string`. It’s better to let Cabal figure out a build plan without forcing its hand. 

Sharing your project would help, otherwise it’s hard to diagnose.

Best regards,
Andrew

> On 30 May 2024, at 08:54, Daniel Trstenjak <daniel.trstenjak at gmail.com> wrote:
> 
> 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
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



More information about the Haskell-Cafe mailing list