You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build of a package for an ocaml product, where the source tarball gets unpacked in a build tree inside a git-managed tree. In our case it is a RPM build, but the default setup for a Yocto tree would be similar.
Expected Behavior
When dune-project has a (version whatever) statement, this doc makes me expect to get that that version in build_info
Actual Behavior
The binaries get a git describe string instead of the version specified in dune-project.
On a CentOS 7 base, this happens only when the git tree is actually dirty, which makes me wonder whether the doc matches the actual behavior; on AlmaLinux 10 with the same ocaml and dune versions starting with the same clean git tree, after the dune install run the tree is seen as dirty with no actual diff (by git diff-index HEAD and gitk), and git update-index --refresh (or git status) syncs back the index and confirms no actual diff is present.
Since the git tree under which the build occurs is not the one for the package, it would make sense to use the GIT_CEILING_DIRECTORIES envvar to prevent git from looking in the directory above the one containing dune-project. This could possibly be a job for dune itself, but as of today I would have to set it myself... but AFAICT this envvar does not get propagated by dune to child processes, so this workaround is also unavailable.
even with a version statement in dune-project a call to git describe is issued
as an added woe, setting GIT_CEILING_DIRECTORIES in environment to protect from git describe looking at an unrelated history has no effect (could it be that
let ic, oc, ec =Unix.open_process_args_full path args (Unix.environment ()) in
purges the environment?)
Reproduction
Starting from a dune init project and adding the code from the doc, my reproduction attempts are blocked by the lack of DUNE_PLACEHOLDER in the resulting binary - however, the program indeed accesses the version, as if the version string was hardcoded from the start. Help on this gladly accepted :)
Specifications
Version of dune (output of dune --version): 3.15.3
Version of ocaml (output of ocamlc --version): 4.14.2
Operating system (distribution and version): AlmaLinux 10 beta (and CentOS 7)
Additional information
For now the only workaround seem to be patching the dune-installed binaries to replace the spurious git describe output with the actual version string.
Wrapping up
There are indeed several items coming out of the initial symptom, maybe it would be worth opening separate issues for those?
undocumented precedence of git describe on explicit version when the tree is dirty
lack of ability to use DUNE_PLACEHOLDER envvar
possible use of DUNE_PLACEHOLDER directly by dune
dune install dirtying the git tree
reproduction of DUNE_PLACEHOLDER use (and possibly extend the documentation to help with its understanding)
The text was updated successfully, but these errors were encountered:
Context
Build of a package for an ocaml product, where the source tarball gets unpacked in a build tree inside a git-managed tree. In our case it is a RPM build, but the default setup for a Yocto tree would be similar.
Expected Behavior
When
dune-project
has a(version whatever)
statement, this doc makes me expect to get that that version inbuild_info
Actual Behavior
The binaries get a
git describe
string instead of the version specified indune-project
.On a CentOS 7 base, this happens only when the git tree is actually dirty, which makes me wonder whether the doc matches the actual behavior; on AlmaLinux 10 with the same
ocaml
anddune
versions starting with the same clean git tree, after thedune install
run the tree is seen as dirty with no actual diff (bygit diff-index HEAD
andgitk
), andgit update-index --refresh
(orgit status
) syncs back the index and confirms no actual diff is present.Since the git tree under which the build occurs is not the one for the package, it would make sense to use the
GIT_CEILING_DIRECTORIES
envvar to preventgit
from looking in the directory above the one containingdune-project
. This could possibly be a job fordune
itself, but as of today I would have to set it myself... but AFAICT this envvar does not get propagated bydune
to child processes, so this workaround is also unavailable.version
statement indune-project
a call togit describe
is issuedGIT_CEILING_DIRECTORIES
in environment to protect fromgit describe
looking at an unrelated history has no effect (could it be thatdune/boot/duneboot.ml
Line 218 in 3fc17ee
Reproduction
Starting from a
dune init project
and adding the code from the doc, my reproduction attempts are blocked by the lack ofDUNE_PLACEHOLDER
in the resulting binary - however, the program indeed accesses the version, as if the version string was hardcoded from the start. Help on this gladly accepted :)Specifications
dune
(output ofdune --version
): 3.15.3ocaml
(output ofocamlc --version
): 4.14.2Additional information
For now the only workaround seem to be patching the dune-installed binaries to replace the spurious
git describe
output with the actual version string.Wrapping up
There are indeed several items coming out of the initial symptom, maybe it would be worth opening separate issues for those?
git describe
on explicit version when the tree is dirtyDUNE_PLACEHOLDER
envvarDUNE_PLACEHOLDER
directly bydune
dune install
dirtying the git treeDUNE_PLACEHOLDER
use (and possibly extend the documentation to help with its understanding)The text was updated successfully, but these errors were encountered: