Skip to content

Commit ab05e7c

Browse files
committed
Don't include requests for non-existent stanzas in pkgStanzasRequested, fixes haskell#3340.
Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 1223a39 commit ab05e7c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cabal-install/Distribution/Client/ProjectPlanning.hs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,16 @@ elaborateInstallPlan platform compiler compilerprogdb
967967
pkgDependencies = deps
968968
pkgStanzasAvailable = Set.fromList stanzas
969969
pkgStanzasRequested =
970-
Map.fromList $ [ (TestStanzas, v) | v <- maybeToList tests ]
971-
++ [ (BenchStanzas, v) | v <- maybeToList benchmarks ]
970+
-- NB: even if a package stanza is requested, if the package
971+
-- doesn't actually have any of that stanza we omit it from
972+
-- the request, to ensure that we don't decide that this
973+
-- package needs to be rebuilt. (It needs to be done here,
974+
-- because the ElaboratedConfiguredPackage is where we test
975+
-- whether or not there have beenc hanges.)
976+
Map.fromList $ [ (TestStanzas, v) | v <- maybeToList tests
977+
, _ <- PD.testSuites pkgDescription ]
978+
++ [ (BenchStanzas, v) | v <- maybeToList benchmarks
979+
, _ <- PD.benchmarks pkgDescription ]
972980
where
973981
tests, benchmarks :: Maybe Bool
974982
tests = perPkgOptionMaybe pkgid packageConfigTests

0 commit comments

Comments
 (0)