File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
cabal-install/Distribution/Client/Dependency/Modular Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,12 @@ data QualifyOptions = QO {
186
186
187
187
-- | Apply built-in rules for package qualifiers
188
188
--
189
+ -- Although the behaviour of 'qualifyDeps' depends on the 'QualifyOptions',
190
+ -- it is important that these 'QualifyOptions' are _static_. Qualification
191
+ -- does NOT depend on flag assignment; in other words, it behaves the same no
192
+ -- matter which choices the solver makes (modulo the global 'QualifyOptions');
193
+ -- we rely on this in 'linkDeps' (see comment there).
194
+ --
189
195
-- NOTE: It's the _dependencies_ of a package that may or may not be independent
190
196
-- from the package itself. Package flag choices must of course be consistent.
191
197
qualifyDeps :: QualifyOptions -> QPN -> FlaggedDeps Component PN -> FlaggedDeps Component QPN
Original file line number Diff line number Diff line change @@ -282,6 +282,11 @@ makeCanonical lg qpn@(Q pp _) i =
282
282
-- as well, and cover their dependencies at that point.
283
283
linkDeps :: QPN -> [Var QPN ] -> FlaggedDeps Component QPN -> UpdateState ()
284
284
linkDeps target = \ blame deps -> do
285
+ -- linkDeps is called in two places: when we first link one package to
286
+ -- another, and when we discover more dependencies of an already linked
287
+ -- package after doing some flag assignment. It is therefore important that
288
+ -- flag assignments cannot influence _how_ dependencies are qualified;
289
+ -- fortunately this is a documented property of 'qualifyDeps'.
285
290
rdeps <- requalify deps
286
291
go blame deps rdeps
287
292
where
You can’t perform that action at this time.
0 commit comments