Avoid forgetting known installed package IDs
Introduce ConfiguredId: -- | A ConfiguredId is a package ID for a configured package. -- -- Once we configure a source package we know it's InstalledPackageId (at -- least, in principle, even if we have to fake it currently). It is still -- however useful in lots of places to also know the source ID for the -- package. We therefore bundle the two. -- -- An already installed package of course is also "configured" (all it's -- configuration parameters and dependencies have been specified). -- -- TODO: I wonder if it would make sense to promote this datatype to Cabal -- and use it consistently instead of InstalledPackageIds? data ConfiguredId = ConfiguredId { confSrcId :: PackageId , confInstId :: InstalledPackageId } And use it for ConfiguredPackage. As the comment says, though, I wonder if we should use this in more places. One slightly tricky thing here is that the output of both solvers had to be modified to keep installed package IDs where possible; in the modular solver this was easy enough, as it does this properly, but in the top-down solver this is a bit of a hack; however, I’ve documented the hack in detail inline in the code. NOTE: Although this change is currently mostly cosmetic, in the future, once we drop the single instance restriction, it is very important that we don't convert from installed package IDs to source IDs and then back to installed package IDs, as this conversion will be lossy.
Showing
- cabal-install/Distribution/Client/BuildReports/Storage.hs 1 addition, 1 deletioncabal-install/Distribution/Client/BuildReports/Storage.hs
- cabal-install/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs 16 additions, 5 deletions...ibution/Client/Dependency/Modular/ConfiguredConversion.hs
- cabal-install/Distribution/Client/Dependency/TopDown.hs 33 additions, 2 deletionscabal-install/Distribution/Client/Dependency/TopDown.hs
- cabal-install/Distribution/Client/Dependency/TopDown/Types.hs 2 additions, 2 deletions...l-install/Distribution/Client/Dependency/TopDown/Types.hs
- cabal-install/Distribution/Client/InstallPlan.hs 8 additions, 3 deletionscabal-install/Distribution/Client/InstallPlan.hs
- cabal-install/Distribution/Client/Types.hs 36 additions, 8 deletionscabal-install/Distribution/Client/Types.hs
Loading
Please register or sign in to comment