Windows CI: tar-patch returns exit code 0 when source file missing (local Windows returns 1)

Open
#104 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
github-actions, go
Domain
ci-cd, cli, testing

Research direction

Start with the Windows CI test case that runs tar-patch for the missing solo/data/only.txt member, then inspect the tar-patch entry point and compare its exit status locally and in GitHub Actions. Reproduce the failure and verify that malformed output is removed when patch application fails, while the test still expects exit code 1.

Written by the indexing model from the issue text.

Description

The test-case assertion forces the creation of a source file that will be opened and used for the delta, but deletes it from the source directory right before .\tar-patch is run.

mkdir -p "$TEST_DIR/solo/data" "$TEST_DIR/solom/data" head -c 4096 /dev/zero >"$TEST_DIR/solo/data/only.txt" cp -a "$TEST_DIR/solo/data/only.txt" "$TEST_DIR/solom/data/only.txt" printf 'patched' | dd of="$TEST_DIR/solom/data/only.txt" bs=1 seek=2000 conv=notrunc status=none 2>/dev/null || \ printf 'patched' | dd of="$TEST_DIR/solom/data/only.txt" bs=1 seek=2000 conv=notrunc 2>/dev/null create_tar "$TEST_DIR/solo-old.tar" "$TEST_DIR/solo" create_tar "$TEST_DIR/solo-new.tar" "$TEST_DIR/solom" ./tar-diff -max-bsdiff-size 64 "$TEST_DIR/solo-old.tar.gz" "$TEST_DIR/solo-new.tar.bz2" "$TEST_DIR/solo.tardiff" rm -f "$TEST_DIR/solo/data/only.txt" if [[ -e "$TEST_DIR/solo/data/only.txt" ]]; then echo "expected solo/data/only.txt removed before tar-patch" >&2 exit 1 fi expect_fail "tar-patch missing source member" ./tar-patch "$TEST_DIR/solo.tardiff" "$TEST_DIR/solo" "$TEST_DIR/solo-out.tar"

All other runners successfully pass this test except for the Windows runner on GitHub Actions. To verify the tar-patch behavior on Windows, a Windows Server 2025 environment was set up locally on a virtual machine. Once the source file is deleted for testing purposes, we get the following error message:

Error applying diff: open extracted\test_dir\only.txt: The system cannot find the file specified.

On local Windows Server, the tool correctly displays the error message and exits with code 1 (failure). However, in the Windows CI environment, tar-patch exits with code 0 (success), causing the test to fail with: expected failure for: tar-patch missing source member.With both reconstructed.tar and original.tar SHA sums differing, this proves the patch application was unsuccessful and should have exited with
code 1.

In addition to investigating why the Windows CI environment exits with code 0 when local Windows correctly exits with code 1, a cleanup mechanism should also be implemented to remove malformed outputs. This will ensure users are not left with the impression that the tool succeeded when it didn't.

The current resolution is to skip this test on Windows while we investigate this issue.

Dominant language
Go
Stars
66
Forks
27
Avg merge
14d 3h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from containers/tar-diff

All issues in containers/tar-diff

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.