Skip to content

Commit

Permalink
Fix cabal-install after build-depends reform
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Jan 26, 2017
1 parent 67f932e commit 48051f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ configurePackage verbosity platform comp scriptOptions configFlags
-- depending on the Cabal version we are talking to.
configConstraints = [ thisPackageVersion srcid
| ConfiguredId srcid _uid <- CD.nonSetupDeps deps ],
configDependencies = [ (packageName srcid, uid)
configDependencies = [ (packageName srcid, Nothing, uid)
| ConfiguredId srcid uid <- CD.nonSetupDeps deps ],
-- Use '--exact-configuration' if supported.
configExactConfiguration = toFlag True,
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Install.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ installReadyPackage platform cinfo configFlags
-- the Cabal version we are talking to.
configConstraints = [ thisPackageVersion srcid
| ConfiguredId srcid _ipid <- CD.nonSetupDeps deps ],
configDependencies = [ (packageName srcid, dep_ipid)
configDependencies = [ (packageName srcid, Nothing, dep_ipid)
| ConfiguredId srcid dep_ipid <- CD.nonSetupDeps deps ],
-- Use '--exact-configuration' if supported.
configExactConfiguration = toFlag True,
Expand Down
13 changes: 4 additions & 9 deletions cabal-install/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
infoProgress $ hang (text "Component graph for" <+> disp pkgid <<>> colon)
4 (dispComponentsGraph g)
(_, comps) <- mapAccumM buildComponent
((Map.empty, Map.empty), Map.empty, Map.empty)
(Map.empty, Map.empty, Map.empty)
(map fst g)
let is_public_lib ElaboratedConfiguredPackage{..} =
case elabPkgOrComp of
Expand Down Expand Up @@ -1242,7 +1242,7 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
compLinkedLibDependencies = error "buildComponent: compLinkedLibDependencies"
compNonSetupDependencies = error "buildComponent: compNonSetupDependencies"

cc = toConfiguredComponent pd cid external_cc_map cc_map comp
cc = toConfiguredComponent pd cid cc_map comp
cc_map' = extendConfiguredComponentMap cc cc_map

cid :: ComponentId
Expand Down Expand Up @@ -1321,19 +1321,14 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
compInplaceDependencyBuildCacheFiles
= concatMap (elaborateLibBuildCacheFile mapDep) external_lib_dep_sids
external_exe_dep_sids = CD.select (== compSolverName) exe_deps0
external_cc_map = Map.fromList (map mkPkgNameMapping external_lib_dep_pkgs)

external_lc_map = Map.fromList (map mkShapeMapping external_lib_dep_pkgs)

unbuildable_external_lib_deps =
filter (null . elaborateLibSolverId mapDep) external_lib_dep_sids
unbuildable_external_exe_deps =
filter (null . elaborateExeSolverId mapDep) external_exe_dep_sids

mkPkgNameMapping :: ElaboratedPlanPackage
-> (PackageName, (ComponentId, PackageId))
mkPkgNameMapping dpkg =
(packageName dpkg, (getComponentId dpkg, packageId dpkg))

mkShapeMapping :: ElaboratedPlanPackage
-> (ComponentId, (OpenUnitId, ModuleShape))
mkShapeMapping dpkg =
Expand Down Expand Up @@ -2717,7 +2712,7 @@ setupHsConfigureFlags (ReadyPackage elab@ElaboratedConfiguredPackage{..})
-- NB: This does NOT use InstallPlan.depends, which includes executable
-- dependencies which should NOT be fed in here (also you don't have
-- enough info anyway)
configDependencies = [ (packageName srcid, cid)
configDependencies = [ (packageName srcid, Nothing, cid)
| ConfiguredId srcid cid <- elabLibDependencies elab ]
configConstraints =
case elabPkgOrComp of
Expand Down

0 comments on commit 48051f9

Please sign in to comment.