Skip to content

Commit 53568f4

Browse files
committed
git-artifacts: try creating MINGW-packages.bundle a couple times if needed
In private tests, this command seems to have failed consistently, with this error message: + git commit -s -m 'mingw-w64-git: new version (test)' PKGBUILD [test e641948] mingw-w64-git: new version (test) 1 file changed, 2 insertions(+), 2 deletions(-) + git bundle create /d/a/test/test/artifacts/MINGW-packages.bundle 'test^..test' error: pack-objects died Error: Process completed with exit code 1. After extensive debugging of this elusive problem (it is relatively consistent when running inside a workflow step, but running it interactively via `action-tmate` succeeds every single time), the most plausible explanation is that Defender doing its thing, and that results in a "Permission Denied" problem. Calling the command with `GIT_TRACE2_EVENT` enabled seems to work around the problem, and just in case it does not, let's add a loop to try a couple more times should the command fail. In the end, just validate the bundle to make sure that it was created correctly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 8be790e commit 53568f4

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,35 @@ jobs:
411411
if test -z "$EXISTING_GIT_TAG"
412412
then
413413
git commit -s -m "mingw-w64-git: new version ($version)" PKGBUILD &&
414-
git bundle create "$b"/MINGW-packages.bundle \
415-
"origin/$RELEASE_BRANCH..$RELEASE_BRANCH"
414+
for seconds in 1 3 10 15
415+
do
416+
GIT_TRACE2_EVENT=1 \
417+
git bundle create "$b"/MINGW-packages.bundle \
418+
"origin/$RELEASE_BRANCH..$RELEASE_BRANCH" &&
419+
break
420+
# to ease debugging
421+
git bundle verify "$b"/MINGW-packages.bundle ||:
422+
sleep $seconds
423+
done &&
424+
git bundle verify "$b"/MINGW-packages.bundle
416425
elif ! git update-index --ignore-submodules --refresh ||
417426
! git diff-files --ignore-submodules ||
418427
! git diff-index --cached --ignore-submodules HEAD
419428
then
420429
echo "::warning::Uncommitted changes after build!" >&2 &&
421430
git diff >&2 &&
422431
git commit -s -m "mingw-w64-git: new version ($version)" PKGBUILD &&
423-
git bundle create "$b"/MINGW-packages.bundle \
424-
"$RELEASE_BRANCH^..$RELEASE_BRANCH"
432+
for seconds in 1 3 10 15
433+
do
434+
GIT_TRACE2_EVENT=1 \
435+
git bundle create "$b"/MINGW-packages.bundle \
436+
"$RELEASE_BRANCH^..$RELEASE_BRANCH" &&
437+
break
438+
# to ease debugging
439+
git bundle verify "$b"/MINGW-packages.bundle ||:
440+
sleep $seconds
441+
done &&
442+
git bundle verify "$b"/MINGW-packages.bundle
425443
fi)
426444
- name: Cache ${{env.MINGW_PACKAGE_PREFIX}}-git
427445
if: steps.restore-cached-git-pkg.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)