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 subst can add a duplicate version field in opam #878

Open
samoht opened this issue Jun 13, 2018 · 4 comments
Open

dune subst can add a duplicate version field in opam #878

samoht opened this issue Jun 13, 2018 · 4 comments
Labels
bug good first issue Good for contributing for the first time to the Dune codebase open-to-contribution External contributors are welcomed to do a PR to solve the issue

Comments

@samoht
Copy link
Member

samoht commented Jun 13, 2018

It seems that jbuilder subst doesn't check if a version field is already present in the opam file before adding a new one. It should either: don't add a new field of already present or (probably better) replace the field with some new contents.

To reproduce:

$ cat foo.opam
version: "foo"
$ jbuilder subst
$ git diff
diff --git a/foo.opam b/foo.opam
index d228968..3711f0d 100644
--- a/foo.opam
+++ b/foo.opam
@@ -1 +1,2 @@
+version: "34185ff"
 version: "foo"
@ghost
Copy link

ghost commented Jun 13, 2018

there is also this 3rd option: if the version is present in the opam file, use it rather than call git describe ...

@samoht
Copy link
Member Author

samoht commented Jun 13, 2018

Yea I am not sure... /cc @Drup who is putting version field in his opam files :-)

@ghost
Copy link

ghost commented Jun 13, 2018

I also created #880 to discuss these versions problems. Currently it's not clear to me what Dune should do regarding versions.

@Drup
Copy link

Drup commented Jun 13, 2018

there is also this 3rd option: if the version is present in the opam file, use it rather than call git describe ...

Well, no. The version I put in the opam file in my dev repositories is "dev". I don't want that in the release.

@maiste maiste added bug good first issue Good for contributing for the first time to the Dune codebase open-to-contribution External contributors are welcomed to do a PR to solve the issue and removed enhancement labels Jan 28, 2025
@maiste maiste changed the title jbuilder subst can add a duplicate version field in opam dune subst can add a duplicate version field in opam Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Good for contributing for the first time to the Dune codebase open-to-contribution External contributors are welcomed to do a PR to solve the issue
Projects
None yet
Development

No branches or pull requests

4 participants