Skip to content

Deb normalization test fails on macOS because ar pads extracted members #1438

Closed

Description

@AnthonyRonning

test_deb_normalization_refreshes_checksums_and_verifier_rejects_tampering in scripts/ci/test_linux_rpm_packaging.py fails on macOS. It runs in the repo pre-commit component through scripts/ci's test discovery, so any Mac commit that touches workflows, CI scripts or release metadata stops there until the component is excluded with MAPLE_HOOK_ONLY.

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Cause

normalize_deb_package extracts the package with ar x, then unpacks the members with tar -xzf. In the .#ci shell on macOS, ar resolves to the cctools/LLVM wrapper. It pads each member to an 8-byte boundary with 0x0a bytes and counts that padding in the member's size, so ar x returns a larger file than went in. GNU gzip 1.15 then exits 2 on the trailing bytes, and GNU tar 1.35 treats that as fatal.

Reproduce

From the repository root on macOS:

nix develop --no-update-lock-file .#ci -c bash -c '
  cd "$(mktemp -d)"; mkdir t; head -c 1001 /dev/urandom > t/f
  tar -czf data.tar.gz t; wc -c data.tar.gz
  ar crD p.a data.tar.gz; rm data.tar.gz; ar x p.a; wc -c data.tar.gz
  tail -c 4 data.tar.gz | xxd; tar -xzf data.tar.gz -C t; echo "tar exit $?"'
Original size Size after ar x Trailing bytes tar -xzf exit
1237 1240 0a0a0a 2
1236 1240 0a0a0a0a 2
1242 1248 0a0a0a0a0a0a 2

All eight sizes tried came back padded and failed the same way. The archive also starts with a BSD-format #1/12 __.SYMDEF member, so it is not the GNU-format ar file a Debian package expects.

Impact

This looks limited to local macOS runs. Reproduced at 6132c2b6 on an otherwise unchanged master, so it is not caused by any particular change. Debian packages are built on Linux runners with GNU binutils, and the hosted repo lane has passed on Linux, so shipped packages should not be affected.

Possible fixes

  • Skip this test unless running on Linux, since it needs GNU ar behaviour to mean anything.
  • Or provide GNU binutils ar for this test on Darwin, which would keep the coverage locally.

Either way, a Mac should be able to run the repo pre-commit component without excluding it.

Activity

  1. added
    bug
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions