Skip to content

Commit

Permalink
Support GHC-9.6 wrt #979
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Feb 2, 2024
1 parent d0538a5 commit 4546e33
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 31 deletions.
9 changes: 7 additions & 2 deletions cabal.ghc8107.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ else
flags: +tui +tar

constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0
any.aeson >= 2.0.1.0,
transformers < 0.6,
mtl < 2.3

if os(mingw32)
if impl(ghc >= 9.4)
Expand Down Expand Up @@ -44,12 +46,15 @@ package aeson
flags: +ordered-keymap

package streamly
flags: +use-unliftio
flags: +use-unliftio -streamly-core

package *
test-show-details: direct

allow-newer: cabal-install-parsers:tar

if impl(ghc >= 9.6)
allow-newer: cabal-install-parsers:base, streamly:base, streamly:ghc-prim, streamly-core:unicode-data, semigroupoids:base, Cabal:unix, unicode-data:base


with-compiler: ghc-8.10.7
9 changes: 5 additions & 4 deletions cabal.ghc8107.project.freeze
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ constraints: any.Cabal ==3.6.3.0,
any.haskell-lexer ==1.1.1,
any.haskus-utils-data ==1.4,
any.haskus-utils-types ==1.5.1,
any.haskus-utils-variant ==3.3,
any.haskus-utils-variant ==3.4,
haskus-utils-variant +unliftio,
any.heaps ==0.4,
any.hsc2hs ==0.68.10,
hsc2hs -in-ghc-tree,
Expand All @@ -111,7 +112,7 @@ constraints: any.Cabal ==3.6.3.0,
any.hspec-discover ==2.10.10,
any.hspec-expectations ==0.8.2,
any.hspec-golden-aeson ==0.9.0.0,
any.http-io-streams ==0.1.6.3,
any.http-io-streams ==0.1.6.4,
http-io-streams -brotli +fast-xor,
any.indexed-profunctors ==0.1.1.1,
any.indexed-traversable ==0.1.3,
Expand All @@ -121,7 +122,7 @@ constraints: any.Cabal ==3.6.3.0,
integer-logarithms -check-bounds +integer-gmp,
any.io-streams ==1.5.2.2,
io-streams +network -nointeractivetests +zlib,
any.language-c ==0.9.2,
any.language-c ==0.9.3,
language-c -allwarnings +iecfpextension +usebytestrings,
any.libarchive ==3.0.4.2,
libarchive -cross -low-memory +no-exe -system-libarchive,
Expand Down Expand Up @@ -253,4 +254,4 @@ constraints: any.Cabal ==3.6.3.0,
any.zlib ==0.6.3.0,
zlib -bundled-c-zlib -non-blocking-ffi -pkg-config,
any.zlib-bindings ==0.1.1.5
index-state: hackage.haskell.org 2024-01-19T19:48:54Z
index-state: hackage.haskell.org 2024-02-02T07:31:11Z
9 changes: 7 additions & 2 deletions cabal.ghc902.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ else
flags: +tui +tar

constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0
any.aeson >= 2.0.1.0,
transformers < 0.6,
mtl < 2.3

if os(mingw32)
if impl(ghc >= 9.4)
Expand Down Expand Up @@ -44,12 +46,15 @@ package aeson
flags: +ordered-keymap

package streamly
flags: +use-unliftio
flags: +use-unliftio -streamly-core

package *
test-show-details: direct

allow-newer: cabal-install-parsers:tar

if impl(ghc >= 9.6)
allow-newer: cabal-install-parsers:base, streamly:base, streamly:ghc-prim, streamly-core:unicode-data, semigroupoids:base, Cabal:unix, unicode-data:base


with-compiler: ghc-9.0.2
9 changes: 5 additions & 4 deletions cabal.ghc902.project.freeze
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ constraints: any.Cabal ==3.6.3.0,
any.haskell-lexer ==1.1.1,
any.haskus-utils-data ==1.4,
any.haskus-utils-types ==1.5.1,
any.haskus-utils-variant ==3.3,
any.haskus-utils-variant ==3.4,
haskus-utils-variant +unliftio,
any.heaps ==0.4,
any.hsc2hs ==0.68.10,
hsc2hs -in-ghc-tree,
Expand All @@ -117,7 +118,7 @@ constraints: any.Cabal ==3.6.3.0,
any.hspec-discover ==2.10.10,
any.hspec-expectations ==0.8.2,
any.hspec-golden-aeson ==0.9.0.0,
any.http-io-streams ==0.1.6.3,
any.http-io-streams ==0.1.6.4,
http-io-streams -brotli +fast-xor,
any.indexed-profunctors ==0.1.1.1,
any.indexed-traversable ==0.1.3,
Expand All @@ -126,7 +127,7 @@ constraints: any.Cabal ==3.6.3.0,
integer-logarithms -check-bounds +integer-gmp,
any.io-streams ==1.5.2.2,
io-streams +network -nointeractivetests +zlib,
any.language-c ==0.9.2,
any.language-c ==0.9.3,
language-c -allwarnings +iecfpextension +usebytestrings,
any.libyaml-streamly ==0.2.2,
libyaml-streamly -no-unicode -system-libyaml,
Expand Down Expand Up @@ -266,4 +267,4 @@ constraints: any.Cabal ==3.6.3.0,
any.zlib-bindings ==0.1.1.5,
any.zstd ==0.1.3.0,
zstd +standalone
index-state: hackage.haskell.org 2024-01-19T19:48:54Z
index-state: hackage.haskell.org 2024-02-02T07:31:11Z
9 changes: 7 additions & 2 deletions cabal.ghc928.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ else
flags: +tui +tar

constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0
any.aeson >= 2.0.1.0,
transformers < 0.6,
mtl < 2.3

if os(mingw32)
if impl(ghc >= 9.4)
Expand Down Expand Up @@ -44,12 +46,15 @@ package aeson
flags: +ordered-keymap

package streamly
flags: +use-unliftio
flags: +use-unliftio -streamly-core

package *
test-show-details: direct

allow-newer: cabal-install-parsers:tar

if impl(ghc >= 9.6)
allow-newer: cabal-install-parsers:base, streamly:base, streamly:ghc-prim, streamly-core:unicode-data, semigroupoids:base, Cabal:unix, unicode-data:base


with-compiler: ghc-9.2.8
9 changes: 5 additions & 4 deletions cabal.ghc928.project.freeze
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ constraints: any.Cabal ==3.6.3.0,
any.haskell-lexer ==1.1.1,
any.haskus-utils-data ==1.4,
any.haskus-utils-types ==1.5.1,
any.haskus-utils-variant ==3.3,
any.haskus-utils-variant ==3.4,
haskus-utils-variant +unliftio,
any.heaps ==0.4,
any.hsc2hs ==0.68.10,
hsc2hs -in-ghc-tree,
Expand All @@ -117,7 +118,7 @@ constraints: any.Cabal ==3.6.3.0,
any.hspec-discover ==2.10.10,
any.hspec-expectations ==0.8.2,
any.hspec-golden-aeson ==0.9.0.0,
any.http-io-streams ==0.1.6.3,
any.http-io-streams ==0.1.6.4,
http-io-streams -brotli +fast-xor,
any.indexed-profunctors ==0.1.1.1,
any.indexed-traversable ==0.1.3,
Expand All @@ -126,7 +127,7 @@ constraints: any.Cabal ==3.6.3.0,
integer-logarithms -check-bounds +integer-gmp,
any.io-streams ==1.5.2.2,
io-streams +network -nointeractivetests +zlib,
any.language-c ==0.9.2,
any.language-c ==0.9.3,
language-c -allwarnings +iecfpextension +usebytestrings,
any.libyaml-streamly ==0.2.2,
libyaml-streamly -no-unicode -system-libyaml,
Expand Down Expand Up @@ -266,4 +267,4 @@ constraints: any.Cabal ==3.6.3.0,
any.zlib-bindings ==0.1.1.5,
any.zstd ==0.1.3.0,
zstd +standalone
index-state: hackage.haskell.org 2024-01-19T19:48:54Z
index-state: hackage.haskell.org 2024-02-02T07:31:11Z
9 changes: 7 additions & 2 deletions cabal.ghc948.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ else
flags: +tui +tar

constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0
any.aeson >= 2.0.1.0,
transformers < 0.6,
mtl < 2.3

if os(mingw32)
if impl(ghc >= 9.4)
Expand Down Expand Up @@ -44,12 +46,15 @@ package aeson
flags: +ordered-keymap

package streamly
flags: +use-unliftio
flags: +use-unliftio -streamly-core

package *
test-show-details: direct

allow-newer: cabal-install-parsers:tar

if impl(ghc >= 9.6)
allow-newer: cabal-install-parsers:base, streamly:base, streamly:ghc-prim, streamly-core:unicode-data, semigroupoids:base, Cabal:unix, unicode-data:base


with-compiler: ghc-9.4.8
9 changes: 5 additions & 4 deletions cabal.ghc948.project.freeze
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ constraints: any.Cabal ==3.6.3.0 || ==3.8.1.0,
any.haskell-lexer ==1.1.1,
any.haskus-utils-data ==1.4,
any.haskus-utils-types ==1.5.1,
any.haskus-utils-variant ==3.3,
any.haskus-utils-variant ==3.4,
haskus-utils-variant +unliftio,
any.heaps ==0.4,
any.hsc2hs ==0.68.10,
hsc2hs -in-ghc-tree,
Expand All @@ -116,7 +117,7 @@ constraints: any.Cabal ==3.6.3.0 || ==3.8.1.0,
any.hspec-discover ==2.10.10,
any.hspec-expectations ==0.8.2,
any.hspec-golden-aeson ==0.9.0.0,
any.http-io-streams ==0.1.6.3,
any.http-io-streams ==0.1.6.4,
http-io-streams -brotli +fast-xor,
any.indexed-profunctors ==0.1.1.1,
any.indexed-traversable ==0.1.3,
Expand All @@ -125,7 +126,7 @@ constraints: any.Cabal ==3.6.3.0 || ==3.8.1.0,
integer-logarithms -check-bounds +integer-gmp,
any.io-streams ==1.5.2.2,
io-streams +network -nointeractivetests +zlib,
any.language-c ==0.9.2,
any.language-c ==0.9.3,
language-c -allwarnings +iecfpextension +usebytestrings,
any.libyaml-streamly ==0.2.2,
libyaml-streamly -no-unicode -system-libyaml,
Expand Down Expand Up @@ -264,4 +265,4 @@ constraints: any.Cabal ==3.6.3.0 || ==3.8.1.0,
any.zlib-bindings ==0.1.1.5,
any.zstd ==0.1.3.0,
zstd +standalone
index-state: hackage.haskell.org 2024-01-19T19:48:54Z
index-state: hackage.haskell.org 2024-02-02T07:31:11Z
9 changes: 7 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ else
flags: +tui +tar

constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0
any.aeson >= 2.0.1.0,
transformers < 0.6,
mtl < 2.3

if os(mingw32)
if impl(ghc >= 9.4)
Expand Down Expand Up @@ -44,10 +46,13 @@ package aeson
flags: +ordered-keymap

package streamly
flags: +use-unliftio
flags: +use-unliftio -streamly-core

package *
test-show-details: direct

allow-newer: cabal-install-parsers:tar

if impl(ghc >= 9.6)
allow-newer: cabal-install-parsers:base, streamly:base, streamly:ghc-prim, streamly-core:unicode-data, semigroupoids:base, Cabal:unix, unicode-data:base

2 changes: 0 additions & 2 deletions cabal.project.freeze

This file was deleted.

4 changes: 2 additions & 2 deletions ghcup.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ common app-common-depends
, directory ^>=1.3.6.0
, filepath ^>=1.4.2.1
, haskus-utils-types ^>=1.5
, haskus-utils-variant ^>=3.3
, haskus-utils-variant ^>=3.3 || ^>=3.4
, megaparsec >=8.0.0 && <9.3
, mtl ^>=2.2
, optparse-applicative >=0.15.1.0 && <0.18
Expand Down Expand Up @@ -187,7 +187,7 @@ library
, filepath ^>=1.4.2.1
, file-uri ^>=0.1.0.0
, haskus-utils-types ^>=1.5
, haskus-utils-variant ^>=3.3
, haskus-utils-variant ^>=3.3 || ^>=3.4
, lzma-static ^>=5.2.5.3
, megaparsec >=8.0.0 && <9.3
, mtl ^>=2.2
Expand Down
12 changes: 11 additions & 1 deletion lib/GHCup/Prelude/Process/Posix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE CPP #-}

{-|
Module : GHCup.Utils.File.Posix
Expand Down Expand Up @@ -98,7 +99,12 @@ execLogged exe args chdir lfile env = do
Dirs {..} <- getDirs
logDebug $ T.pack $ "Running " <> exe <> " with arguments " <> show args
let logfile = fromGHCupPath logsDir </> lfile <> ".log"
liftIO $ bracket (openFd logfile WriteOnly (Just newFilePerms) defaultFileFlags{ append = True })
liftIO $ bracket
#if MIN_VERSION_unix(2,8,0)
(openFd logfile WriteOnly defaultFileFlags{ append = True, creat = Just newFilePerms })
#else
(openFd logfile WriteOnly (Just newFilePerms) defaultFileFlags{ append = True })
#endif
closeFd
(action verbose noColor)
where
Expand Down Expand Up @@ -339,7 +345,11 @@ cleanup fds = for_ fds $ \fd -> handleIO (\_ -> pure ()) $ closeFd fd
-- | Create a new regular file in write-only mode. The file must not exist.
createRegularFileFd :: FileMode -> FilePath -> IO Fd
createRegularFileFd fm dest =
#if MIN_VERSION_unix(2,8,0)
openFd dest WriteOnly defaultFileFlags{ exclusive = True, creat = Just fm }
#else
openFd dest WriteOnly (Just fm) defaultFileFlags{ exclusive = True }
#endif


-- | Thin wrapper around `executeFile`.
Expand Down

0 comments on commit 4546e33

Please sign in to comment.