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

Bump required dependencies and add a CI for ghc-9.10 #2749

Merged
merged 5 commits into from
Jul 20, 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
27 changes: 26 additions & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
matrix:
# The order is important to optimize fail-fast.
name:
- 9.8.1-Werror
- 9.10.1-Werror
# - 9.8.1-docspec
# - 8.10.7-coverage

Expand All @@ -94,6 +94,31 @@ jobs:
cabal_project: cabal.project.ghc-head
disable_sdist_build: "y"
ignore_error: true
- name: 9.10.1-Werror
ghc_version: 9.10.1
runner: ubuntu-latest
build: cabal
cabal_version: 3.10.1.0
disable_sdist_build: "y"
cabal_project: cabal.project.Werror
ignore_error: false
- name: 9.10.1-macos
ghc_version: 9.10.1
runner: macos-latest
build: cabal
cabal_version: 3.10.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
ignore_error: false
- name: 9.10.1-fusion-inspection
ghc_version: 9.10.1
runner: ubuntu-latest
build: cabal
cabal_version: 3.10.1.0
disable_sdist_build: "y"
cabal_project: cabal.project
cabal_build_options: "--flag fusion-plugin --flag inspection"
ignore_error: false
# Note: use linux for warning build for convenient dev testing
- name: 9.8.1-Werror
ghc_version: 9.8.1
Expand Down
4 changes: 2 additions & 2 deletions benchmark/streamly-benchmarks.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ common bench-depends
-- Core libraries shipped with ghc, the min and max
-- constraints of these libraries should match with
-- the GHC versions we support
base >= 4.9 && < 4.20
base >= 4.9 && < 4.21
, deepseq >= 1.4.1 && < 1.6
, mtl >= 2.2 && < 2.3.2

Expand All @@ -201,7 +201,7 @@ common bench-depends
build-depends:
fusion-plugin >= 0.2 && < 0.3
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.22
build-depends: template-haskell >= 2.14 && < 2.23
, inspection-testing >= 0.4 && < 0.6
-- Array uses a Storable constraint in dev build making several inspection
-- tests fail
Expand Down
2 changes: 2 additions & 0 deletions core/src/Streamly/Internal/Data/Serialize/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module Streamly.Internal.Data.Serialize.TH
-- Imports
--------------------------------------------------------------------------------

