Relax error 31 for non-tautological dependencies #5928
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The compiler's packages presently contain:
This package correctly contains
ocaml-option-bytecode-only
in bothdepends
anddepopts
. It is a limited dependency and ifarch != "x86_32"
it must be treated as adepopt
in order to trigger a recompilation. This scheme above does not trigger lint error 31, because the use ofocaml-option-bytecode-only
independs
is guarded with a filter.Upgrades for Windows packaging change this pattern slightly, adding an additional depends formula:
This does trigger lint error 31, and this is an error. Lint error 31 should only trigger when we can prove that the package atom is always a dependency. Likewise, it should not trigger for a formula such as
("ocaml-arch-x86_64" | "ocaml-arch-x86_32" & "ocaml-option-bytecode-only")
i.e. it's not just about the presence of a filter - the point is that there is a way of satisfying the dependency formula which does not depend onocaml-option-bytecode-only
so it's valid in the depopt list.I'm not sure why this has always been an error, rather than a warning, though @AltGr? I've worked around it in the compiler packages simply by adding an unnecessary
{os = "win32"}
to the"ocaml-option-bytecode-only"
.