-
Notifications
You must be signed in to change notification settings - Fork 364
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
Comparing package versions with opam cli #6118
Comments
The version ordering is explain in the manual: https://opam.ocaml.org/doc/Manual.html#version-ordering
|
You can also find examples of that very same package in https://github.com/ocaml/opam-repository/blob/master/packages/ppxlib/ppxlib.0.32.1~5.2preview/opam |
Thanks a lot! I was confused a bit by https://github.com/ocaml/opam?tab=readme-ov-file#versioning but I understand now this statement is about the version of the
Yes, I had published a preview here while working on some PR with the ppxlib devs. I will adjust my process to use the '~' separator then, thanks again! |
Thinking about this a bit @kit-ty-kate, what do you think about adding a quick sanity check opam sub command allowing some validation and comparison of 2 versions, exposing the same logic as used by the rest of the opam system? I'm thinking something as simple as: $ opam admin compare-package-versions 0.33.0-preview.1 0.33
0.33.0-preview.1 > 0.33 I'm imagining this could be a good way to double check things when in doubt (the spec can get a bit tricky with all the special rules and characters to do this mentally). |
That looks useful yes. Contribution would be welcome, or if you don't have the time you can open a ticket and we'll get to it when we have some time. As a side-note, currently that can be done using the OCaml REPL:
|
This follows a discussion in ocaml#6118 Signed-off-by: Mathieu Barbin <[email protected]>
This follows a discussion in ocaml#6118 Signed-off-by: Mathieu Barbin <[email protected]>
Thank you for showing how to do it with the OCaml REPL! I opened a PR to add this in the doc (as you saw and already approved, Thank you!). Given the new doc note, and that there's already a way to do this, I don't really know anymore if it is worth adding a sub command too. I think I am happy with the REPL thing. What do you say? |
i don't know. I suppose having a separate command would be a bit nicer but i wonder if it would actually be useful to more people than just those who would be happy with the REPL solution already. |
OK. I'll see what I can do. I think I can squeeze an attempt into my dev schedule in the near term. If anything, I'd be interested about finding my ways into the opam cli. Thanks! Please assign the issue to me. |
done |
Work in progress in #6197 |
#6197 was merged and is planned for a future release. Do you wish to keep this issue open until the release, or may I close it now? Thank you! |
Indeed, the issue wasn't linked to the PR. All good now. Thanks all! |
Hello!
I don't think this is an issue with opam, it's more like a question: What is the syntax in opam for a package version that denote a pre-release version?
I was trying to follow https://semver.org/#spec-item-9 but was surprised by this:
(I would have expected that
0.33.0-preview.1
<0.33.0
, and thus this install being an upgrade, not a downgrade.I sort of recall seeing perhaps '~' used as a separator. Is this the way? (as in, I should have named the package
0.33.0~preview.1
instead). I couldn't find '~' in the semver doc. Is this a different convention?Sorry if it's a duplicate. I am not well versed in pre-release packages with opam, and trying to establish habits that will work well.
Thank you!
The text was updated successfully, but these errors were encountered: