Skip to content

Commit c16c23a

Browse files
committed
git-artifacts(snapshots): work around a bug in git fetch <bundle>
As part of the snapshot builds via the `git-artifacts` workflow, we try to import the tag from a bundle. This uncovered a bug that is over 17 years old, and which I am trying to fix via gitgitgadget/git#1857. The symptom is that just after fetching the refs, when looking through the fetched revisions whether a recursive fetch is needed, Git fails to `mmap()` the newly-imported packfile. The symptom looks like this: From [...]/git.bundle * tag <tag> -> FETCH_HEAD * [new tag] <tag> -> <tag> fatal: mmap: could not determine filesize Curiously, this only happens on 32-bit Windows, not on 64-bit Windows, nor on Linux or macOS. The explanation is most likely to be found in how quickly file descriptor values are used again after closing them, which would appear to be _really_ quickly on i686 Windows. Be that as it may, to work around this issue, we simply avoid any operation that would need to access the just-imported packfile in `git fetch <bundle>`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 3dce3f0 commit c16c23a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ jobs:
246246
then
247247
git fetch origin "refs/tags/$EXISTING_GIT_TAG:refs/tags/$EXISTING_GIT_TAG"
248248
else
249-
git fetch --tags "$GITHUB_WORKSPACE"/bundle-artifacts/git.bundle \
249+
git -c fetch.writeCommitGraph=false fetch --tags --no-recurse-submodules \
250+
"$GITHUB_WORKSPACE"/bundle-artifacts/git.bundle \
250251
$(cat "$GITHUB_WORKSPACE"/bundle-artifacts/next_version)
251252
fi &&
252253
git reset --hard $(cat "$GITHUB_WORKSPACE"/bundle-artifacts/next_version)

0 commit comments

Comments
 (0)