-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix(tar): append slash to top-level directory mtree entries #852
fix(tar): append slash to top-level directory mtree entries #852
Conversation
Thanks - you should be able to find somewhere in https://github.com/aspect-build/bazel-lib/blob/main/lib/tests/tar/BUILD.bazel that tickles this case, and assert that the new mtree matches some string |
I tried to introduce a test, however the main problem is that any file I create with |
Simple answer would be to add the test case to the root package in this repo with a comment about why we're doing something unusual |
0636e4f
to
76bf44c
Compare
Changes since last push:
|
Could I get another look at this please? :) |
Sorry the CI doesn't trigger for you automatically. Looks like there are some errors, can you reproduce them? |
Interesting, it seems like the output order of |
bsdtar's mtree format has a quirk wherein entries without "/" in their first word are treated as "relative" entries, and "relative" directories will cause tar to "change directory" into the declared directory entry. If such a directory is followed by a "relative" entry, then the file will be created within the directory, instead of at top-level as expected. To mitigate, we append a slash to top-level directory entries. Fixes bazel-contrib#851.
76bf44c
to
667f816
Compare
Sorry for the delay, I was on vacation. I've made the tests run the @alexeagle Could I get a re-run of the tests please? |
Thanks! |
bsdtar's mtree format has a quirk wherein entries without "/" in their first word are treated as "relative" entries, and "relative" directories will cause tar to "change directory" into the declared directory entry. If such a directory is followed by a "relative" entry, then the file will be created within the directory, instead of at top-level as expected. To mitigate, we append a slash to top-level directory entries.
Fixes #851.
Changes are visible to end-users: no
Test plan
//:tar_test13
,//lib/tests/tar:test14