Skip to content

Commit bc8bdda

Browse files
authored
Merge branch 'master' into ghc-9.4.5
2 parents 6439948 + 6919f12 commit bc8bdda

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+247
-1537
lines changed

package.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ homepage: http://haskellstack.org
2626
custom-setup:
2727
dependencies:
2828
- base >= 4.14.3.0 && < 5
29-
- Cabal < 3.10
29+
- Cabal < 3.12
3030
- filepath
3131
extra-source-files:
3232
# note: leaving out 'package.yaml' because it causes confusion with hackage metadata revisions
@@ -60,13 +60,15 @@ dependencies:
6060
- base >= 4.14.3.0 && < 5
6161
- Cabal >= 3.8.1.0
6262
- aeson >= 2.0.3.0
63+
- aeson-warning-parser
6364
- ansi-terminal >= 1.0
6465
- array
6566
- async
6667
- attoparsec
6768
- base64-bytestring
6869
- bytestring
6970
- casa-client
71+
- companion
7072
- conduit
7173
- conduit-extra
7274
- containers

src/Stack/Build/ConstructPlan.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module Stack.Build.ConstructPlan
88
( constructPlan
99
) where
1010

11-
import Control.Monad.RWS.Strict hiding ( (<>) )
11+
import Control.Monad.RWS.Strict
12+
( RWST, get, modify, modify', pass, put, runRWST, tell )
1213
import qualified Data.List as L
1314
import qualified Data.Map.Merge.Strict as Map
1415
import qualified Data.Map.Strict as Map

src/Stack/Build/Execute.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module Stack.Build.Execute
1717
, KeepOutputOpen (..)
1818
) where
1919

