Skip to content

Preserve leading "./" in paths for Debian package compatibility #51

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vrmiguel
Copy link

@vrmiguel vrmiguel commented Apr 4, 2025

Hi @charliermarsh, congrats on the project!

This PR suggests fixing Header::set_path's 'incorrect' behavior of stripping away the leading dot-slash in paths.
The reasoning for this is that Debian/Ubuntu packaging (.debs) require their data tarballs to state their entries as follows:

drwxr-xr-x root/root         0 2023-07-29 15:58 ./
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/postgresql/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/postgresql/15/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/postgresql/15/lib/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/postgresql/15/lib/bitcode/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/postgresql/15/lib/bitcode/vector/
drwxr-xr-x root/root         0 2023-07-29 15:58 ./usr/lib/postgresql/15/lib/bitcode/vector/src/
-rw-r--r-- root/root     20460 2023-07-29 15:58 ./usr/lib/postgresql/15/lib/bitcode/vector/src/ivfbuild.bc

The current tar-rs processing instead converts those into:

drwxr-xr-x root/root         0 2023-07-29 15:58 ./
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/postgresql/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/postgresql/15/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/postgresql/15/lib/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/postgresql/15/lib/bitcode/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/postgresql/15/lib/bitcode/vector/
drwxr-xr-x root/root         0 2023-07-29 15:58 usr/lib/postgresql/15/lib/bitcode/vector/src/
-rw-r--r-- root/root     20460 2023-07-29 15:58 usr/lib/postgresql/15/lib/bitcode/vector/src/ivfbuild.bc

The lack of leading dot-slash in the files above makes Debian tooling (apt/dpkg) to extract files in the incorrect folders, or reject the .deb entirely (now I can't recall for sure)

This has been a known tar-rs issue for years, described in issues such as alexcrichton/tar-rs#263 and alexcrichton/tar-rs#335, but we haven't had much luck in hearing back from Alex, so I suppose it's better to try to fix this here, downstream

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