import Data.Foldable (length, foldMap)
import Data.List (foldl')
import Data.Word (Word16, Word32, Word64, Word8)

Expand All @@ -48,6 +49,7 @@ import qualified Streamly.Internal.Data.Serialize.TH.RecHeader as RecHeader
import Streamly.Internal.Data.Serialize.TH.Bottom
import Streamly.Internal.Data.Serialize.TH.Common
import Streamly.Internal.Data.Serialize.TH.RecHeader
import Prelude hiding (Foldable(..))

--------------------------------------------------------------------------------
-- Domain specific helpers
Expand Down
2 changes: 2 additions & 0 deletions core/src/Streamly/Internal/Data/Serialize/TH/Bottom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module Streamly.Internal.Data.Serialize.TH.Bottom

import Data.Maybe (isJust)
import Data.Char (chr, ord)
import Data.Foldable (length)
import Data.List (foldl')
import Data.Word (Word16, Word32, Word64, Word8)
import Data.Bits (Bits, (.|.), shiftL, zeroBits, xor)
Expand All @@ -69,6 +70,7 @@ import Streamly.Internal.Data.Serialize.Type
import qualified Streamly.Internal.Data.Unbox as Unbox

import Streamly.Internal.Data.Unbox.TH (DataCon(..))
import Prelude hiding (Foldable(..))

--------------------------------------------------------------------------------
-- Config
Expand Down
4 changes: 3 additions & 1 deletion core/src/Streamly/Internal/Data/Serialize/TH/RecHeader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module Streamly.Internal.Data.Serialize.TH.RecHeader
--------------------------------------------------------------------------------

import Control.Monad (void)
import Data.Foldable (length, sum)
import Data.List (foldl')
import Data.Word (Word32, Word8)
import Data.Maybe (fromJust)
Expand All @@ -34,6 +35,7 @@ import qualified Streamly.Internal.Data.Unbox as Unbox

import Streamly.Internal.Data.Serialize.TH.Bottom
import Streamly.Internal.Data.Serialize.TH.Common
import Prelude hiding (Foldable(..))

--------------------------------------------------------------------------------
-- Notes
Expand Down Expand Up @@ -353,7 +355,7 @@ mkDeserializeKeysDec funcName updateFunc (SimpleDataCon cname fields) = do
([], dataOff)
keys
$(varP finalRec) <-
$(foldl
$(foldl'
(\acc i ->
[|$(acc) <*>
$(deserializeFieldExpr i)|])
Expand Down
1 change: 1 addition & 0 deletions core/src/Streamly/Internal/Data/Serialize/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import qualified Streamly.Internal.Data.Array.Type as Array
import qualified Streamly.Internal.Data.MutArray as MutArray

import GHC.Exts
import Prelude hiding (Foldable(..))

--------------------------------------------------------------------------------
-- Developer Note
Expand Down
4 changes: 2 additions & 2 deletions core/streamly-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,13 @@ library
-- depend on streamly.
ghc-prim >= 0.5.3 && < 0.12
, fusion-plugin-types >= 0.1 && < 0.2
, base >= 4.12 && < 4.20
, base >= 4.12 && < 4.21
, exceptions >= 0.8.0 && < 0.11
, transformers >= 0.5.5 && < 0.7
, filepath >= 1.4.2 && < 1.6

-- streamly-unicode-core
, template-haskell >= 2.14 && < 2.22
, template-haskell >= 2.14 && < 2.23

-- streamly-filesystem-core
, directory >= 1.3.3 && < 1.4
Expand Down
1 change: 1 addition & 0 deletions src/Streamly/Internal/Data/Stream/Serial.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

{-# OPTIONS_GHC -Wno-deprecations #-}
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}

-- |
-- Module : Streamly.Internal.Data.Stream.Serial
Expand Down
1 change: 1 addition & 0 deletions src/Streamly/Internal/Data/Stream/Zip.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{-# LANGUAGE UndecidableInstances #-}

{-# OPTIONS_GHC -Wno-deprecations #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}

-- |
-- Module : Streamly.Internal.Data.Stream.Zip
Expand Down
5 changes: 4 additions & 1 deletion src/Streamly/Internal/FileSystem/Event/Linux.hs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ createWatch = do
rawfd <- throwErrnoIfMinus1 "createWatch" c_inotify_init
-- we could use fdToHandle but it cannot determine the fd type
-- automatically for the inotify fd
--
-- XXX It locks a regular file, do we need that for watching?
(fd, fdType) <-
mkFD
rawfd
Expand All @@ -598,13 +600,14 @@ createWatch = do
False -- not a socket
False -- non-blocking is false
let fdString = "<createWatch file descriptor: " ++ show fd ++ ">"
-- XXX Do we need non-blocking IO?
h <-
mkHandleFromFD
fd
fdType
fdString
ReadMode
True -- use non-blocking IO
False -- use non-blocking IO
Nothing -- TextEncoding (binary)
emptyMapRef <- newIORef Map.empty
return $ Watch h emptyMapRef
Expand Down
11 changes: 8 additions & 3 deletions streamly.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ library
-- packages depending on the "ghc" package (packages
-- depending on doctest is a common example) can
-- depend on streamly.
base >= 4.12 && < 4.20
base >= 4.12 && < 4.21
, containers >= 0.6.0 && < 0.8
, deepseq >= 1.4.4 && < 1.6
, exceptions >= 0.8.0 && < 0.11
, mtl >= 2.2.2 && < 2.4
, transformers >= 0.5.5 && < 0.7
, template-haskell >= 2.14 && < 2.22
, template-haskell >= 2.14 && < 2.23

-- The core streamly package
, streamly-core == 0.3.0
Expand All @@ -518,14 +518,19 @@ library
, heaps >= 0.3 && < 0.5

-- concurrency
, atomic-primops >= 0.8 && < 0.9
, lockfree-queue >= 0.2.4 && < 0.3

, unicode-data >= 0.1 && < 0.7

-- Network
, network >= 2.6 && < 3.3


if impl(ghc < 9.10)
build-depends: atomic-primops >= 0.8 && < 0.9
else
build-depends: atomic-primops >= 0.8.8 && < 0.9

if impl(ghc < 9.6)
build-depends: transformers-base >= 0.4 && < 0.5

Expand Down
2 changes: 1 addition & 1 deletion test/Streamly/Test/Data/Unbox.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Data.Complex (Complex ((:+)))
import Data.Functor.Const (Const (..))
import Data.Functor.Identity (Identity (..))
import Data.Proxy (Proxy(..))
import GHC.Generics (Generic, Rep(..))
import GHC.Generics (Generic, Rep)
import GHC.Real (Ratio(..))

import Streamly.Internal.Data.MutByteArray
Expand Down
5 changes: 4 additions & 1 deletion test/Streamly/Test/FileSystem/Event/Linux.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ main = do
: regSymTests

let symTests =
#ifdef DEVBUILD
-- when root is a symlinked dir, it does not recv touch, isDeleted
-- or rootDeleted, rootUnwatched events.
dirDelete "" (\dir -> [(dir, dirEvent Event.isAttrsModified)])
-- No events occur when a symlink root is moved
: regSymTests
:
#endif
regSymTests

let w = Event.watchWith (Event.setAllEvents True)
run = runTests moduleName "non-recursive" w
Expand Down
3 changes: 3 additions & 0 deletions test/lib/Streamly/Test/Prelude/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ import Control.Monad (when)
import Control.Monad.Catch (throwM, MonadThrow)
import Data.IORef ( IORef, atomicModifyIORef', modifyIORef', newIORef
, readIORef, writeIORef)
import Data.Foldable
(elem, foldl, foldMap, foldr, length, maximum, minimum, null, product, sum)
import Data.List
( delete
, deleteBy
Expand Down Expand Up @@ -144,6 +146,7 @@ import qualified Streamly.Internal.Data.Unfold as UF
import qualified Data.Map.Strict as Map

import Streamly.Test.Common
import Prelude hiding (Foldable(..))

maxStreamLen :: Int
maxStreamLen = 1000
Expand Down
20 changes: 7 additions & 13 deletions test/streamly-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ common optimization-options
common test-dependencies
build-depends:
streamly-core
, base >= 4.9 && < 4.20
, base >= 4.9 && < 4.22
, containers >= 0.5 && < 0.8
, exceptions >= 0.8 && < 0.11
, ghc
Expand All @@ -156,11 +156,11 @@ common test-dependencies
, transformers >= 0.4 && < 0.7
, QuickCheck >= 2.13 && < 2.15
, directory >= 1.2.2 && < 1.4
, filepath >= 1.4.1 && < 1.5
, filepath >= 1.4.1 && < 1.6
, temporary >= 1.3 && < 1.4
, network >= 3.1 && < 3.3
, scientific >= 0.0 && < 0.4
, template-haskell >= 2.12 && < 2.22
, template-haskell >= 2.12 && < 2.23

if !flag(use-streamly-core)
build-depends: streamly
Expand Down Expand Up @@ -394,9 +394,7 @@ test-suite FileSystem.Event
ghc-options: -main-is Streamly.Test.FileSystem.Event
main-is: Streamly/Test/FileSystem/Event.hs
other-modules: Streamly.Test.FileSystem.Event.Common
if !(os(linux) || os(darwin) || os(windows))
buildable: False
if flag(use-streamly-core)
if !(os(linux) || os(darwin) || os(windows)) || flag(use-streamly-core)
buildable: False

test-suite FileSystem.Event.Darwin
Expand All @@ -406,9 +404,7 @@ test-suite FileSystem.Event.Darwin
other-modules: Streamly.Test.FileSystem.Event.Common
cpp-options: -DFILESYSTEM_EVENT_DARWIN
ghc-options: -main-is Streamly.Test.FileSystem.Event.Darwin
if !os(darwin)
buildable: False
if flag(use-streamly-core)
if !os(darwin) || flag(use-streamly-core)
buildable: False

test-suite FileSystem.Event.Linux
Expand All @@ -418,7 +414,7 @@ test-suite FileSystem.Event.Linux
other-modules: Streamly.Test.FileSystem.Event.Common
cpp-options: -DFILESYSTEM_EVENT_LINUX
ghc-options: -main-is Streamly.Test.FileSystem.Event.Linux
if !os(linux) || !flag(dev) || flag(use-streamly-core)
if !os(linux) || flag(use-streamly-core)
buildable: False

test-suite FileSystem.Event.Windows
Expand All @@ -428,9 +424,7 @@ test-suite FileSystem.Event.Windows
other-modules: Streamly.Test.FileSystem.Event.Common
cpp-options: -DFILESYSTEM_EVENT_WINDOWS
ghc-options: -main-is Streamly.Test.FileSystem.Event.Windows
if !os(windows)
buildable: False
if flag(use-streamly-core)
if !os(windows) || flag(use-streamly-core)
buildable: False

test-suite FileSystem.Handle
Expand Down
Loading