-
Notifications
You must be signed in to change notification settings - Fork 179
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
Embed version numbers independently from VCS info #1363
Comments
No, this has come up several times, but every commit needs a distinct version that can be reported by |
Sorry, only have a moment, I'm not sure that having distinct versions per commit is incompatible with what you propose.
|
I don't think that I understand the proposed approach where there are two version numbers, in particular how they can be different. One thing that is needed is for a version number that comes as close to being an exact indicator of behavior as implementable, which can be set in config files. A second thing that is needed is a version number that obeys the "newer than" order that opam uses, to make sure that e.g. |
For the situation when e.g. the sources of ocamlformat are checked out in duniverse, I presume that the checked out source files can be changed relative to the repo, and so just using a fixed version analogous to what can be done for pinning doesn't work. Is there a way to detect if the source files have been changed? If so, we could perhaps do something like use a manually declared version if the sources are unchanged, and otherwise use the VCS hash from the duniverse. Or maybe just manually md5sum the sources ourselves no matter the context. |
Could we just declare a |
ping @emillon |
The goal of having If the goal is to make the version string independent of VCS, could we ask dune for the list of source files and md5sum them ourselves? |
I think my point was that some ocamlformat versions behave the same way but are built from a different commit. For example, ocamlformat 0.15.0 and ocamlformat 0.15.1. When checking This feature request is not blocking anything so I'm fine with closing it too. |
I think it can make sense to accept some pattern matching on the version number, just having a This feature looks distant from the original issue though, so I'm closing it. |
Hi,
At the moment version numbers are used for two things:
ocamlformat --version
.version=
field in.ocamlformat
files.Comparing to dune, the first one corresponds to the dune version, and the second one to the dune lang version. We require tighter coupling between these two. It's actually a 1:1 mapping so they are not considered two different things. This piece of data is sourced from the VCS using
gen_version
or, after #1133, bydune-build-info
.This approach of using the same source for both has some limitations:
ocamlformat
sources are embedded in a different repository (such as a different workspace or duniverse)I suggest that instead of having the lang version to be derived from the tool version, there's a
current_version
embedded somewhere in the code and that is bumped manually at each release.We already embed some version numbers in the source code to say that this option has been deprecated in version X, or that it has been removed in version Y. That mechanism would be ported to this new version type.
As a side note, the usage of
dune-build-info
requires special care because dev binaries do not have proper version info. This solves this problem, since it would affect only the output ofocamlformat --version
(which is mostly cosmetic), and not version checks.The text was updated successfully, but these errors were encountered: