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

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

Conversation

nickguletskii
Copy link
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
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
3 participants