Skip to content

Commit

Permalink
Fix #6377 Drop support of Cabal < 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Feb 12, 2024
1 parent 59d23ac commit 9db5817
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 210 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Major changes:

Behavior changes:

* Stack uses the version of the Cabal package that comes with the specified
version of GHC. Stack no longer supports such Cabal versions before 2.2, which
came with versions of GHC before 8.4.

Other enhancements:

* In YAML configuration files, the `msys-environment` key is introduced to
Expand Down
19 changes: 11 additions & 8 deletions src/Stack/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,17 @@ instance Pretty CabalVersionPrettyException where
"[S-5973]"
<> line
<> fillSep
[ flow "Stack does not support Cabal versions before 1.24, but \
\version"
[ flow "Stack builds with the version of the Cabal package that comes \
\with the specified version of GHC. However, Stack no longer \
\supports such Cabal versions before 2.2. Version"
, fromString $ versionString cabalVer
, flow "was found. To fix this, consider updating the snapshot to"
, style Shell "lts-7.0"
, flow "or later or to"
, style Shell "nightly-2016-05-26"
, flow "or later."
, flow "was found. To fix this, either use Stack 2.15.1 or earlier or \
\use a snapshot that specifies a version of GHC that is 8.4 or \
\later. Stackage LTS Haskell 12.0"
, parens (style Shell "lts-12.0")
, flow "or later or Nightly 2018-03-13"
, parens (style Shell "nightly-2018-03-13")
, flow "or later specify such GHC versions."
]

instance Exception CabalVersionPrettyException
Expand Down Expand Up @@ -221,7 +224,7 @@ justLocals =
checkCabalVersion :: HasEnvConfig env => RIO env ()
checkCabalVersion = do
cabalVer <- view cabalVersionL
when (cabalVer < mkVersion [1, 24]) $
when (cabalVer < mkVersion [2, 2]) $
prettyThrowM $ CabalVersionNotSupported cabalVer

-- | See https://github.com/commercialhaskell/stack/issues/1198.
Expand Down
7 changes: 0 additions & 7 deletions src/Stack/Build/ExecuteEnv.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module Stack.Build.ExecuteEnv
, withSingleContext
, ExcludeTHLoading (..)
, KeepOutputOpen (..)
, ExecutableBuildStatus (..)
, OutputType (..)
) where

Expand Down Expand Up @@ -113,12 +112,6 @@ import System.Environment ( lookupEnv )
import System.FileLock
( SharedExclusive (..), withFileLock, withTryFileLock )

-- | Has an executable been built or not?
data ExecutableBuildStatus
= ExecutableBuilt
| ExecutableNotBuilt
deriving (Eq, Ord, Show)

data ExecuteEnv = ExecuteEnv
{ installLock :: !(MVar ())
, buildOpts :: !BuildOpts
Expand Down
Loading

0 comments on commit 9db5817

Please sign in to comment.