Skip to content

Add opt-in TAR hard-link preservation support - #1376

Draft
wilx wants to merge 1 commit into
apache:masterfrom
wilx:tar-hard-link-preservation
Draft

wilx wants to merge 1 commit into
apache:masterfrom
wilx:tar-hard-link-preservation

Conversation

@wilx

@wilx wilx commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

This draft PR hinges on acceptance of both companion PRs:

  • Plexus Archiver #493, which adds TAR hard-link support and opt-in preservation.
  • Plexus IO #191, which provides the resource identity capability used to preserve eligible hard links.

The development dependencies use their snapshots. We will replace them with concrete releases when those releases are available.

Changes

Enables TAR hard-link preservation through the existing archiverConfig parameter with <preserveHardLinks>true</preserveHardLinks>. Preservation is disabled by default. Eligible untransformed resources share one payload, with subsequent entries pointing backward to the first entry's final mapped archive name. Filtering, line-ending transformations, unrelated files with matching bytes, and incompatible output metadata keep independent contents.

Covers plain TAR and the gzip, bzip2, xz, Snappy, and Zstandard TAR formats. The integration fixture checks default, explicitly disabled, and enabled configurations, mapped names, contents, and inode relationships.

Adopts Plexus Archiver 5, raises the runtime requirements to Java 17 and Maven 3.9.6, updates the CI JDK matrix and requirements history, and migrates AssemblyProxyArchiver to the current resource, file-set, and FileTime APIs. Documents the required migration and recompilation of custom handlers using removed Archiver APIs.

Validation

  • 274 Assembly unit tests passed.
  • The hard-link integration fixture and all six container-descriptor integration scenarios passed using Java 17 and Maven 3.9.6.
  • All 18 TAR variants passed header and content checks. GNU tar 1.35 and bsdtar 3.7.2 extracted the decompressed TAR payloads and verified every file's contents and every pair's inode relationship. Default/disabled archives contained no hard-link headers; enabled archives contained exactly the two intended mapped backward links.
  • The original mapped extraction-hook reproducer now passes against the local Archiver follow-up. A migrated custom handler callback using the current Archiver interface also passed.
  • Companion validation: 676 Archiver tests passed with four skips; 61 IO tests passed without skips.

Validation used IO 8cf1d9a and local Archiver 3e29b954, including the extraction-hook compatibility follow-up. That Archiver follow-up is not yet published in #493, whose current head is 4b2cc87d.

Validation covers Linux. The full Assembly integration suite, Windows, and macOS were not run.

Checklist

  • Your pull request should address just one issue, without pulling in other changes.

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.

  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.

  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.

  • You have run the integration tests successfully (mvn -Prun-its verify).
    The focused integration scenarios listed above passed; the full suite was not run.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

  • In any other case, please file an Apache Individual Contributor License Agreement.

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.

1 participant