-
Notifications
You must be signed in to change notification settings - Fork 444
Closed
Milestone
Description
The Dune cache uses Vcs.commit_id
as an input to the Dune cache here. Unfortunately, this commit ID might not always exist: when using Git, HEAD
doesn't exist in commit-less repositories:
$ git init
Initialized empty Git repository in $TESTCASE_ROOT/.git/
$ $ dune subst 2>&1 | sed 's/\/tmp\/.*.output/<tmp_file>/g'
git (internal) (exit 128)
/usr/bin/git describe --always --dirty > <tmp_file>
fatal: bad revision 'HEAD'
git (internal) (exit 128)
/usr/bin/git rev-parse HEAD > <tmp_file>
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
git (internal) (exit 128)
/usr/bin/git ls-tree -r --name-only HEAD > <tmp_file>
fatal: Not a valid object name HEAD
As of today, this is also triggerable via dune build
with the cache enabled:
$ DUNE_CACHE=enabled dune build
git (internal) (exit 128)
/usr/bin/git rev-parse HEAD > /tmp/buildd528b2.dune/dune6c093a.output
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[1]
As discussed in #4430, the latter case is going away for unrelated reasons.
Obviously only a tiny problem, but seemed worth a bug report.
Reproduction
See #4430.