Skip to content

Commit 6103fc5

Browse files
authored
Merge pull request #6458 from commercialhaskell/consistency
Various renaming for consistency
2 parents 4306bf7 + 5329601 commit 6103fc5

26 files changed

+136
-134
lines changed

src/Stack/Build/ConstructPlan.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,11 @@ addFinal lp package isAllInOne buildHaddocks = do
447447
True -- local
448448
Mutable
449449
package
450-
, buildHaddock = buildHaddocks
451-
, present = present
450+
, buildHaddocks
451+
, present
452452
, taskType = TTLocalMutable lp
453453
, allInOne = isAllInOne
454-
, cachePkgSrc = CacheSrcLocal (toFilePath (parent lp.cabalFile))
454+
, cachePkgSrc = CacheSrcLocal (toFilePath (parent lp.cabalFP))
455455
, buildTypeConfig = packageBuildTypeConfig package
456456
}
457457
tell mempty { wFinals = Map.singleton package.name res }
@@ -632,7 +632,7 @@ installPackage name ps minstalled = do
632632
<> "."
633633
package <- ctx.loadPackage
634634
pkgLoc cp.flags cp.ghcOptions cp.cabalConfigOpts
635-
resolveDepsAndInstall True cp.haddocks ps package minstalled
635+
resolveDepsAndInstall True cp.buildHaddocks ps package minstalled
636636
PSFilePath lp -> do
637637
case lp.testBench of
638638
Nothing -> do
@@ -760,8 +760,8 @@ installPackageGivenDeps isAllInOne buildHaddocks ps package minstalled
760760
(psLocal ps)
761761
mutable
762762
package
763-
, buildHaddock = buildHaddocks
764-
, present = present
763+
, buildHaddocks
764+
, present
765765
, taskType =
766766
case ps of
767767
PSFilePath lp ->

src/Stack/Build/Execute.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ displayTask task = fillSep $
186186
<> ","
187187
, "source="
188188
<> ( case task.taskType of
189-
TTLocalMutable lp -> pretty $ parent lp.cabalFile
189+
TTLocalMutable lp -> pretty $ parent lp.cabalFP
190190
TTRemotePackage _ _ pl -> fromString $ T.unpack $ textDisplay pl
191191
)
192192
<> if Set.null missing
@@ -419,7 +419,7 @@ executePlan' installedMap0 targets plan ee = do
419419
generateHpcMarkupIndex
420420
unless (null errs) $
421421
prettyThrowM $ ExecutionFailure errs
422-
when buildOpts.haddock $ do
422+
when buildOpts.buildHaddocks $ do
423423
if buildOpts.haddockForHackage
424424
then
425425
generateLocalHaddockForHackageArchives ee.locals

src/Stack/Build/ExecuteEnv.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,10 @@ withSingleContext
577577
allDeps
578578
msuffix
579579
inner0
580-
= withPackage $ \package cabalfp pkgDir ->
580+
= withPackage $ \package cabalFP pkgDir ->
581581
withOutputType pkgDir package $ \outputType ->
582582
withCabal package pkgDir outputType $ \cabal ->
583-
inner0 package cabalfp pkgDir cabal announce outputType
583+
inner0 package cabalFP pkgDir cabal announce outputType
584584
where
585585
pkgId = taskTypePackageIdentifier taskType
586586
announce = announceTask ee taskType
@@ -610,9 +610,9 @@ withSingleContext
610610
withPackage inner =
611611
case taskType of
612612
TTLocalMutable lp -> do
613-
let root = parent lp.cabalFile
613+
let root = parent lp.cabalFP
614614
withLockedDistDir prettyAnnounce root $
615-
inner lp.package lp.cabalFile root
615+
inner lp.package lp.cabalFP root
616616
TTRemotePackage _ package pkgloc -> do
617617
suffix <-
618618
parseRelDir $ packageIdentifierString $ packageIdentifier package
@@ -635,8 +635,8 @@ withSingleContext
635635

636636
let name = pkgName pkgId
637637
cabalfpRel <- parseRelFile $ packageNameString name ++ ".cabal"
638-
let cabalfp = dir </> cabalfpRel
639-
inner package cabalfp dir
638+
let cabalFP = dir </> cabalfpRel
639+
inner package cabalFP dir
640640

641641
withOutputType pkgDir package inner
642642
-- Not in interleaved mode. When building a single wanted package, dump

