Skip to content

Drop support for ghc-8.10 #692

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

Merged
merged 1 commit into from
Apr 28, 2025
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
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,16 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
ghc-version: ["8.10", "9.2", "9.4", "9.6", "9.8", "9.10", "9.12"]
ghc-version: ["9.2", "9.4", "9.6", "9.8", "9.10", "9.12"]
cabal-version: ["3.12"]
# The inclusion of these default keys in the matrix ensures that any
# entry under include that assigns these keys creates a new matrix entry
cabal-flags: [""]
cabal-project-file: [""]
cabal-documentation: [false]

exclude:
# GHC 8.10 is not supported on macOS wit ARM CPU
- ghc-version: "8.10"
os: "macOS-latest"

include:
# Include builds for various special cases
- name: "Build on macOS with Intel CPU and GHC 8.10"
os: "macOS-13"
ghc-version: "8.10"
- name: "Build with +serialblockio"
os: "ubuntu-latest"
cabal-flags: "+serialblockio"
Expand Down
5 changes: 0 additions & 5 deletions cabal.project.release
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ constraints: bloomfilter <0
-- we could add a conditional on (+serialblockio) to remove this import automatically.
import: cabal.project.blockio-uring

-- TODO: fix assembly error in text-2.1.2
if (impl(ghc < 9.0) && os(windows))
package text
flags: -simdutf

-- bugfix hGetBufExactly and hGetBufExactlyAt
source-repository-package
type: git
Expand Down
87 changes: 15 additions & 72 deletions lsm-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ copyright:
category: Database
build-type: Simple
tested-with:
GHC ==8.10 || ==9.2 || ==9.4 || ==9.6 || ==9.8 || ==9.10 || ==9.12
GHC ==9.2 || ==9.4 || ==9.6 || ==9.8 || ==9.10 || ==9.12

extra-doc-files: CHANGELOG.md
extra-source-files:
Expand Down Expand Up @@ -239,64 +239,7 @@ common wno-x-partial
ghc-options: -Wno-x-partial

common language
-- This is at the top-level so that `cabal check` does not complain.
default-language: Haskell2010

-- For newer GHC's, override Haskell2010 with GHC2021
if impl(ghc >=9.2.1)
default-language: GHC2021

else
-- NOTE: FieldSelectors is not supported on ghc-8.10.7, so it is the only
-- language extension that is missing compared to GHC2021
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NoExplicitNamespaces
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances

default-language: GHC2021
default-extensions:
DeriveAnyClass
DerivingStrategies
Expand Down Expand Up @@ -382,7 +325,7 @@ library
Database.LSMTree.Simple

build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, bitvec ^>=1.1
, bytestring ^>=0.11.4.0 || ^>=0.12.1.0
, cborg ^>=0.2.10.0
Expand Down Expand Up @@ -454,7 +397,7 @@ library bloomfilter
visibility: private
hs-source-dirs: bloomfilter/src
build-depends:
, base >=4.5 && <5
, base >=4.16 && <5
, bitvec ^>=1.1.5.0
, bytestring >=0.9
, data-array-byte
Expand Down Expand Up @@ -528,7 +471,7 @@ library extras
Database.LSMTree.Extras.UTxO

build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, bitvec
, bytestring
, containers
Expand Down Expand Up @@ -811,7 +754,7 @@ benchmark rocksdb-bench-wp8
hs-source-dirs: bench/macro
main-is: rocksdb-bench-wp8.hs

if !((os(linux) && flag(rocksdb)) && impl(ghc >=9.2.0))
if !(os(linux) && flag(rocksdb))
buildable: False

build-depends:
Expand All @@ -836,7 +779,7 @@ library rocksdb
exposed-modules: RocksDB
other-modules: RocksDB.FFI

if !((os(linux) && flag(rocksdb)) && impl(ghc >=9.2.0))
if !(os(linux) && flag(rocksdb))
buildable: False

