Skip to content

Commit a1494a8

Browse files
committed
Revert "UGLY! Forcing pkgCompiler to Nothing across the codebasy 😢"
This reverts commit c520482.
1 parent 9fe4d06 commit a1494a8

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

Cabal/src/Distribution/Backpack/Id.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ computeComponentId
3939
-- This is used by cabal-install's legacy codepath
4040
-> Maybe ([ComponentId], FlagAssignment)
4141
-> ComponentId
42-
computeComponentId deterministic mb_ipid mb_cid pid0 cname mb_details =
42+
computeComponentId deterministic mb_ipid mb_cid pid cname mb_details =
4343
-- show is found to be faster than intercalate and then replacement of
4444
-- special character used in intercalating. We cannot simply hash by
4545
-- doubly concatenating list, as it just flatten out the nested list, so
4646
-- different sources can produce same hash
47-
let -- we do not want the compiler to show up in the Id.
48-
pid = pid0{pkgCompiler = Nothing}
49-
hash_suffix
47+
let hash_suffix
5048
| Just (dep_ipids, flags) <- mb_details =
5149
"-"
5250
++ hashToBase62

Cabal/src/Distribution/Simple/InstallDirs.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ packageTemplateEnv pkgId uid =
441441
, -- Invariant: uid is actually a HashedUnitId. Hard to enforce because
442442
-- it's an API change.
443443
(LibNameVar, PathTemplate [Ordinary $ prettyShow uid])
444-
, (PkgIdVar, PathTemplate [Ordinary $ prettyShow (pkgId{pkgCompiler = Nothing})])
444+
, (PkgIdVar, PathTemplate [Ordinary $ prettyShow pkgId])
445445
]
446446

447447
compilerTemplateEnv :: CompilerInfo -> PathTemplateEnv

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import Distribution.Package
3939
, PackageId
4040
, PackageIdentifier
4141
, UnitId
42-
, pkgCompiler
4342
)
4443
import Distribution.Simple.Compiler
4544
( Compiler (..)
@@ -201,7 +200,7 @@ defaultDistDirLayout projectRoot mdistDirectory haddockOutputDir =
201200
distBuildRootDirectory
202201
</> prettyShow (distParamPlatform params)
203202
</> prettyShow (distParamCompilerId params)
204-
</> prettyShow ((distParamPackageId params){pkgCompiler = Nothing})
203+
</> prettyShow (distParamPackageId params)
205204
</> ( case distParamComponentName params of
206205
Nothing -> ""
207206
Just (CLibName LMainLibName) -> ""

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ verifyFetchedTarball verbosity file mCallbacks pkgid =
201201
let warnAndFail s = warn verbosity ("Fetched tarball " ++ file ++ " does not match server, will redownload: " ++ s) >> return False
202202
in -- the do block in parens is due to dealing with the checked exceptions mechanism.
203203
( do
204-
fileInfo <- Sec.indexLookupFileInfo callbacks (pkgid{pkgCompiler = Nothing})
204+
fileInfo <- Sec.indexLookupFileInfo callbacks pkgid
205205
sz <- Sec.FileLength . fromInteger <$> getFileSize file
206206
if sz /= Sec.fileInfoLength (Sec.trusted fileInfo)
207207
then warnAndFail "file length mismatch"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ withTarballLocalDirectory
718718
verbosity
719719
tarball
720720
unpackdir
721-
pkgid{pkgCompiler = Nothing}
721+
pkgid
722722
pkgTextOverride
723723
buildPkg srcdir builddir
724724

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do
12111211
--
12121212
let allPkgLocations :: [(PackageId, PackageLocation (Maybe FilePath))]
12131213
allPkgLocations =
1214-
[ ((packageId pkg){pkgCompiler = Nothing}, srcpkgSource pkg)
1214+
[ (packageId pkg, srcpkgSource pkg)
12151215
| SolverInstallPlan.Configured (SolverPackage{solverPkgSource = pkg}) <-
12161216
SolverInstallPlan.toList solverPlan
12171217
]
@@ -1982,7 +1982,7 @@ elaborateInstallPlan
19821982
cid = case elabBuildStyle elab0 of
19831983
BuildInplaceOnly{} ->
19841984
mkComponentId $
1985-
prettyShow (pkgid{pkgCompiler = Nothing})
1985+
prettyShow pkgid
19861986
++ "-inplace"
19871987
++ ( case Cabal.componentNameString cname of
19881988
Nothing -> ""
@@ -2215,7 +2215,7 @@ elaborateInstallPlan
22152215

22162216
pkgInstalledId
22172217
| shouldBuildInplaceOnly pkg =
2218-
mkComponentId (prettyShow (pkgid{pkgCompiler = Nothing}) ++ "-inplace")
2218+
mkComponentId (prettyShow pkgid ++ "-inplace")
22192219
| otherwise =
22202220
assert (isJust elabPkgSourceHash) $
22212221
hashedInstalledPackageId
@@ -2226,7 +2226,7 @@ elaborateInstallPlan
22262226

22272227
-- Need to filter out internal dependencies, because they don't
22282228
-- correspond to anything real anymore.
2229-
isExt confid = (confSrcId confid){pkgCompiler = Nothing} /= pkgid{pkgCompiler = Nothing}
2229+
isExt confid = confSrcId confid /= pkgid
22302230
filterExt = filter isExt
22312231

22322232
filterExt' :: [(ConfiguredId, a)] -> [(ConfiguredId, a)]
@@ -2367,7 +2367,7 @@ elaborateInstallPlan
23672367
else cp
23682368

23692369
elabPkgSourceLocation = srcloc
2370-
elabPkgSourceHash = case Map.lookup (pkgid{pkgCompiler = Nothing}) sourcePackageHashes of
2370+
elabPkgSourceHash = case Map.lookup pkgid sourcePackageHashes of
23712371
Just h -> Just h
23722372
Nothing -> Nothing
23732373
elabLocalToProject = isLocalToProject pkg

0 commit comments

Comments
 (0)