Skip to content

Commit

Permalink
Always provide depends field.
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Z. Yang <[email protected]>
  • Loading branch information
ezyang committed Aug 12, 2016
1 parent ec90419 commit b48dd6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cabal-install/Distribution/Client/ProjectPlanOutput.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ encodePlanAsJson elaboratedInstallPlan _elaboratedSharedConfig =
J.object
[ "type" J..= J.String "pre-existing"
, "id" J..= jdisplay (installedUnitId ipi)
, "components" J..= J.object
[ "lib" J..= J.object [ "depends" J..= map jdisplay (installedDepends ipi) ] ]
, "depends" J..= map jdisplay (installedDepends ipi)
]

-- pkg :: ElaboratedPackage
Expand All @@ -75,11 +74,13 @@ encodePlanAsJson elaboratedInstallPlan _elaboratedSharedConfig =
[ "type" J..= J.String "configured"
, "id" J..= (jdisplay . installedUnitId) pkg
, "components" J..= components
, "depends" J..= map (jdisplay . confInstId) flat_deps
, "flags" J..= J.object [ fn J..= v
| (PD.FlagName fn,v) <-
pkgFlagAssignment pkg ]
]
where
flat_deps = ordNub (ComponentDeps.flatDeps (pkgDependencies pkg))
components = J.object
[ comp2str c J..= J.object
[ "depends" J..= map (jdisplay . confInstId) v ]
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ data ConfiguredId = ConfiguredId {
confSrcId :: PackageId
, confInstId :: ComponentId
}
deriving (Eq, Generic)
deriving (Eq, Ord, Generic)

instance Binary ConfiguredId

Expand Down

0 comments on commit b48dd6a

Please sign in to comment.