Skip to content

Commit cd00d88

Browse files
committed
seprate build directories more and drop -inplace
1 parent 6f205ff commit cd00d88

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

cabal-install/src/Distribution/Client/DistDirLayout.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,16 @@ import Distribution.Simple.Compiler
4848
)
4949
import Distribution.System
5050
import Distribution.Types.ComponentName
51-
import Distribution.Types.LibraryName
51+
import Distribution.Client.Toolchain (Stage)
5252

5353
-- | Information which can be used to construct the path to
5454
-- the build directory of a build. This is LESS fine-grained
5555
-- than what goes into the hashed 'InstalledPackageId',
5656
-- and for good reason: we don't want this path to change if
5757
-- the user, say, adds a dependency to their project.
5858
data DistDirParams = DistDirParams
59-
{ distParamUnitId :: UnitId
59+
{ distParamStage :: Stage
60+
, distParamUnitId :: UnitId
6061
, distParamPackageId :: PackageId
6162
, distParamComponentId :: ComponentId
6263
, distParamComponentName :: Maybe ComponentName
@@ -194,6 +195,7 @@ defaultDistDirLayout projectRoot mdistDirectory haddockOutputDir =
194195
distBuildDirectory :: DistDirParams -> FilePath
195196
distBuildDirectory params =
196197
distBuildRootDirectory
198+
</> prettyShow (distParamStage params)
197199
</> prettyShow (distParamPlatform params)
198200
</> prettyShow (distParamCompilerId params)
199201
</> prettyShow (distParamUnitId params)

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,8 +1924,6 @@ elaborateInstallPlan
19241924
BuildInplaceOnly{} ->
19251925
mkComponentId $
19261926
prettyShow pkgid
1927-
++ "-inplace-"
1928-
++ prettyShow (elabStage elab0)
19291927
++ ( case Cabal.componentNameString cname of
19301928
Nothing -> ""
19311929
Just s -> "-" ++ prettyShow s
@@ -2154,7 +2152,7 @@ elaborateInstallPlan
21542152

21552153
pkgInstalledId
21562154
| shouldBuildInplaceOnly pkg =
2157-
mkComponentId (prettyShow srcpkgPackageId ++ "-inplace-" ++ prettyShow solverPkgStage)
2155+
mkComponentId (prettyShow srcpkgPackageId)
21582156
| otherwise =
21592157
assert (isJust elabPkgSourceHash) $
21602158
hashedInstalledPackageId

cabal-install/src/Distribution/Client/ProjectPlanning/Types.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,8 @@ elabConfiguredName verbosity elab
651651
elabDistDirParams :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> DistDirParams
652652
elabDistDirParams shared elab =
653653
DistDirParams
654-
{ distParamUnitId = installedUnitId elab
654+
{ distParamStage = elabStage elab
655+
, distParamUnitId = installedUnitId elab
655656
, distParamComponentId = elabComponentId elab
656657
, distParamPackageId = elabPkgSourceId elab
657658
, distParamComponentName = case elabPkgOrComp elab of

cabal-install/src/Distribution/Client/ScriptUtils.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ scriptExeFileName scriptPath = "cabal-script-" ++ takeFileName scriptPath
438438
scriptDistDirParams :: FilePath -> ProjectBaseContext -> Compiler -> Platform -> DistDirParams
439439
scriptDistDirParams scriptPath ctx compiler platform =
440440
DistDirParams
441-
{ distParamUnitId = newSimpleUnitId cid
441+
{ distParamStage = Host
442+
, distParamUnitId = newSimpleUnitId cid
442443
, distParamPackageId = fakePackageId
443444
, distParamComponentId = cid
444445
, distParamComponentName = Just $ CExeName cn

0 commit comments

Comments
 (0)