-- Ubuntu 22.04 doesn't have pkgconfig files for rocksdb
Expand Down Expand Up @@ -864,7 +807,7 @@ test-suite kmerge-test
hs-source-dirs: test
main-is: kmerge-test.hs
build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, deepseq
, heaps
, lsm-tree:kmerge
Expand All @@ -883,7 +826,7 @@ benchmark kmerge-bench
main-is: kmerge-test.hs
cpp-options: -DKMERGE_BENCHMARKS
build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, deepseq
, heaps
, lsm-tree:kmerge
Expand All @@ -901,7 +844,7 @@ test-suite map-range-test
hs-source-dirs: test
main-is: map-range-test.hs
build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, bytestring
, containers
, lsm-tree
Expand Down Expand Up @@ -963,7 +906,7 @@ library blockio-api
System.FS.BlockIO.Serial

build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, deepseq ^>=1.4 || ^>=1.5
, fs-api ^>=0.3
, io-classes ^>=1.6 || ^>=1.7
Expand Down Expand Up @@ -1004,7 +947,7 @@ test-suite blockio-api-test
main-is: Main.hs
build-depends:
, async
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, bytestring
, fs-api
, lsm-tree:blockio-api
Expand All @@ -1024,7 +967,7 @@ library blockio-sim
hs-source-dirs: blockio-sim/src
exposed-modules: System.FS.BlockIO.Sim
build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, bytestring
, fs-api ^>=0.3
, fs-sim ^>=0.3
Expand All @@ -1039,7 +982,7 @@ test-suite blockio-sim-test
hs-source-dirs: blockio-sim/test
main-is: Main.hs
build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, fs-api
, fs-sim
, io-classes:strict-stm
Expand Down Expand Up @@ -1068,7 +1011,7 @@ library control
Control.RefCount

build-depends:
, base >=4.14 && <4.22
, base >=4.16 && <4.22
, deepseq ^>=1.4 || ^>=1.5
, io-classes ^>=1.6 || ^>=1.7
, io-classes:strict-stm
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-readme.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env cabal
{- cabal:
build-depends:
, base >=4.12
, base >=4.16
, bytestring >=0.11
, Cabal-syntax ^>=3.10 || ^>=3.12
, pandoc ^>=3.6.4
Expand Down
2 changes: 0 additions & 2 deletions src-control/Control/RefCount.hs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ releaseRef ref@Ref{refobj} = do
decrementRefCounter (getRefCounter refobj)

{-# COMPLETE DeRef #-}
#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
{-# INLINE DeRef #-}
#endif
-- | Get the object in a 'Ref'. Be careful with retaining the object for too
-- long, since the object must not be used after 'releaseRef' is called.
--
Expand Down
24 changes: 0 additions & 24 deletions src/Database/LSMTree/Internal/BloomFilterQuery1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,13 @@ type RunIx = Int
--
newtype RunIxKeyIx = MkRunIxKeyIx Word32
deriving stock Eq
#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
deriving newtype P.Prim
#else
instance P.Prim RunIxKeyIx where
sizeOfType# _ = 4#
alignmentOfType# _ = 4#

indexByteArray# ba i =
MkRunIxKeyIx (P.indexByteArray# ba i)
readByteArray# ba i s =
case P.readByteArray# ba i s of
(# s', w #) -> (# s', MkRunIxKeyIx w #)
writeByteArray# ba i (MkRunIxKeyIx w) s =
P.writeByteArray# ba i w s

indexOffAddr# ba i =
MkRunIxKeyIx (P.indexOffAddr# ba i)
readOffAddr# ba i s =
case P.readOffAddr# ba i s of
(# s', w #) -> (# s', MkRunIxKeyIx w #)
writeOffAddr# ba i (MkRunIxKeyIx w) s =
P.writeOffAddr# ba i w s
#endif

pattern RunIxKeyIx :: RunIx -> KeyIx -> RunIxKeyIx
pattern RunIxKeyIx r k <- (unpackRunIxKeyIx -> (r, k))
where
RunIxKeyIx r k = packRunIxKeyIx r k
#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
{-# INLINE RunIxKeyIx #-}
#endif
{-# COMPLETE RunIxKeyIx #-}

packRunIxKeyIx :: Int -> Int -> RunIxKeyIx
Expand Down
14 changes: 1 addition & 13 deletions src/Database/LSMTree/Internal/ByteString.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tryGetByteArray :: BS.ByteString -> Either String (ByteArray, Int)
tryGetByteArray (BS.Internal.BS (Foreign.ForeignPtr addr# contents) n) =
case contents of
Foreign.PlainPtr mba# ->
case mutableByteArrayContentsShim# mba# `eqAddr#` addr# of
case mutableByteArrayContents# mba# `eqAddr#` addr# of
0# -> Left "non-zero offset into ByteArray"
_ -> -- safe, ByteString's content is considered immutable
Right $ case unsafeFreezeByteArray# mba# realWorld# of
Expand All @@ -63,23 +63,11 @@ tryGetByteArray (BS.Internal.BS (Foreign.ForeignPtr addr# contents) n) =
Left ("unsupported MallocPtr (length " <> show n <> ")")
Foreign.PlainForeignPtr {} ->
Left ("unsupported PlainForeignPtr (length " <> show n <> ")")
#if __GLASGOW_HASKELL__ >= 902
Foreign.FinalPtr | n == 0 ->
-- We can also handle empty bytestrings ('BS.empty' uses 'FinalPtr').
Right (emptyByteArray, 0)
Foreign.FinalPtr ->
Left ("unsupported FinalPtr (length " <> show n <> ")")
#endif

-- | Copied from the @primitive@ package
mutableByteArrayContentsShim# :: MutableByteArray# s -> Addr#
{-# INLINE mutableByteArrayContentsShim# #-}
mutableByteArrayContentsShim# x =
#if __GLASGOW_HASKELL__ >= 902
mutableByteArrayContents# x
#else
byteArrayContents# (unsafeCoerce# x)
#endif

-- | Copy of 'SBS.shortByteString', but with bounds (unchecked).
--
Expand Down
5 changes: 0 additions & 5 deletions src/Database/LSMTree/Internal/IncomingRun.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}

#if !(MIN_VERSION_GLASGOW_HASKELL(9,0,0,0))
-- Fix for ghc 8.10.x with deriving newtype Prim
{-# LANGUAGE DataKinds #-}
#endif

module Database.LSMTree.Internal.IncomingRun (
IncomingRun (..)
, MergePolicyForLevel (..)
Expand Down
5 changes: 0 additions & 5 deletions src/Database/LSMTree/Internal/MergeSchedule.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_HADDOCK not-home #-}

#if !(MIN_VERSION_GLASGOW_HASKELL(9,0,0,0))
-- Fix for ghc 8.10.x with deriving newtype Prim
{-# LANGUAGE DataKinds #-}
#endif

-- TODO: establish that this implementation matches up with the ScheduledMerges
-- prototype. See lsm-tree#445.
module Database.LSMTree.Internal.MergeSchedule (
Expand Down
2 changes: 0 additions & 2 deletions src/Database/LSMTree/Internal/MergingRun.hs
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ pattern CreditsPair :: SpentCredits -> UnspentCredits -> Int
pattern CreditsPair sc uc <- (unpackCreditsPair -> (sc, uc))
where
CreditsPair sc uc = packCreditsPair sc uc
#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
{-# INLINE CreditsPair #-}
#endif
{-# COMPLETE CreditsPair #-}

{-# INLINE packCreditsPair #-}
Expand Down
4 changes: 0 additions & 4 deletions xxhash/src/XXH3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ import FFI

{-# INLINE withFP #-}
withFP :: ForeignPtr a -> (P.Ptr a -> IO b) -> IO b
#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
withFP = unsafeWithForeignPtr
#else
withFP = withForeignPtr
#endif

-------------------------------------------------------------------------------
-- OneShot
Expand Down