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

Dangling archive paths are not supported by pkg_tar #832

Open
eejayes opened this issue Mar 15, 2024 · 1 comment
Open

Dangling archive paths are not supported by pkg_tar #832

eejayes opened this issue Mar 15, 2024 · 1 comment
Labels
feature-request P3 An issue that we are not working on but will review quarterly

Comments

@eejayes
Copy link
Contributor

eejayes commented Mar 15, 2024

Common tar utilities allow inclusion of file paths with some depth to them, where the resulting archive does not include records for the parent directories and their corresponding file permissions. On the other hand, when pkg_tar is presented with a path where an explicit specification of a path's parent directories is not provided, records will automatically be created with a default set of file permissions. While fine-grained control of directory permission levels is available through pkg_mkdirs, it is not possible to instruct pkg_tar to refrain from creating file permission records for parents of a dangling path.

The common use case for a tar archive with a fragmented file structure, is one where extraction is being performed on top of a pre-existing file structure where only the paths specified in the archive should be subject to change. A work around of pkg_tars behavior with limited applicability could be to ensure that declared directory permissions for parent directories match the state of the pre-existing structure on the extraction target. Some more specialized use cases are:

  1. Parent directory records that a user doesn't want to specify correspond to paths on the extraction target that are not mounted as writable file systems. In this case an error will occur during extraction.
  2. Other expected factors on the extraction target can cause it's file system state to change that is not synchronized with the subject 'pkg_tar' specification.
@aiuto aiuto added feature-request P3 An issue that we are not working on but will review quarterly labels Mar 15, 2024
@aiuto
Copy link
Collaborator

aiuto commented Mar 15, 2024

This seems like a reasonable feature if anyone would like to implement it.

eejayes pushed a commit to eejayes/rules_pkg that referenced this issue Mar 15, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 15, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 15, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 20, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 20, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 20, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 20, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
eejayes added a commit to eejayes/rules_pkg that referenced this issue Mar 21, 2024
Add feature as described in bazelbuild#832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth are prevented in pkg_tar archives.
aiuto pushed a commit that referenced this issue Mar 21, 2024
Add feature as described in #832.

RELNOTES: Automatic creation of parent directory specifications for
paths with depth can be prevented in `pkg_tar` archives by setting `create_parents=False`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request P3 An issue that we are not working on but will review quarterly
Projects
None yet
Development

No branches or pull requests

2 participants