From a234ee12cf5c9c6d7c79fc9076f27492e7641939 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 1 Feb 2024 11:45:33 -0500 Subject: [PATCH] System.Posix.Terminal.PosixString: Fix imports in HAVE_OPENPTY path This appears to have broken with the `os-string` split of `filepath-1.5`. --- System/Posix/Terminal/PosixString.hsc | 12 +++++++++--- cabal.project.wasm32-wasi | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/System/Posix/Terminal/PosixString.hsc b/System/Posix/Terminal/PosixString.hsc index a62f2bb6..5262360b 100644 --- a/System/Posix/Terminal/PosixString.hsc +++ b/System/Posix/Terminal/PosixString.hsc @@ -72,12 +72,18 @@ module System.Posix.Terminal.PosixString ( import Foreign import System.Posix.Types import System.Posix.Terminal.Common + #ifndef HAVE_OPENPTY -import qualified System.OsPath.Data.ByteString.Short as SBS -import System.Posix.IO.ByteString (defaultFileFlags, openFd, noctty, OpenMode(ReadWrite)) import Data.ByteString.Char8 as B ( pack, ) -import qualified System.OsPath.Data.ByteString.Short as BC +import System.Posix.IO.ByteString (defaultFileFlags, openFd, noctty, OpenMode(ReadWrite)) import System.OsString.Internal.Types (PosixString(..)) +#if MIN_VERSION_filepath(1,5,0) +import qualified System.OsString.Data.ByteString.Short as SBS +import qualified System.OsString.Data.ByteString.Short as BC +#else +import qualified System.OsPath.Data.ByteString.Short as SBS +import qualified System.OsPath.Data.ByteString.Short as BC +#endif #endif import Foreign.C hiding ( diff --git a/cabal.project.wasm32-wasi b/cabal.project.wasm32-wasi index 87a3e351..6e1737d3 100644 --- a/cabal.project.wasm32-wasi +++ b/cabal.project.wasm32-wasi @@ -1,6 +1,9 @@ packages: . package unix + -- Necessary as otherwise the `allow-newer` below will cause cabal to fail to + -- infer a consistent value of this flag. + flags: +os-string ghc-options: -Wno-unused-imports write-ghc-environment-files: always