Skip to content

Commit 0eb4e51

Browse files
committed
Mark template-haskell non-upgradable (again)
65e9b88 made template-haskell non-upgradable 65ae95c made it upgradable again ...and this commit makes it non-upgradable again While there may be a few cases when `template-haskell` can be reinstalled, it's generally not advisable, and causes more harm than the benefit in the few cases where we'd gain install-plan flexibility (e.g. when only template-haskell's API is needed for compile, but no actual TH evaluation takes place). Closes #4098
1 parent 09865f6 commit 0eb4e51

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cabal-install/Distribution/Client/Dependency.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,14 @@ dontUpgradeNonUpgradeablePackages params =
348348
(PackageConstraintInstalled pkgname)
349349
ConstraintSourceNonUpgradeablePackage
350350
| Set.notMember (mkPackageName "base") (depResolverTargets params)
351-
, pkgname <- map mkPackageName [ "base", "ghc-prim", "integer-gmp"
352-
, "integer-simple" ]
351+
-- If you change this enumeration, make sure to update the list in
352+
-- "Distribution.Solver.Modular.Solver" as well
353+
, pkgname <- [ mkPackageName "base"
354+
, mkPackageName "ghc-prim"
355+
, mkPackageName "integer-gmp"
356+
, mkPackageName "integer-simple"
357+
, mkPackageName "template-haskell"
358+
]
353359
, isInstalled pkgname ]
354360

355361
isInstalled = not . null

cabal-install/Distribution/Solver/Modular/Solver.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,14 @@ solve sc cinfo idx pkgConfigDB userPrefs userConstraints userGoals =
130130
validateLinking idx .
131131
validateTree cinfo idx pkgConfigDB
132132
prunePhase = (if asBool (avoidReinstalls sc) then P.avoidReinstalls (const True) else id) .
133-
-- packages that can never be "upgraded":
133+
-- packages that can never be "upgraded"
134+
-- If you change this enumeration, make sure to update the list in
135+
-- "Distribution.Client.Dependency" as well
134136
P.requireInstalled (`elem` [ mkPackageName "base"
135137
, mkPackageName "ghc-prim"
136138
, mkPackageName "integer-gmp"
137139
, mkPackageName "integer-simple"
140+
, mkPackageName "template-haskell"
138141
])
139142
buildPhase = traceTree "build.json" id
140143
$ buildTree idx (independentGoals sc) (S.toList userGoals)

0 commit comments

Comments
 (0)