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

When pkg_tar.prefix_dir == base of symlink path, don't double-dip. #749

Merged
merged 21 commits into from
Oct 16, 2023

Conversation

aiuto
Copy link
Collaborator

@aiuto aiuto commented Sep 1, 2023

Correct for case where tar has prefix_dir and files/symlinks, but the user has already mapped the prefix_dir into those paths. Under the old behavior, prefix_dir was (incorrectly) not added to symlinks, so some users made the desired prefix part of the link. Protecting them against the double inclusion of the prefix is not strictly pedantic, but is the least surprising behavior, as their intent was most likely to get what the old behavior would have achived.

Add tests for this, which required improving verify_archive_test.

Along the way, it seems that tree artifacts with internal symlinks are a problem. This might be a bazel bug.
#750 is a reminder to look in to this some day.

user has already mapped the prefix_dir into those paths. Under the old
behavior, prefix_dir was (incorrectly) not added to symlinks, so some
users made the desired prefix part of the link.  Protecting them
against the double inclusion of the prefix is probably the least
surprising behavior.

Add tests for this, which required improving verify_archive_test.
@aiuto aiuto requested a review from sdtwigg September 1, 2023 20:46
tests/tar/BUILD Show resolved Hide resolved
@aiuto aiuto marked this pull request as ready for review September 3, 2023 02:10
@aiuto aiuto requested a review from alexeagle as a code owner September 3, 2023 02:10
@aiuto aiuto requested a review from jylinv0 as a code owner September 5, 2023 19:37
@aiuto aiuto requested a review from rbielak September 28, 2023 18:11
Copy link
Collaborator

@rbielak rbielak left a comment

Choose a reason for hiding this comment

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

lgtm

@aiuto aiuto merged commit 006af3e into bazelbuild:main Oct 16, 2023
1 check passed
@aiuto aiuto deleted the tar_symlink_dup branch October 16, 2023 20:10
@coffinmatician
Copy link

Why is pkg_tar-files now labeled as "obsolete"? I use this feature very heavily, and would be curious what the replacement for it is (or what I should be doing instead of using pkg_tar-files)?

@aiuto
Copy link
Collaborator Author

aiuto commented Oct 25, 2023 via email

@coffinmatician
Copy link

coffinmatician commented Oct 25, 2023

That makes sense, thank you for helping me out. I'll try converting our internal usage to pkg_files in the near future and see how it goes.

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.

4 participants