Skip to content

Commit

Permalink
Fix ProjectPlanning so not all SpecificSourcePackages are local
Browse files Browse the repository at this point in the history
  • Loading branch information
typedrat committed Jul 13, 2018
1 parent 07c4094 commit 83120cd
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cabal-install/Distribution/Client/ProjectPlanning.hs
Expand Up @@ -604,7 +604,7 @@ rebuildInstallPlan verbosity
-> (Compiler, Platform, ProgramDb)
-> PkgConfigDb
-> SolverInstallPlan
-> [PackageSpecifier (SourcePackage loc)]
-> [PackageSpecifier (SourcePackage (PackageLocation loc))]
-> Rebuild ( ElaboratedInstallPlan
, ElaboratedSharedConfig )
phaseElaboratePlan ProjectConfig {
Expand Down Expand Up @@ -1212,7 +1212,7 @@ elaborateInstallPlan
-> DistDirLayout
-> StoreDirLayout
-> SolverInstallPlan
-> [PackageSpecifier (SourcePackage loc)]
-> [PackageSpecifier (SourcePackage (PackageLocation loc))]
-> Map PackageId PackageSourceHash
-> InstallDirs.InstallDirTemplates
-> ProjectConfigShared
Expand Down Expand Up @@ -1898,12 +1898,14 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
--TODO: localPackages is a misnomer, it's all project packages
-- here is where we decide which ones will be local!
where
shouldBeLocal :: PackageSpecifier (SourcePackage loc) -> Maybe PackageId
shouldBeLocal :: PackageSpecifier (SourcePackage (PackageLocation loc)) -> Maybe PackageId
shouldBeLocal NamedPackage{} = Nothing
shouldBeLocal (SpecificSourcePackage pkg) = Just (packageId pkg)
-- TODO: It's not actually obvious for all of the
-- 'ProjectPackageLocation's that they should all be local. We might
-- need to provide the user with a choice.
shouldBeLocal (SpecificSourcePackage pkg)
| LocalTarballPackage _ <- packageSource pkg = Nothing
| otherwise = Just (packageId pkg)
-- TODO: Is it only LocalTarballPackages we can know about without
-- them being "local" in the sense meant here?
--
-- Also, review use of SourcePackage's loc vs ProjectPackageLocation

pkgsUseSharedLibrary :: Set PackageId
Expand Down

0 comments on commit 83120cd

Please sign in to comment.