-
Notifications
You must be signed in to change notification settings - Fork 412
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
[RFC] How to handle versions #880
Comments
In case it is useful, note that much of the hacky complexity of building and releasing ocamlformat is due to versioning. Maybe there is a simpler way with current tools, but see the current release procedure which involves a bunch of |
Thanks for the pointer. Looking at ocamlformat, I assume that during development the convents of Version.ml changes after every commit. Do you find that to be an issue in practice? I expect that for a project like Dune itself with a lot of tests that would be annoying as the BTW, I notice that for pinning you let opam decide what the version is and use this version in ocamlformat. What I had in mind was the opposite: the package decide what the version is and communicates this version to opam. The latter seems more natural to me. |
Yes, the version changes with every commit. That is a necessary feature of the build scripts. It's important to be able to distinguish between different "unreleased" versions to make sense of the results of long-running tests done across various machines on various versions simultaneously. This is more important in other projects than ocamlformat, as ocamlformat's tests are short and can be done locally. I would be happy for the package to tell opam the version instead of vice versa. It wasn't clear to me how to do so when I wrote these scripts. I could easily have overlooked something though. |
That makes sense. I was thinking in terms of a big mono-repo but in general developers work on smaller git repositories so the impact is limited. At worse we could add an option to control this behavior.
It's indeed not possible at the moment to have pinned packages decide of their version. |
We talked with @AltGr about the versioning of pinned packages, and it should be possible to do something in opam to allow using |
@jberdine are you satisfied with the current versioning functionality in dune? |
@rgrinberg, by and large, yes. One point that has come up however is that some additional flexibility over raw |
@jberdine Thanks, that sounds reasonable. Could you make a new ticket for this issue and we can discuss this in the next dune dev meeting? The reason I'm asking for a new issue is that we go over all new issues during this meeting so this way it will not be forgotten. If that's the only outstanding issue, I'm closing this ticket. |
Sounds good, thanks. I've opened #3856 for this. |
This ticket is to discuss how version numbers should be handled by Dune. It's still not clear to me what the best way to deal with versions is.
Problems
Current situation
For (1), Dune uses the version field specified in the
<package>.opam
file if any, with a fallback to some other file such as<package>.version
orVERSION
. It never uses the output ofgit describe ...
except when runningdune subst
. Some projects such as js_of_ocaml or ocamlformat use the OCaml syntax to use the output ofgit describe ...
in development builds. We could integrate this idea properly in Dune, however there is an issue with both (3) and (4).For (2), Dune currently doesn't know the version of installed packages. Since it always installs the
<package>.opam
file as<libdir>/<package>/opam
, it could simply read it from there.For (3), the problem is described here: ocaml/opam#2932
For (4), the problem is the following: if the version changes every time we commit something, then Dune might end up rebuilding things and re-running tests on every commit.
The text was updated successfully, but these errors were encountered: