I am trying to display build info via using dune-build-info library. However, it always seems to be None. Looking at the documentation for Build_info.V1.Version.version, I can see it mentioned the following:
(** The version at which the current executable was built. The version is
[None] during development, it is only [Some _] once the executable is
installed or promoted to the source tree. *)
What does promoted to the source tree mean?
I tried dune exec --profile release ./version.exe and also _build/default/version.exe. But both cases seem to give me None. The source is committed to a git repo. How does one get Some v?
You need to install your program (dune install) or promote it by adding a (promote ..) field to your executable stanza, see Stanza Reference — Dune documentation.
I am bit curious how this works? I manually copied the exe from _build and put it in the same dir. However, in that case I still get None. What does dune promote do? Does it do some processing to the .exe file?
Interesting, the documentation for promote doesn’t mention this and I can’t figure out from the source how a promote might be doing artifact substitution. Any pointers on where to look?