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 generated opam files are not correct when the version is = version #10758

Closed
FardaleM opened this issue Jul 22, 2024 · 1 comment · Fixed by #10760
Closed

Dune generated opam files are not correct when the version is = version #10758

FardaleM opened this issue Jul 22, 2024 · 1 comment · Fixed by #10760

Comments

@FardaleM
Copy link

Expected Behavior

When generate_opam_files is enabled and a dependency has the constraint (= version), the opam file should contain the constraint {= version}

Actual Behavior

The constraint is currently {= "version"}.

Reproduction

By using the following dune-project file:

(lang dune 3.13)

(generate_opam_files true)

(package
  (name bug)
  (depends (bug-lib (= version)))
)

and the following dune file:

(executable
 (name bug))

with an empty bug.ml file, the command dune build will generate the bug.opam file.

Specifications

  • Version of dune (output of dune --version): 3.16.0
  • Version of ocaml (output of ocamlc --version): 5.2.0
  • Operating system (distribution and version): Debian Unstable
@emillon
Copy link
Collaborator

emillon commented Jul 22, 2024

Hi,
This is the intended behavior, there's no difference between "version" and version in dune files. To generate version variable in opam files, use :version in the dune file:

(depends (bug-lib (= :version)))

I'll add that as an example in the docs.

emillon added a commit to emillon/dune that referenced this issue Jul 22, 2024
Fixes ocaml#10758

Signed-off-by: Etienne Millon <me@emillon.org>
emillon added a commit to emillon/dune that referenced this issue Jul 22, 2024
Fixes ocaml#10758

Signed-off-by: Etienne Millon <me@emillon.org>
anmonteiro pushed a commit to anmonteiro/dune that referenced this issue Nov 17, 2024
Fixes ocaml#10758

Signed-off-by: Etienne Millon <me@emillon.org>
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

Successfully merging a pull request may close this issue.

2 participants