From bfb2f7c3eca63590232a33ded8958a211ba5b7da Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Tue, 3 Jan 2023 11:58:43 -0500 Subject: [PATCH] Remove support for GHC 8.0 --- .github/workflows/haskell-ci.yml | 5 ---- cabal.haskell-ci | 2 +- changelog.md | 4 ++++ src/Data/Text/Internal/ByteStringCompat.hs | 28 ---------------------- tests/Tests/Properties/LowLevel.hs | 3 --- text.cabal | 9 ++++--- 6 files changed, 9 insertions(+), 42 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 576842ad..c23ba1d3 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -68,11 +68,6 @@ jobs: compilerVersion: 8.2.2 setup-method: ghcup allow-failure: false - - compiler: ghc-8.0.2 - compilerKind: ghc - compilerVersion: 8.0.2 - setup-method: ghcup - allow-failure: false fail-fast: false steps: - name: apt diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 9d605ba8..f7425e79 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,4 +1,4 @@ -ghcup-jobs: >=8.0 +ghcup-jobs: >=8.2 docspec: True docspec-options: --timeout 2 haddock: >=8.6 diff --git a/changelog.md b/changelog.md index 4dc76498..b0fda4bd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +### Unreleased + +* Remove support for GHC 8.0. + ### 2.0.1 * Improve portability of C and C++ code. diff --git a/src/Data/Text/Internal/ByteStringCompat.hs b/src/Data/Text/Internal/ByteStringCompat.hs index 4f8b3949..c5f729b6 100644 --- a/src/Data/Text/Internal/ByteStringCompat.hs +++ b/src/Data/Text/Internal/ByteStringCompat.hs @@ -8,13 +8,7 @@ import Data.Word (Word8) import Foreign.ForeignPtr (ForeignPtr) #if !MIN_VERSION_bytestring(0,11,0) -#if MIN_VERSION_base(4,10,0) import GHC.ForeignPtr (plusForeignPtr) -#else -import GHC.ForeignPtr (ForeignPtr(ForeignPtr)) -import GHC.Types (Int (..)) -import GHC.Prim (plusAddr#) -#endif #endif mkBS :: ForeignPtr Word8 -> Int -> ByteString @@ -32,25 +26,3 @@ withBS (BS !sfp !slen) kont = kont sfp slen withBS (PS !sfp !soff !slen) kont = kont (plusForeignPtr sfp soff) slen #endif {-# INLINE withBS #-} - -#if !MIN_VERSION_bytestring(0,11,0) -#if !MIN_VERSION_base(4,10,0) --- |Advances the given address by the given offset in bytes. --- --- The new 'ForeignPtr' shares the finalizer of the original, --- equivalent from a finalization standpoint to just creating another --- reference to the original. That is, the finalizer will not be --- called before the new 'ForeignPtr' is unreachable, nor will it be --- called an additional time due to this call, and the finalizer will --- be called with the same address that it would have had this call --- not happened, *not* the new address. -plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b -plusForeignPtr (ForeignPtr addr guts) (I# offset) = ForeignPtr (plusAddr# addr offset) guts -{-# INLINE [0] plusForeignPtr #-} -{-# RULES -"ByteString plusForeignPtr/0" forall fp . - plusForeignPtr fp 0 = fp - #-} -#endif -#endif - diff --git a/tests/Tests/Properties/LowLevel.hs b/tests/Tests/Properties/LowLevel.hs index 92c4e209..c3b0a605 100644 --- a/tests/Tests/Properties/LowLevel.hs +++ b/tests/Tests/Properties/LowLevel.hs @@ -132,10 +132,7 @@ testLowLevel = [ (`hasNoTypes` [''Char, ''[]]) , (`doesNotUseAnyOf` ['T.pack, 'S.unstream, 'T.map, 'safe, 'S.streamList]) , (`doesNotUseAnyOf` ['GHC.unpackCString#, 'GHC.unpackCStringUtf8#]) -#if MIN_VERSION_base(4,10,0) - -- skip this test for GHC 8.0 , (`doesNotUseAnyOf` ['T.unpackCString#, 'T.unpackCStringAscii#]) -#endif ] 't_literal_foo) #endif diff --git a/text.cabal b/text.cabal index 90eca24b..d3176579 100644 --- a/text.cabal +++ b/text.cabal @@ -46,7 +46,6 @@ copyright: 2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper, 2021 Andrew Le category: Data, Text build-type: Simple tested-with: - GHC == 8.0.2 GHC == 8.2.2 GHC == 8.4.4 GHC == 8.6.5 @@ -117,7 +116,7 @@ library -- Certain version of GHC crash on Windows, when TemplateHaskell encounters C++. -- https://gitlab.haskell.org/ghc/ghc/-/issues/19417 - if flag(simdutf) && os(windows) && impl(ghc == 8.0.1 || >= 8.8 && < 8.10.5 || == 9.0.1) + if flag(simdutf) && os(windows) && impl(ghc >= 8.8 && < 8.10.5 || == 9.0.1) build-depends: base < 0 -- For GHC 8.2, 8.6.3 and 8.10.1 even TH + C crash Windows linker. @@ -187,7 +186,7 @@ library build-depends: array >= 0.3 && < 0.6, - base >= 4.9 && < 5, + base >= 4.10 && < 5, binary >= 0.5 && < 0.9, bytestring >= 0.10.4 && < 0.12, deepseq >= 1.1 && < 1.5, @@ -266,9 +265,9 @@ test-suite tests transformers, text - -- Plugin infrastructure does not work properly in 8.0.1 and 8.6.1, and + -- Plugin infrastructure does not work properly in 8.6.1, and -- ghc-9.2.1 library depends on parsec, which causes a circular dependency. - if impl(ghc >= 8.0.2 && < 8.6 || >= 8.6.2 && < 9.2 || >= 9.2.2) + if impl(ghc >= 8.2.1 && < 8.6 || >= 8.6.2 && < 9.2 || >= 9.2.2) build-depends: tasty-inspection-testing default-language: Haskell2010