Skip to content

Commit 02f17b1

Browse files
committed
Revert "fixup! Add compiler to PackageId"
This reverts commit 1259214.
1 parent 1259214 commit 02f17b1

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ convIPI' toolchains (ShadowPkgs sip) idx =
8585
-- | Extract/recover the package ID from an installed package info, and convert it to a solver's I.
8686
convId :: Toolchains -> IPI.InstalledPackageInfo -> (PN, I)
8787
convId toolchains ipi = (pn, I stage ver $ Inst $ IPI.installedUnitId ipi)
88-
where MungedPackageId mpn ver compid = mungedId ipi
88+
where MungedPackageId mpn ver = mungedId ipi
8989
-- HACK. See Note [Index conversion with internal libraries]
9090
pn = encodeCompatPackageName mpn
9191
stage = case IPI.pkgCompiler ipi of
@@ -169,7 +169,7 @@ convSPI' toolchains constraints strfl solveExes =
169169
-- | Convert a single source package into the solver-specific format.
170170
convSP :: Toolchains -> Map PN [LabeledPackageConstraint]
171171
-> StrongFlags -> SolveExecutables -> SourcePackage loc -> [(PN, I, PInfo)]
172-
convSP toolchains constraints strfl solveExes (SourcePackage (PackageIdentifier pn pv _compid) gpd _ _pl) =
172+
convSP toolchains constraints strfl solveExes (SourcePackage (PackageIdentifier pn pv) gpd _ _pl) =
173173
let pkgConstraints = fromMaybe [] $ M.lookup pn constraints
174174
in [(pn, I Host pv InRepo, convGPD (hostToolchain toolchains) pkgConstraints strfl solveExes pn gpd)
175175
,(pn, I Build pv InRepo, convGPD (buildToolchain toolchains) pkgConstraints strfl solveExes pn gpd)]

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ import Distribution.Types.GivenComponent
198198
import Distribution.Types.LibraryName
199199
import qualified Distribution.Types.LocalBuildConfig as LBC
200200
import Distribution.Types.PackageVersionConstraint
201-
import qualified Distribution.Types.PackageId as PI
202201
import Distribution.Types.PkgconfigDependency
203202
import Distribution.Types.UnqualComponentName
204203

@@ -792,21 +791,8 @@ rebuildInstallPlan
792791
-- }
793792
-- deriving (Eq, Generic, Show, Read)
794793
--
795-
-- let mapPkgIdx f = PI.fromList . map f . PI.allPackages
796-
-- let updateIPI :: IPI.InstalledPackageInfo -> IPI.InstalledPackageInfo
797-
-- updateIPI ipi = ipi {
798-
-- IPI.sourcePackageId = (IPI.sourcePackageId ipi){ PI.pkgCompiler = IPI.pkgCompiler ipi }
799-
-- }
800-
-- let addCompilerToSourcePkg :: CompilerId -> [PackageSpecifier UnresolvedSourcePackage] -> [PackageSpecifier UnresolvedSourcePackage]
801-
-- addCompilerToSourcePkg compilerId = map (addCompilerId compilerId)
802-
-- addCompilerId :: CompilerId -> PackageSpecifier UnresolvedSourcePackage -> PackageSpecifier UnresolvedSourcePackage
803-
-- addCompilerId compilerId (NamedPackage name props) = NamedPackage name props
804-
-- addCompilerId compilerId (SpecificSourcePackage pkg) = SpecificSourcePackage (f pkg)
805-
-- where f :: SourcePackage UnresolvedPkgLoc -> SourcePackage UnresolvedPkgLoc
806-
-- f pkg = pkg{srcpkgPackageId = (srcpkgPackageId pkg){pkgCompiler = Just compilerId}}
807-
794+
-- can probably use fromList $ Map.elems $ on it.
808795
hinstalledPkgIndex <-
809-
-- mapPkgIdx updateIPI <$>
810796
getInstalledPackages
811797
verbosity
812798
(hostToolchain toolchains)
@@ -816,16 +802,13 @@ rebuildInstallPlan
816802
-- for now. FIXME!
817803
-- let hinstalledPkgIndex' = PI.fromList $ PI.allPackages hinstalledPkgIndex
818804
binstalledPkgIndex <-
819-
-- mapPkgIdx updateIPI <$>
820805
getInstalledPackages
821806
verbosity
822807
(buildToolchain toolchains)
823808
-- FIXME: HACK
824809
-- if host and build compiler are the same, we want to get -package-db in here.
825810
(corePackageDbs $ if buildIsHost toolchains then Host else Build)
826811

827-
-- let localPackages' = addCompilerToSourcePkg (compilerId . toolchainCompiler . hostToolchain $ toolchains) localPackages
828-
829812
(sourcePkgDb, tis, ar) <-
830813
getSourcePackages
831814
verbosity

0 commit comments

Comments
 (0)