Skip to content

sdist format: qualify pax compatibility - #2108

Open
woodruffw wants to merge 1 commit into
mainfrom
ww/pax
Open

sdist format: qualify pax compatibility#2108
woodruffw wants to merge 1 commit into
mainfrom
ww/pax

Conversation

@woodruffw

@woodruffw woodruffw commented Aug 18, 2026

Copy link
Copy Markdown
Member

I'm opening this as a direct living spec PR, since it's arguably just a clarification of the existing requirement, not a new one 🙂. However, if there's disagreement about that, I'm happy to take this to DPO for discussion first.

My rationale: the sdist spec already says that the tarball must be a POSIX.1-2001 pax archive. This implies a bunch of things that people may not realize, but are already fully covered by that requirement. For example, GNU-style tar files are not pax-conforming (they use a different magic and have special extended value encoding rules), and the S typeflag is GNU-specific.

There's a passable argument to be made that GNU.sparse.* is pax-conforming, since they're pax-style records. However:

  1. Some versions of GNU.sparse.* are illegal to represent in pax, since they use duplicated record names;
  2. GNU.sparse.* in general changes the framing logic, making it hard to correctly model the parse of a sparse member with a standard pax-conforming parser.

Finally, I think the most controversial part of this is adding a NOT RECOMMENDED for other pax-style (but not standard) vendor records. These are technically allowed in pax, just not defined by the standard themselves. However, they're also subject to a bunch of interoperability problems. For example, SCHILY.xattr is sometimes encoded as raw binary, which is not pax-conforming and causes problems for standard parsers.

(And more generally, Python source distributions have no business encoding xattrs or anything like that, from what I can tell 🙂)


📚 Documentation preview 📚: https://python-packaging-user-guide--2108.org.readthedocs.build/en/2108/

Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw

Copy link
Copy Markdown
Member Author

CCing some other folks who I think might be interested: @konstin @miketheman

whatever information they need in the sdist to build the project.

The tarball must use the modern POSIX.1-2001 pax tar format, which specifies
The tarball MUST use the modern POSIX.1-2001 pax tar format, which specifies

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the lowercasing of this "must" wasn't meant to de-emphasize its normativity, so I'm uppercasing it.

Comment on lines +88 to +89
The use of pax-style vendor extensions (such as ``SCHILY.xattr`` or ``LIBARCHIVE.xattr``)
is NOT RECOMMENDED for interoperability reasons.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hear you on the trying to soften the blow, but if one goal of the Python packaging ecosystem is to remain compatible and interoperable, why not draw the line stronger, and save some future selves from having to deal with this?

Comment on lines +81 to +83
Source distributions MUST NOT use non-pax features, even if those features are
structurally compatible with the pax standard. Installers and other consumers MAY
reject source distributions that are not strictly pax-conforming.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe come right out with it?
"sdists must not include any pax Vendor Extensions"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only reason was that these are technically pax conforming in a more meaningful sense. So I didn't want to jump to changing the plain meaning of the spec itself, but if nobody objects...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I read this in the wrong section. Yeah, I'll strengthen this.

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