Skip to content

pkg_tar: Fix #948: Don't add duplicate directory members to tar file when a symlink with the same path exists#949

Merged
tonyaiuto merged 3 commits intobazelbuild:mainfrom
nickguletskii:bugfix/duplicate_directory_when_symlink_exists
Apr 11, 2025
Merged

pkg_tar: Fix #948: Don't add duplicate directory members to tar file when a symlink with the same path exists#949
tonyaiuto merged 3 commits intobazelbuild:mainfrom
nickguletskii:bugfix/duplicate_directory_when_symlink_exists

Conversation

@nickguletskii
Copy link
Copy Markdown
Contributor

@nickguletskii nickguletskii commented Apr 6, 2025

Fixes #948.

I've modified the deduplication logic to account for the fact that directories must not have the same path as other types of files. Previously, the paths /lib and /lib/ would be treated differently.

Two test cases are included: one for symlinks preceding directories, and one for directories preceding symlinks. In both cases, the first member is preserved and the second member with the same path is discarded as a duplicate.

Copy link
Copy Markdown
Collaborator

@cgrindel cgrindel left a comment

Choose a reason for hiding this comment

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

LGTM.

@tonyaiuto tonyaiuto merged commit 106429f into bazelbuild:main Apr 11, 2025
3 checks passed
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.

pkg_tar: Combining tar files where directories shadow symlinks results in duplicate tar file members with the same name

3 participants