Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax error 31 for non-tautological dependencies #5928

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Apr 18, 2024

The compiler's packages presently contain:

depends: [
  "ocaml-option-bytecode-only" {arch = "x86_32"}
]
depopts : [
  "ocaml-option-bytecode-only"
]
build : [
  [ "./configure" "--disable-native-compiler" {ocaml-option-bytecode-only:installed}]
]

This package correctly contains ocaml-option-bytecode-only in both depends and depopts. It is a limited dependency and if arch != "x86_32" it must be treated as a depopt in order to trigger a recompilation. This scheme above does not trigger lint error 31, because the use of ocaml-option-bytecode-only in depends is guarded with a filter.

Upgrades for Windows packaging change this pattern slightly, adding an additional depends formula:

depends: [
  ("ocaml-arch-x86_32" {os = "win32"} & "ocaml-option-bytecode-only")
  "ocaml-option-bytecode-only" {arch = "x86_32"}
]

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 on ocaml-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".

Lint error 31 is not triggered for package bar, because it's guarded by
a filter, but it is triggered for foo, even though it's guarded by a
conjunction with a package which is guarded with a filter.
@dra27 dra27 changed the title Relax error 31 for non-tautological packages Relax error 31 for non-tautological dependencies Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant