Skip to content

Check the minimum version of dune during opam file generation #3427

@kit-ty-kate

Description

@kit-ty-kate

When turning on the opam file generation, if the dune dependency is explicitly specified no check is being done on whether or not the dune dependency actually has a correct constraint.
For instance:

$ ls
$ cat dune-project
(lang dune 2.4)
(name test)

(generate_opam_files true)

(package
  (name test)
  (depends dune))
$ dune build
$ cat test.opam
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
depends: ["dune"]
[...]

Here the opam file is generated with an explicit dependency to dune with no constraint. In my opinion it should be checked that >= 2.4 or above is being required. It would simplify opam-repository maintenance. For example see this PR in which the case was hit: ocaml/opam-repository#16280

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions