Windows binary release wrongly versioned
The binary release for Windows does not show the right version, eg for 0.21.0 I get:
$ ./ocamlformat.exe --version
0.21.0-4-gddca4a3-dirty
This makes it inconvenient to use with .ocamlformat files that specify a version.
I don't have a windows machine to confirm, but it looks like this comes from tools/build-mingw64.sh, are the tags missing, or dune subst shouldn't be executed? (cc @emillon)
To collect some data:
$ ./ocamlformat-0.20.0.exe --version
0.20.0-dirty
$ ./ocamlformat-0.21.0.exe --version
0.21.0-4-gddca4a3-dirty
$ ./ocamlformat-0.19.0.exe --version
0.19.0-dirty
$ ./ocamlformat-0.18.0.exe --version
0.18.0
or
dune substshouldn't be executed?
I don't remember why dune subst is in the script. Perhaps it is enough to remove it?
I removed the dune subst action and re-uploaded the binaries for 0.21.0 and 0.20.1 (0.20.0 and 0.19.0 don't build), is the problem fixed? I don't have a working windows environment to try.
I removed the
dune substaction and re-uploaded the binaries for 0.21.0 and 0.20.1 (0.20.0 and 0.19.0 don't build), is the problem fixed? I don't have a working windows environment to try.
Unfortunately, no, the dune subst seems necessary, but we need to make sure that the git checkout is at the right tag I guess:

I reverted the commit and regenerated binaries, they should be identical as the first ones you tried.
I also tried updating the checkout github action to use v3 (apparently there is some issue related to tags, some of it were fixed in v2), generated new binaries with this action and uploaded under the names
-
ocamlformat-0.21.0-checkout@v3 -
ocamlformat-0.20.1-checkout@v3
Is the version correct for these ones?
Is the version correct for these ones?
No:

I tried to reproduce locally by running the build-mingw64.sh script but it fails with

I will try to look further when I get time.
Fix in #2205