Skip to content

Pack and check the release tarballs with GNU tar in a Linux container - #852

Merged
wu-sheng merged 1 commit into
mainfrom
release-tar-in-linux
Nov 26, 2026
Merged

wu-sheng merged 1 commit into
mainfrom
release-tar-in-linux

Conversation

@wu-sheng

@wu-sheng wu-sheng commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Fix the release tarballs carrying macOS extended attributes (apache/skywalking#14271)

  • Add a unit test to verify that the fix works. The release script has no unit tests; it was verified by running the changed lines, below.
  • Explain briefly why the bug exists and how to fix it.

Why

The 9.8.0 tarballs were packed on macOS. #828 set COPYFILE_DISABLE=1, which keeps out the AppleDouble ._* entries, but macOS tar still stored each file's com.apple.provenance attribute as an extended header: all 217 entries of the binary tarball and all 13,705 of the source tarball carry one. GNU tar does not know the header, so unpacking on Linux prints Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance' once per entry. The agent itself is fine: on RHEL 9.9 with GNU tar 1.34 the binary tarball prints 217 warnings, exits 0, and its 207 files come out byte-identical to the archive's.

On macOS, tar can store a file's extended attributes (such as com.apple.provenance) in two ways: as an AppleDouble ._* entry beside the file, unless COPYFILE_DISABLE=1 is set, and as extended (pax) headers. GNU tar on Linux unpacks each ._* entry as a stray file, and prints Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance' for each such header. Each of these repositories packed its release tarballs with its own tar command on the release manager's machine, so each earlier fix was a different set of host flags, and a release was only as clean as the flags its repository happened to have.

What changes

linux-tar.sh runs GNU tar in a pinned Linux image (debian:bookworm-slim, pinned by its multi-arch digest). The container does not see macOS attributes and GNU tar creates no ._* entries, so there is no host flag left to forget. Only tar runs in the container; builds, GPG signing and checksums stay on the release manager's machine. It has three commands:

  • check: Docker is installed and its daemon is running.
  • pack <dir> <tar arguments>: runs GNU tar with <dir> as its working directory.
  • verify <tarball>...: unpacks each tarball with GNU tar in a fresh container from the same image, the way a Linux user would, and fails on any tar warning or any ._* file.

In this repository:

  • release.sh stage packs the source tarball and the binary tarball (skywalking-agent/) with linux-tar.sh pack, and runs linux-tar.sh verify on each before signing it.
  • The tar, gpg and shasum lines move out of the Makefile's dist target into stage, which now runs make build. stage was the only caller of dist, so dist is removed.
  • preflight runs linux-tar.sh check, so a missing Docker fails before the long Maven build.
  • The release guide and CHANGES.md describe it.

How it was verified (macOS, Docker Desktop)

  • On a clone at v9.8.0, the new source command packs exactly the same 13,703 entries as the old command, and repacking the 9.8.0 skywalking-agent/ directory gives exactly the published binary tarball's 217 entries. Neither has extended-attribute headers, and both unpack on RHEL with no warnings.

  • The changed lines of stage, run with make build and gpg stubbed, produce both tarballs, their signatures and checksums.

  • verify fails both published 9.8.0 tarballs.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Reported in discussion Java-Agent 9.8 binary distribution (tarball) contains macOS metadata skywalking#14271.

  • Update the CHANGES log.

The same change, with the same linux-tar.sh: apache/skywalking#14272, apache/skywalking-mcp#48, apache/skywalking-swck#240, apache/skywalking-helm#208, apache/skywalking-client-js#202, apache/skywalking-nodejs#150.

stage packs the source and binary tarballs with tools/releasing/linux-tar.sh, which runs GNU tar
in a pinned Linux image instead of the host's tar, and unpacks each with GNU tar in that image
before signing it, stopping on any tar warning or any AppleDouble `._*` file. The Maven build and
the signing stay on the host. The tar, gpg and shasum lines move from the Makefile's `dist`
target, which only stage used, into stage, which now runs `make build`. Preflight requires Docker
with its daemon running.

The 9.8.0 tarballs were packed on macOS. COPYFILE_DISABLE=1 (#828) kept the `._*` entries out, but
tar still stored each file's com.apple.provenance attribute as a pax header, on all 217 entries of
the binary tarball and all 13,705 of the source tarball, and GNU tar prints "Ignoring unknown
extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'" once per entry
(apache/skywalking#14271). The container does not see macOS attributes and GNU tar creates no
`._*` entries, so there is no host flag left to forget.

linux-tar.sh is one file, kept identical in the release scripts of skywalking, skywalking-java,
skywalking-mcp, skywalking-swck, skywalking-helm, skywalking-client-js and skywalking-nodejs.
@wu-sheng
wu-sheng force-pushed the release-tar-in-linux branch from 4882057 to 69fa70e Compare November 26, 2026 12:44
@wu-sheng wu-sheng added this to the 9.9.0 milestone Nov 26, 2026
@wu-sheng
wu-sheng merged commit f357c61 into main Nov 26, 2026
10 checks passed
@wu-sheng
wu-sheng deleted the release-tar-in-linux branch November 26, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants