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

Dune version constraint in the opam file #1689

Closed
ghost opened this issue Dec 18, 2018 · 4 comments
Closed

Dune version constraint in the opam file #1689

ghost opened this issue Dec 18, 2018 · 4 comments
Assignees

Comments

@ghost
Copy link

ghost commented Dec 18, 2018

When one has (lang dune 1.4) in their opam file, then they must also have "dune" {>= "1.4"} in their opam file. Users might easily forget to update this constraint when bumping the dune lang version.

Dune could help by warning when it detects that the constraint is wrong. Additionally, when generating the opam file, dune should produce the right lower-bound (/cc @avsm).

@emillon
Copy link
Collaborator

emillon commented Dec 20, 2018

Once there is a stable representation built for dune describe, we might be able to do some lightweight checks on it. This could be one of these checks.

@Et7f3
Copy link
Contributor

Et7f3 commented May 8, 2020

Update: Now if w use the generate_opam_files feature dune is automatically added with the right version but if we add dune (explicitly in depends field) with wrong lower-bound version then we can have ill-formed opam package. So just the check isn't done and warning not emitted.

dune: 2.5.1

(lang dune 2.2)

(generate_opam_files true)

(package
 (name foo)
 (depends
  (dune (<= 2.0))))

generate:

# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
depends: [
  "dune" {<= "2.0"}
]
build: [
  ["dune" "subst"] {pinned}
  [
    "dune"
    "build"
    "-p"
    name
    "-j"
    jobs
    "@install"
    "@runtest" {with-test}
    "@doc" {with-doc}
  ]
]

@ghost
Copy link
Author

ghost commented May 11, 2020

@Et7f3 this problem (and the original one) should be fixed by #3434 which will be part of the next dune release

@ghost ghost closed this as completed May 11, 2020
@Et7f3
Copy link
Contributor

Et7f3 commented May 11, 2020

We can still create illegal constraint without receiving warning that's why I have opened #3468

This issue was closed.
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