Skip to content

Commit 6f205ff

Browse files
committed
available targets are only host
1 parent f2bff67 commit 6f205ff

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,10 +3115,12 @@ availableTargets installPlan =
31153115
let rs =
31163116
[ (pkgid, cname, fake, target)
31173117
| pkg <- InstallPlan.toList installPlan
3118-
, (pkgid, cname, fake, target) <- case pkg of
3118+
, (stage, pkgid, cname, fake, target) <- case pkg of
31193119
InstallPlan.PreExisting ipkg -> availableInstalledTargets ipkg
31203120
InstallPlan.Installed elab -> availableSourceTargets elab
31213121
InstallPlan.Configured elab -> availableSourceTargets elab
3122+
-- Only host stage can be explicitly requested by the user
3123+
, stage == Host
31223124
]
31233125
in Map.union
31243126
( Map.fromListWith
@@ -3142,7 +3144,8 @@ availableTargets installPlan =
31423144

31433145
availableInstalledTargets
31443146
:: WithStage IPI.InstalledPackageInfo
3145-
-> [ ( PackageId
3147+
-> [ ( Stage
3148+
, PackageId
31463149
, ComponentName
31473150
, Bool
31483151
, AvailableTarget (WithStage UnitId, ComponentName)
@@ -3154,11 +3157,12 @@ availableInstalledTargets (WithStage stage ipkg) =
31543157
status = TargetBuildable (WithStage stage unitid, cname) TargetRequestedByDefault
31553158
target = AvailableTarget (packageId ipkg) cname status False
31563159
fake = False
3157-
in [(packageId ipkg, cname, fake, target)]
3160+
in [(stage, IPI.sourcePackageId ipkg, cname, fake, target)]
31583161

31593162
availableSourceTargets
31603163
:: ElaboratedConfiguredPackage
3161-
-> [ ( PackageId
3164+
-> [ ( Stage
3165+
, PackageId
31623166
, ComponentName
31633167
, Bool
31643168
, AvailableTarget (WithStage UnitId, ComponentName)
@@ -3195,7 +3199,7 @@ availableSourceTargets elab =
31953199
-- map (thus eliminating the duplicates) and then we overlay that map with
31963200
-- the normal buildable targets. (This is done above in 'availableTargets'.)
31973201
--
3198-
[ (packageId elab, cname, fake, target)
3202+
[ (elabStage elab, elabPkgSourceId elab, cname, fake, target)
31993203
| component <- pkgComponents (elabPkgDescription elab)
32003204
, let cname = componentName component
32013205
status = componentAvailableTargetStatus component

0 commit comments

Comments
 (0)