Skip to content

Commit 83120cd

Browse files
committed
Fix ProjectPlanning so not all SpecificSourcePackages are local
1 parent 07c4094 commit 83120cd

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

cabal-install/Distribution/Client/ProjectPlanning.hs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ rebuildInstallPlan verbosity
604604
-> (Compiler, Platform, ProgramDb)
605605
-> PkgConfigDb
606606
-> SolverInstallPlan
607-
-> [PackageSpecifier (SourcePackage loc)]
607+
-> [PackageSpecifier (SourcePackage (PackageLocation loc))]
608608
-> Rebuild ( ElaboratedInstallPlan
609609
, ElaboratedSharedConfig )
610610
phaseElaboratePlan ProjectConfig {
@@ -1212,7 +1212,7 @@ elaborateInstallPlan
12121212
-> DistDirLayout
12131213
-> StoreDirLayout
12141214
-> SolverInstallPlan
1215-
-> [PackageSpecifier (SourcePackage loc)]
1215+
-> [PackageSpecifier (SourcePackage (PackageLocation loc))]
12161216
-> Map PackageId PackageSourceHash
12171217
-> InstallDirs.InstallDirTemplates
12181218
-> ProjectConfigShared
@@ -1898,12 +1898,14 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
18981898
--TODO: localPackages is a misnomer, it's all project packages
18991899
-- here is where we decide which ones will be local!
19001900
where
1901-
shouldBeLocal :: PackageSpecifier (SourcePackage loc) -> Maybe PackageId
1901+
shouldBeLocal :: PackageSpecifier (SourcePackage (PackageLocation loc)) -> Maybe PackageId
19021902
shouldBeLocal NamedPackage{} = Nothing
1903-
shouldBeLocal (SpecificSourcePackage pkg) = Just (packageId pkg)
1904-
-- TODO: It's not actually obvious for all of the
1905-
-- 'ProjectPackageLocation's that they should all be local. We might
1906-
-- need to provide the user with a choice.
1903+
shouldBeLocal (SpecificSourcePackage pkg)
1904+
| LocalTarballPackage _ <- packageSource pkg = Nothing
1905+
| otherwise = Just (packageId pkg)
1906+
-- TODO: Is it only LocalTarballPackages we can know about without
1907+
-- them being "local" in the sense meant here?
1908+
--
19071909
-- Also, review use of SourcePackage's loc vs ProjectPackageLocation
19081910

19091911
pkgsUseSharedLibrary :: Set PackageId

0 commit comments

Comments
 (0)