src/Stack/Build/ExecutePackage.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ getConfigCache ee task installedMap enableTest enableBench = do
196196
TTLocalMutable lp ->
197197
Set.map (encodeUtf8 . renderComponent) lp.components
198198
TTRemotePackage{} -> Set.empty
199-
, haddock = task.buildHaddock
199+
, haddock = task.buildHaddocks
200200
, pkgSrc = task.cachePkgSrc
201201
, pathEnvVar = ee.pathEnvVar
202202
}
@@ -213,9 +213,9 @@ ensureConfig :: HasEnvConfig env
213213
-> Path Abs File -- ^ Cabal file
214214
-> Task
215215
-> RIO env Bool
216-
ensureConfig newConfigCache pkgDir buildOpts announce cabal cabalfp task = do
216+
ensureConfig newConfigCache pkgDir buildOpts announce cabal cabalFP task = do
217217
newCabalMod <-
218-
liftIO $ modificationTime <$> getFileStatus (toFilePath cabalfp)
218+
liftIO $ modificationTime <$> getFileStatus (toFilePath cabalFP)
219219
setupConfigfp <- setupConfigFromDir pkgDir
220220
let getNewSetupConfigMod =
221221
liftIO $ either (const Nothing) (Just . modificationTime) <$>
@@ -381,7 +381,7 @@ singleBuild
381381
pkgId = taskProvides task
382382
PackageIdentifier pname _ = pkgId
383383
doHaddock curator package =
384-
task.buildHaddock
384+
task.buildHaddocks
385385
&& not isFinalBuild
386386
-- Works around haddock failing on bytestring-builder since it has no
387387
-- modules when bytestring is new enough.
@@ -417,7 +417,7 @@ singleBuild
417417

418418
realConfigAndBuild cache mcurator allDepsMap =
419419
withSingleContext ac ee task.taskType allDepsMap Nothing $
420-
\package cabalfp pkgDir cabal0 announce _outputType -> do
420+
\package cabalFP pkgDir cabal0 announce _outputType -> do
421421
let cabal = cabal0 CloseOnException
422422
executableBuildStatuses <- getExecutableBuildStatuses package pkgDir
423423
when ( not (cabalIsSatisfied executableBuildStatuses)
@@ -440,7 +440,7 @@ singleBuild
440440
)
441441
)
442442
cabal
443-
cabalfp
443+
cabalFP
444444
task
445445
let installedMapHasThisPkg :: Bool
446446
installedMapHasThisPkg =
@@ -506,7 +506,7 @@ singleBuild
506506
TTLocalMutable lp -> do
507507
warnings <- checkForUnlistedFiles task.taskType pkgDir
508508
-- TODO: Perhaps only emit these warnings for non extra-dep?
509-
pure (Just (lp.cabalFile, warnings))
509+
pure (Just (lp.cabalFP, warnings))
510510
_ -> pure Nothing
511511
-- NOTE: once
512512
-- https://github.com/commercialhaskell/stack/issues/2649
@@ -522,11 +522,11 @@ singleBuild
522522
(style Good . fromString . C.display)
523523
modules
524524
)
525-
forM_ mlocalWarnings $ \(cabalfp, warnings) ->
525+
forM_ mlocalWarnings $ \(cabalFP, warnings) ->
526526
unless (null warnings) $ prettyWarn $
527527
flow "The following modules should be added to \
528528
\exposed-modules or other-modules in" <+>
529-
pretty cabalfp
529+
pretty cabalFP
530530
<> ":"
531531
<> line
532532
<> indent 4 ( mconcat
@@ -904,7 +904,7 @@ checkForUnlistedFiles (TTLocalMutable lp) pkgDir = do
904904
(addBuildCache,warnings) <-
905905
addUnlistedToBuildCache
906906
lp.package
907-
lp.cabalFile
907+
lp.cabalFP
908908
lp.components
909909
caches
910910
forM_ (Map.toList addBuildCache) $ \(component, newToCache) -> do

src/Stack/Build/Haddock.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ shouldHaddockPackage ::
110110
-> Bool
111111
shouldHaddockPackage bopts wanted name =
112112
if Set.member name wanted
113-
then bopts.haddock
113+
then bopts.buildHaddocks
114114
else shouldHaddockDeps bopts
115115

116116
-- | Determine whether to build haddocks for dependencies.
117117
shouldHaddockDeps :: BuildOpts -> Bool
118-
shouldHaddockDeps bopts = fromMaybe bopts.haddock bopts.haddockDeps
118+
shouldHaddockDeps bopts = fromMaybe bopts.buildHaddocks bopts.haddockDeps
119119

120120
-- | Generate Haddock index and contents for local packages.
121121
generateLocalHaddockIndex ::
@@ -341,7 +341,7 @@ generateLocalHaddockForHackageArchives =
341341
( \lp ->
342342
let pkg = lp.package
343343
pkgId = PackageIdentifier pkg.name pkg.version
344-
pkgDir = parent lp.cabalFile
344+
pkgDir = parent lp.cabalFP
345345
in generateLocalHaddockForHackageArchive pkgDir pkgId
346346
)
347347

src/Stack/Build/Source.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ loadSourceMap targets boptsCli sma = do
125125
ghcOptions ++ common.ghcOptions
126126
, cabalConfigOpts =
127127
cabalConfigOpts ++ common.cabalConfigOpts
128-
, haddocks =
128+
, buildHaddocks =
129129
if isTarget
130-
then bopts.haddock
130+
then bopts.buildHaddocks
131131
else shouldHaddockDeps bopts
132132
}
133133
packageCliFlags = Map.fromList $
134134
mapMaybe maybeProjectFlags $
135135
Map.toList boptsCli.flags
136136
maybeProjectFlags (ACFByName name, fs) = Just (name, fs)
137137
maybeProjectFlags _ = Nothing
138-
globalPkgs = pruneGlobals sma.global (Map.keysSet deps)
138+
globalPkgs = pruneGlobals sma.globals (Map.keysSet deps)
139139
logDebug "Checking flags"
140140
checkFlagsUsedThrowing packageCliFlags FSCommandLine project deps
141141
logDebug "SourceMap constructed"
@@ -200,7 +200,7 @@ depPackageHashableContent dp =
200200
flags = map flagToBs $ Map.toList dp.depCommon.flags
201201
ghcOptions = map display dp.depCommon.ghcOptions
202202
cabalConfigOpts = map display dp.depCommon.cabalConfigOpts
203-
haddocks = if dp.depCommon.haddocks then "haddocks" else ""
203+
haddocks = if dp.depCommon.buildHaddocks then "haddocks" else ""
204204
hash = immutableLocSha pli
205205
pure
206206
$ hash
@@ -409,11 +409,11 @@ loadLocalPackage pp = do
409409
{ package = pkg
410410
, testBench = btpkg
411411
, componentFiles
412-
, buildHaddocks = pp.projectCommon.haddocks
412+
, buildHaddocks = pp.projectCommon.buildHaddocks
413413
, forceDirty = bopts.forceDirty
414414
, dirtyFiles
415415
, newBuildCaches
416-
, cabalFile = pp.cabalFP
416+
, cabalFP = pp.cabalFP
417417
, wanted = isWanted
418418
, components = nonLibComponents
419419
-- TODO: refactor this so that it's easier to be sure that these

src/Stack/Build/Target.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ resolveRawTarget sma allLocs (rawInput, rt) =
258258
where
259259
locals = sma.project
260260
deps = sma.deps
261-
globals = sma.global
261+
globals = sma.globals
262262
-- Helper function: check if a 'NamedComponent' matches the given
263263
-- 'ComponentName'
264264
isCompNamed :: ComponentName -> NamedComponent -> Bool

src/Stack/BuildOpts.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defaultBuildOpts = BuildOpts
2727
, exeProfile = defaultFirstFalse buildMonoid.exeProfile
2828
, libStrip = defaultFirstTrue buildMonoid.libStrip
2929
, exeStrip = defaultFirstTrue buildMonoid.exeStrip
30-
, haddock = False
30+
, buildHaddocks = False
3131
, haddockOpts = defaultHaddockOpts
3232
, openHaddocks = defaultFirstFalse buildMonoid.openHaddocks
3333
, haddockDeps = Nothing

src/Stack/BuildPlan.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ checkSnapBuildPlan pkgDirs flags snapCandidate = do
390390
| otherwise = Nothing
391391
snapPkgs = Map.union
392392
(Map.mapMaybe depVersion sma.deps)
393-
(Map.map globalVersion sma.global)
393+
(Map.map globalVersion sma.globals)
394394
(f, errs) = checkBundleBuildPlan platform compiler snapPkgs flags gpds
395395
cerrs = compilerErrors compiler errs
396396

src/Stack/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ fillProjectWanted stackYamlFP config project locCache snapCompiler snapPackages
857857
packages0 <- for project.packages $ \fp@(RelFilePath t) -> do
858858
abs' <- resolveDir (parent stackYamlFP) (T.unpack t)
859859
let resolved = ResolvedPath fp abs'
860-
pp <- mkProjectPackage YesPrintWarnings resolved bopts.haddock
860+
pp <- mkProjectPackage YesPrintWarnings resolved bopts.buildHaddocks
861861
pure (pp.projectCommon.name, pp)
862862

863863
-- prefetch git repos to avoid cloning per subdirectory

0 commit comments

Comments
 (0)