Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Posix.Terminal.PosixString: Fix imports in HAVE_OPENPTY path #312

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
task:
name: FreeBSD
freebsd_instance:
image_family: freebsd-13-1
image_family: freebsd-13-2
install_script: pkg install -y ghc hs-cabal-install git autoconf
script:
- cabal update
Expand Down
12 changes: 9 additions & 3 deletions System/Posix/Terminal/PosixString.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if MIN_VERSION_filepath(1,5,0)
#ifdef MIN_VERSION_os_string

would be more robust, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bgamari did you try this?

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 (
Expand Down
2 changes: 1 addition & 1 deletion cabal.project.wasm32-wasi
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package unix

write-ghc-environment-files: always

allow-newer: all:base, all:filepath
allow-newer: all:base
Loading