20+
import Control.Concurrent.Companion ( Companion, withCompanion )
2021
import Control.Concurrent.Execute
2122
( Action (..), ActionContext (..), ActionId (..)
2223
, ActionType (..)
@@ -66,7 +67,6 @@ import Distribution.Types.UnqualComponentName
6667
( mkUnqualComponentName )
6768
import Distribution.Verbosity ( showForCabal )
6869
import Distribution.Version ( mkVersion )
69-
import Pantry.Internal.Companion ( Companion, withCompanion )
7070
import Path
7171
( PathException, (</>), addExtension, filename
7272
, isProperPrefixOf, parent, parseRelDir, parseRelFile

src/Stack/Config.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ module Stack.Config
3232
) where
3333

3434
import Control.Monad.Extra ( firstJustM )
35+
import Data.Aeson.Types ( Value )
36+
import Data.Aeson.WarningParser
37+
( WithJSONWarnings (..), logJSONWarnings )
3538
import Data.Array.IArray ( (!), (//) )
3639
import qualified Data.ByteString as S
3740
import Data.ByteString.Builder ( byteString )
@@ -51,8 +54,6 @@ import GHC.Conc ( getNumProcessors )
5154
import Network.HTTP.StackClient
5255
( httpJSON, parseUrlThrow, getResponseBody )
5356
import Options.Applicative ( Parser, help, long, metavar, strOption )
54-
import Pantry.Internal.AesonExtended
55-
( Value, WithJSONWarnings (..), logJSONWarnings )
5657
import Path
5758
( PathException (..), (</>), parent, parseAbsDir
5859
, parseAbsFile, parseRelDir, stripProperPrefix

src/Stack/Docker.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module Stack.Docker
1818
) where
1919

2020
import qualified Crypto.Hash as Hash ( Digest, MD5, hash )
21+
import Data.Aeson ( eitherDecode )
22+
import Data.Aeson.Types ( FromJSON (..), (.!=) )
23+
import Data.Aeson.WarningParser ( (.:), (.:?) )
2124
import qualified Data.ByteString.Char8 as BS
2225
import qualified Data.ByteString.Lazy as BL
2326
import qualified Data.ByteString.Lazy.Char8 as LBS
@@ -32,8 +35,6 @@ import qualified Data.Text.Encoding as T
3235
import Data.Time ( UTCTime )
3336
import qualified Data.Version ( parseVersion )
3437
import Distribution.Version ( mkVersion, mkVersion' )
35-
import Pantry.Internal.AesonExtended
36-
( FromJSON (..), (.:), (.:?), (.!=), eitherDecode )
3738
import Path
3839
( (</>), dirname, filename, parent, parseAbsDir
3940
, splitExtension

src/Stack/Lock.hs

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ module Stack.Lock
88
, Locked (..)
99
) where
1010

11+
import Data.Aeson.Types ( FromJSON (..), ToJSON, Value, (.=), object )
12+
import Data.Aeson.WarningParser
13+
( WithJSONWarnings (..), (..:), jsonSubWarnings
14+
, jsonSubWarningsT, logJSONWarnings, withObjectWarnings
15+
)
1116
import Data.ByteString.Builder ( byteString )
1217
import qualified Data.List.NonEmpty as NE
1318
import qualified Data.Map as Map
1419
import qualified Data.Text as T
1520
import qualified Data.Yaml as Yaml
16-
import Pantry.Internal.AesonExtended
17-
( FromJSON (..), ToJSON, Value, WithJSONWarnings (..), (.=)
18-
, (..:), jsonSubWarnings, jsonSubWarningsT, logJSONWarnings
19-
, object
20-
, withObjectWarnings
21-
)
2221
import Path ( parent )
2322
import Path.Extended ( addExtension )
2423
import Path.IO ( doesFileExist )

src/Stack/Setup.hs

+7-6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ import Conduit
2929
import Control.Applicative ( empty )
3030
import Crypto.Hash ( SHA1 (..), SHA256 (..) )
3131
import qualified Data.Aeson.KeyMap as KeyMap
32+
import Data.Aeson.Types ( Value (..) )
33+
import Data.Aeson.WarningParser
34+
( WithJSONWarnings (..), logJSONWarnings )
3235
import qualified Data.Attoparsec.Text as P
3336
import qualified Data.ByteString as S
3437
import qualified Data.ByteString.Lazy as LBS
@@ -61,8 +64,6 @@ import Network.HTTP.StackClient
6164
, verifiedDownloadWithProgress, withResponse
6265
)
6366
import Network.HTTP.Simple ( getResponseHeader )
64-
import Pantry.Internal.AesonExtended
65-
( Value (..), WithJSONWarnings (..), logJSONWarnings )
6667
import Path
6768
( (</>), addExtension, dirname, filename, parent, parseAbsDir
6869
, parseAbsFile, parseRelDir, parseRelFile, toFilePath
@@ -921,9 +922,9 @@ warnUnsupportedCompiler ghcVersion =
921922
, style Url "https://github.com/commercialhaskell/stack/issues/648" <> "."
922923
]
923924
pure True
924-
| ghcVersion >= mkVersion [9, 5] -> do
925+
| ghcVersion >= mkVersion [9, 7] -> do
925926
prettyWarnL
926-
[ flow "Stack has not been tested with GHC versions above 9.6, and \
927+
[ flow "Stack has not been tested with GHC versions 9.8 and above, and \
927928
\using"
928929
, fromString (versionString ghcVersion) <> ","
929930
, flow "this may fail."
@@ -955,9 +956,9 @@ warnUnsupportedCompilerCabal cp didWarn = do
955956
\resolver. Acceptable resolvers: lts-3.0/nightly-2015-05-05 \
956957
\or later."
957958
]
958-
| cabalVersion >= mkVersion [3, 9] ->
959+
| cabalVersion >= mkVersion [3, 11] ->
959960
prettyWarnL
960-
[ flow "Stack has not been tested with Cabal versions above 3.10, \
961+
[ flow "Stack has not been tested with Cabal versions 3.12 and above, \
961962
\but version"
962963
, fromString (versionString cabalVersion)
963964
, flow "was found, this may fail."

src/Stack/Storage/Project.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Database.Persist.TH
3030
( mkMigrate, mkPersist, persistLowerCase, share
3131
, sqlSettings
3232
)
33-
import qualified Pantry.Internal as SQLite
33+
import Pantry.SQLite ( initStorage, withStorage_ )
3434
import Stack.Prelude
3535
import Stack.Storage.Util
3636
( handleMigrationException, updateList, updateSet )
@@ -90,7 +90,7 @@ initProjectStorage ::
9090
-> (ProjectStorage -> RIO env a)
9191
-> RIO env a
9292
initProjectStorage fp f = handleMigrationException $
93-
SQLite.initStorage "Stack" migrateAll fp $ f . ProjectStorage
93+
initStorage "Stack" migrateAll fp $ f . ProjectStorage
9494

9595
-- | Run an action in a database transaction
9696
withProjectStorage ::
@@ -99,7 +99,7 @@ withProjectStorage ::
9999
-> RIO env a
100100
withProjectStorage inner = do
101101
storage <- view (buildConfigL . to bcProjectStorage . to unProjectStorage)
102-
SQLite.withStorage_ storage inner
102+
withStorage_ storage inner
103103

104104
-- | Key used to retrieve configuration or flag cache
105105
type ConfigCacheKey = Unique ConfigCacheParent

src/Stack/Storage/User.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Database.Persist.TH
3939
)
4040
import Distribution.Text ( simpleParse, display )
4141
import Foreign.C.Types ( CTime (..) )
42-
import qualified Pantry.Internal as SQLite
42+
import Pantry.SQLite ( initStorage, withStorage_ )
4343
import Path ( (</>), mkRelFile, parseRelFile )
4444
import Path.IO ( resolveFile', resolveDir' )
4545
import qualified RIO.FilePath as FP
@@ -159,7 +159,7 @@ initUserStorage ::
159159
-> (UserStorage -> RIO env a)
160160
-> RIO env a
161161
initUserStorage fp f = handleMigrationException $
162-
SQLite.initStorage "Stack" migrateAll fp $ f . UserStorage
162+
initStorage "Stack" migrateAll fp $ f . UserStorage
163163

164164
-- | Run an action in a database transaction
165165
withUserStorage ::
@@ -168,7 +168,7 @@ withUserStorage ::
168168
-> RIO env a
169169
withUserStorage inner = do
170170
storage <- view (configL . to configUserStorage . to unUserStorage)
171-
SQLite.withStorage_ storage inner
171+
withStorage_ storage inner
172172

173173
-- | Key used to retrieve the precompiled cache
174174
type PrecompiledCacheKey = Unique PrecompiledCacheParent

src/Stack/Types/AllowNewerDeps.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module Stack.Types.AllowNewerDeps
44
( AllowNewerDeps (..)
55
) where
66

7+
import Data.Aeson.Types ( FromJSON (..) )
78
import qualified Distribution.PackageDescription as C
89
import Generics.Deriving.Monoid ( mappenddefault, memptydefault )
9-
import Pantry.Internal.AesonExtended ( FromJSON (..) )
1010
import Stack.Prelude
1111

1212
newtype AllowNewerDeps

src/Stack/Types/ApplyGhcOptions.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Stack.Types.ApplyGhcOptions
55
( ApplyGhcOptions (..)
66
) where
77

8-
import Pantry.Internal.AesonExtended ( FromJSON (..), withText )
8+
import Data.Aeson.Types ( FromJSON (..), withText )
99
import Stack.Prelude
1010

1111
-- | Which packages do ghc-options on the command line apply to?

src/Stack/Types/ApplyProgOptions.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Stack.Types.ApplyProgOptions
55
( ApplyProgOptions (..)
66
) where
77

8-
import Pantry.Internal.AesonExtended ( FromJSON (..), withText )
8+
import Data.Aeson.Types ( FromJSON (..), withText )
99
import Stack.Prelude
1010

1111
-- | Which packages do all and any --PROG-option options on the command line

src/Stack/Types/BuildOpts.hs

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ module Stack.Types.BuildOpts
3636
, toFirstCabalVerbosity
3737
) where
3838

39+
import Data.Aeson.Types ( FromJSON (..), withText )
40+
import Data.Aeson.WarningParser
41+
( WithJSONWarnings, (..:?), (..!=), jsonSubWarnings
42+
, withObjectWarnings
43+
)
3944
import qualified Data.Map.Strict as Map
4045
import qualified Data.Text as T
4146
import Distribution.Parsec ( Parsec (..), simpleParsec )
4247
import Distribution.Verbosity ( Verbosity, normal, verbose )
4348
import Generics.Deriving.Monoid ( mappenddefault, memptydefault )
44-
import Pantry.Internal.AesonExtended
45-
( FromJSON (..), WithJSONWarnings, (..:?), (..!=)
46-
, jsonSubWarnings, withObjectWarnings, withText
47-
)
4849
import Stack.Prelude
4950

5051
-- | Build options that is interpreted by the build command. This is built up

src/Stack/Types/CabalConfigKey.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module Stack.Types.CabalConfigKey
66
, parseCabalConfigKey
77
) where
88

9-
import qualified Data.Text as T
10-
import Pantry.Internal.AesonExtended
9+
import Data.Aeson.Types
1110
( FromJSON (..), FromJSONKey (..), FromJSONKeyFunction (..)
1211
, withText
1312
)
13+
import qualified Data.Text as T
1414
import Stack.Prelude
1515

1616
-- | Which packages do configure opts apply to?

src/Stack/Types/Casa.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ module Stack.Types.Casa
88
( CasaOptsMonoid (..)
99
) where
1010

11+
import Data.Aeson.Types ( FromJSON (..) )
12+
import Data.Aeson.WarningParser
13+
( WithJSONWarnings, (..:?), withObjectWarnings )
1114
import Casa.Client ( CasaRepoPrefix )
1215
import Generics.Deriving.Monoid ( mappenddefault, memptydefault )
13-
import Pantry.Internal.AesonExtended
14-
( FromJSON (..), WithJSONWarnings, (..:?), withObjectWarnings
15-
)
1616
import Stack.Prelude
1717

1818
-- | An uninterpreted representation of Casa configuration options.

src/Stack/Types/ColorWhen.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ module Stack.Types.ColorWhen
66
, readColorWhen
77
) where
88

9+
import Data.Aeson.Types ( FromJSON (..) )
910
import Options.Applicative ( ReadM )
1011
import qualified Options.Applicative.Types as OA
11-
import Pantry.Internal.AesonExtended ( FromJSON (..) )
1212
import Stack.Prelude
1313

1414
data ColorWhen

src/Stack/Types/CompilerBuild.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ module Stack.Types.CompilerBuild
77
, parseCompilerBuild
88
) where
99

10-
import Stack.Prelude
11-
import Pantry.Internal.AesonExtended ( FromJSON, parseJSON, withText )
10+
import Data.Aeson.Types ( FromJSON, parseJSON, withText )
1211
import Data.Text as T
12+
import Stack.Prelude
1313

1414
data CompilerBuild
1515
= CompilerBuildStandard

src/Stack/Types/ConfigMonoid.hs

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ module Stack.Types.ConfigMonoid
1212
, configMonoidSystemGHCName
1313
) where
1414

15+
import Data.Aeson.Types ( Object, Value )
16+
import Data.Aeson.WarningParser
17+
( WarningParser, WithJSONWarnings, (..:?), (..!=)
18+
, jsonSubWarnings, jsonSubWarningsT, jsonSubWarningsTT
19+
, withObjectWarnings
20+
)
1521
import Casa.Client ( CasaRepoPrefix )
1622
import Control.Monad.Writer ( tell )
1723
import Data.Coerce ( coerce )
@@ -22,11 +28,6 @@ import Data.Monoid.Map ( MonoidMap (..) )
2228
import qualified Data.Yaml as Yaml
2329
import Distribution.Version ( anyVersion )
2430
import Generics.Deriving.Monoid ( mappenddefault, memptydefault )
25-
import Pantry.Internal.AesonExtended
26-
( Object, Value, WarningParser, WithJSONWarnings, (..:?)
27-
, (..!=), jsonSubWarnings, jsonSubWarningsT
28-
, jsonSubWarningsTT, withObjectWarnings
29-
)
3031
import Stack.Prelude
3132
import Stack.Types.AllowNewerDeps ( AllowNewerDeps )
3233
import Stack.Types.ApplyGhcOptions ( ApplyGhcOptions (..) )

src/Stack/Types/Curator.hs

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ module Stack.Types.Curator
55
( Curator (..)
66
) where
77

8+
import Data.Aeson.Types ( FromJSON (..), ToJSON (..), (.=), object )
9+
import Data.Aeson.WarningParser
10+
( WithJSONWarnings (..), (..:?), (..!=), withObjectWarnings )
811
import qualified Data.Set as Set
9-
import Pantry.Internal.AesonExtended
10-
( FromJSON (..), ToJSON (..), WithJSONWarnings (..), (.=)
11-
, (..:?), (..!=), object, withObjectWarnings
12-
)
1312
import Stack.Prelude
1413

1514
-- | Extra configuration intended exclusively for usage by the curator tool. In

src/Stack/Types/Docker.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ module Stack.Types.Docker
4242
, reExecArgName
4343
) where
4444

45+
import Data.Aeson.Types ( FromJSON (..), withText )
46+
import Data.Aeson.WarningParser
47+
( WithJSONWarnings, (..:), (..:?), (..!=), withObjectWarnings
48+
)
4549
import Data.List ( intercalate )
4650
import qualified Data.Text as T
4751
import Distribution.System ( Arch (..), OS (..), Platform (..) )
4852
import Distribution.Text ( display, simpleParse )
4953
import Distribution.Version ( anyVersion )
5054
import Generics.Deriving.Monoid ( mappenddefault, memptydefault )
51-
import Pantry.Internal.AesonExtended
52-
( FromJSON (..), WithJSONWarnings, (..:), (..:?), (..!=)
53-
, withObjectWarnings, withText
54-
)
5555
import Path ( parseAbsFile )
5656
import Stack.Constants ( stackProgName )
5757
import Stack.Prelude hiding ( Display (..) )

src/Stack/Types/DownloadInfo.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ module Stack.Types.DownloadInfo
66
, parseDownloadInfoFromObject
77
) where
88

9-
import Pantry.Internal.AesonExtended
10-
( FromJSON (..), Object, WarningParser
11-
, WithJSONWarnings (..), (..:), (..:?), withObjectWarnings
9+
import Data.Aeson.Types ( FromJSON (..), Object )
10+
import Data.Aeson.WarningParser
11+
( WarningParser, WithJSONWarnings (..), (..:), (..:?)
12+
, withObjectWarnings
1213
)
1314
import Stack.Prelude
1415

src/Stack/Types/DumpLogs.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ module Stack.Types.DumpLogs
66
( DumpLogs (..)
77
) where
88

9-
import Pantry.Internal.AesonExtended
10-
( FromJSON (..), Value (..), withText )
9+
import Data.Aeson.Types ( FromJSON (..), Value (..), withText )
1110
import Stack.Prelude
1211

1312
-- | Which build log files to dump

0 commit comments

Comments
 (0)