Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify tar file format explicitly #17679

Closed
wants to merge 2 commits into from
Closed

Specify tar file format explicitly #17679

wants to merge 2 commits into from

Conversation

ahryniv
Copy link

@ahryniv ahryniv commented Mar 7, 2023

In Python 3.8. default format of tarfiles was changed to PAX_FORMAT.

dpkg rejects deb packages that use tarfiles with PAX format with an "unsupported PAX tar header type" message.

Added optional parameter --format to set tar format explicitly. If it's not set tarfile.DEFAULT_FORMAT would be used.

see related:

@sgowroji sgowroji added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website awaiting-review PR is awaiting review from an assigned reviewer labels Mar 7, 2023
@@ -47,7 +47,7 @@ def __init__(self,
self.preserve_mtime = preserve_tar_mtimes

self.fileobj = None
self.tar = tarfile.open(name=name, mode=mode, fileobj=self.fileobj)
self.tar = tarfile.open(name=name, mode=mode, fileobj=self.fileobj, format=tarfile.GNU_FORMAT)
Copy link

Choose a reason for hiding this comment

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

If you hope to push this upstream you shouldn't set format=tarfile.GNU_FORMAT in the tarfile.open method invocation, but rather define an additional named argument to the TarFileWriter constructor called "format" with a default value (e.g format=tarfile.DEFAULT), then pass that into the tarfile.open() function.

Copy link
Contributor

@aiuto aiuto left a comment

Choose a reason for hiding this comment

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

We will not take this patch. The internal pkg_tar is deprecated and slowly being removed. Users must migrate to https://github.com/bazelbuild/rules_pkg.

@aiuto aiuto closed this Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants