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

Syntax for conjunction in conflict #15441

Open
maroneze opened this issue Dec 3, 2019 · 3 comments
Open

Syntax for conjunction in conflict #15441

maroneze opened this issue Dec 3, 2019 · 3 comments

Comments

@maroneze
Copy link
Contributor

maroneze commented Dec 3, 2019

I am adding a conflicts clause to a package due to issue #10925, otherwise our users will end up trying to compile Frama-C and fail.

I tried adding this to our conflicts:

("ocamlfind" { = "1.8.1" } & "ocaml" { = "4.05.0" })

Which means, only if both OCaml is 4.05.0 and ocamlfind is 1.8.1, should the conflict happen.

However, when testing locally via opam pin add -kind path, each element seems to be parsed individually, so when testing with OCaml 4.05.0 and ocamlfind 1.8.0, I get:

Your request can't be satisfied:
  - conflict with the base packages of this switch

I also tried a different syntax:

"ocamlfind" { = "1.8.1" & ocaml:version = "4.05.0" }

opam lint did not complain, but this time it did not prevent installation when the clause was true.

I also tried adding some constraints to depends:

"ocamlfind" { != "1.8.1" | "ocaml" != "4.05.0" }

But again, these were ignored.

Is there a way to specify this kind of constraint?

@maroneze
Copy link
Contributor Author

maroneze commented Dec 4, 2019

For now, I'm following a colleague's suggestion, and using the messages field to emit a warning when both conditions are met. This will not prevent the user from installing the package, but should be explicit enough that they would have some information before trying to compile the package.

I'm leaving the issue open because I'm still interested in a solution for the general case.

@emillon
Copy link
Contributor

emillon commented Jan 9, 2020

I think you can adapt your message solution by adding a failing command to the build instructions if both conditions are set:

["false" {ocamlfind:version = "1.8.1" & ocaml:version = "4.05.0"]

(this is has the same limitations, ie this will be considered a valid solution by the solver, so it won't try anything else)

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove the stale label, or comment, or this will be closed in 15 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants