-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
[Bug]: mtree_spec line order affects tar directory structure #749
Comments
Thanks, can you isolate this a bit more? Is that genrule that does the manipulation at fault, or can you reproduce a bug without it? I think it's probably intentional that the order of mtree lines affects the tar. mtree has support for state, like you can effectively "cd somedir" and then subsequent lines are affected. |
Thanks for the reply and for taking a look! The issue seems to only reproduce for files the are in the root directory of the tar according to the mtree spec. Here's a repro case without the genrule to illustrate. Resulting tar has
Reordered mtree has
If the files are nested under a prefix, it also seems to work as I would expect:
Hope that helps clarify the issue. If it's intentional that the order of mtree lines affects the tar, seems like creating an |
this is how mtrees work, you either have to add |
Thanks @thesayyn, Seems like this is a nuance to the mtrees that is easy to trip over if you naively try to strip off a prefix from the Anyway, adding the |
What happened?
I am trying to create a tar using the
mtree_spec
andtar
helpers, but having an issue where the resulting tar has files in the incorrect locations.For example, in a directory structure like this
With BUILD file:
The resulting
mtree_spec
file looks like :But foo.tar has the
nginx-template-based.conf
file in theconf.d
folder instead of at the top level. If I manually supply a mspec sorted by depth instead of alphabetically, it works as expected.Version
Development (host) and target OS/architectures:
Output of
bazel --version
:bazel 6.5.0
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:bazel-lib-v2.4.1
Language(s) and/or frameworks involved:
How to reproduce
No response
Any other information?
No response
The text was updated successfully, but these errors were encountered: