Skip to content

Commit 84138b6

Browse files
authored
Merge pull request #5953 from commercialhaskell/fix5952
Fix #5952 Bump Stack to `pantry-0.8.0`
2 parents ab3c9ce + 2c3d89f commit 84138b6

File tree

12 files changed

+198
-186
lines changed

12 files changed

+198
-186
lines changed

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ dependencies:
9696
- network-uri
9797
- open-browser
9898
- optparse-applicative >= 0.17.0.0
99-
- pantry >= 0.7.1
99+
- pantry >= 0.8.0
100100
- path
101101
- path-io
102102
# In order for Cabal (the tool) to build Stack, it needs to be told of the

src/Stack/Ghci.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ loadGhciPkgDesc buildOptsCLI name cabalfp target = do
674674
-- wouldn't have figured out the cabalfp already. In the future:
675675
-- retain that GenericPackageDescription in the relevant data
676676
-- structures to avoid reparsing.
677-
(gpdio, _name, _cabalfp) <- loadCabalFilePath (parent cabalfp)
677+
(gpdio, _name, _cabalfp) <-
678+
loadCabalFilePath (Just stackProgName') (parent cabalfp)
678679
gpkgdesc <- liftIO $ gpdio YesPrintWarnings
679680

680681
-- Source the package's *.buildinfo file created by configure if any. See

src/Stack/Hoogle.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ hoogleCmd (args,setup,rebuild,startServer) =
118118
restrictMinHoogleVersion muted (packageLocationIdent pli)
119119
plm@(PLMutable _) -> do
120120
T.pack . packageIdentifierString . package . packageDescription
121-
<$> loadCabalFile plm
121+
<$> loadCabalFile (Just stackProgName') plm
122122
Nothing -> do
123123
-- not muted because this should happen only once
124124
logWarn "No hoogle version was found, trying to install the latest version"

src/Stack/Init.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ cabalPackagesCheck cabaldirs = do
557557
logInfo $ formatGroup relpaths
558558

559559
packages <- for cabaldirs $ \dir -> do
560-
(gpdio, _name, cabalfp) <- loadCabalFilePath dir
560+
(gpdio, _name, cabalfp) <- loadCabalFilePath (Just stackProgName') dir
561561
gpd <- liftIO $ gpdio YesPrintWarnings
562562
pure (cabalfp, gpd)
563563

src/Stack/Prelude.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Stack.Prelude
1616
, promptPassword
1717
, promptBool
1818
, stackProgName
19+
, stackProgName'
1920
, FirstTrue (..)
2021
, fromFirstTrue
2122
, defaultFirstTrue
@@ -246,6 +247,9 @@ promptBool txt = liftIO $ do
246247
stackProgName :: String
247248
stackProgName = "stack"
248249

250+
stackProgName' :: Text
251+
stackProgName' = T.pack stackProgName
252+
249253
-- | Like @First Bool@, but the default is @True@.
250254
newtype FirstTrue = FirstTrue { getFirstTrue :: Maybe Bool }
251255
deriving (Show, Eq, Ord)

src/Stack/SDist.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ getCabalLbs :: HasEnvConfig env
199199
-> SourceMap
200200
-> RIO env (PackageIdentifier, L.ByteString)
201201
getCabalLbs pvpBounds mrev cabalfp sourceMap = do
202-
(gpdio, _name, cabalfp') <- loadCabalFilePath (parent cabalfp)
202+
(gpdio, _name, cabalfp') <-
203+
loadCabalFilePath (Just stackProgName') (parent cabalfp)
203204
gpd <- liftIO $ gpdio NoPrintWarnings
204205
unless (cabalfp == cabalfp') $
205206
throwIO $ CabalFilePathsInconsistentBug cabalfp cabalfp'
@@ -334,7 +335,7 @@ gtraverseT f =
334335
readLocalPackage :: HasEnvConfig env => Path Abs Dir -> RIO env LocalPackage
335336
readLocalPackage pkgDir = do
336337
config <- getDefaultPackageConfig
337-
(gpdio, _, cabalfp) <- loadCabalFilePath pkgDir
338+
(gpdio, _, cabalfp) <- loadCabalFilePath (Just stackProgName') pkgDir
338339
gpd <- liftIO $ gpdio YesPrintWarnings
339340
let package = resolvePackage config gpd
340341
pure LocalPackage
@@ -441,7 +442,7 @@ checkPackageInExtractedTarball
441442
=> Path Abs Dir -- ^ Absolute path to tarball
442443
-> RIO env ()
443444
checkPackageInExtractedTarball pkgDir = do
444-
(gpdio, name, _cabalfp) <- loadCabalFilePath pkgDir
445+
(gpdio, name, _cabalfp) <- loadCabalFilePath (Just stackProgName') pkgDir
445446
gpd <- liftIO $ gpdio YesPrintWarnings
446447
config <- getDefaultPackageConfig
447448
let PackageDescriptionPair pkgDesc _ = resolvePackageDescription config gpd

0 commit comments

Comments
 (0)