Skip to content

Commit

Permalink
git-artifacts(snapshots): work around a bug in git fetch <bundle>
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dscho committed Jan 26, 2025
1 parent 01ac2f7 commit fe95907
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/git-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ jobs:
then
git fetch origin "refs/tags/$EXISTING_GIT_TAG:refs/tags/$EXISTING_GIT_TAG"
else
git fetch --tags "$GITHUB_WORKSPACE"/bundle-artifacts/git.bundle \
git -c fetch.writeCommitGraph=false fetch --tags --no-recurse-submodules \
"$GITHUB_WORKSPACE"/bundle-artifacts/git.bundle \
$(cat "$GITHUB_WORKSPACE"/bundle-artifacts/next_version)
fi &&
git reset --hard $(cat "$GITHUB_WORKSPACE"/bundle-artifacts/next_version)
Expand Down

0 comments on commit fe95907

Please sign in to comment.