-
Notifications
You must be signed in to change notification settings - Fork 194
Fix pkg_tar directory entries #647
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,20 @@ genrule( | |
cmd = "for i in $(OUTS); do echo 1 >$$i; done", | ||
) | ||
|
||
genrule( | ||
name = "generate_dir_file", | ||
outs = ["lib"], | ||
cmd = "mkdir -p $@; echo 1 >$@/nsswitch.conf", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a case we should actively support. It doesn't work in remote build situations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well the behavior is at least currently inconsistent with zip files so not sure what best option here is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this ctx.actions.declare_directory based rule look correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That looks mostly right. It does a declare_directory, then passes the .path of that to some tool to fill in. |
||
) | ||
|
||
pkg_tar( | ||
name = "test_tar_dir_file", | ||
srcs = [ | ||
":generate_dir_file", | ||
], | ||
out = "dir_file.tar", | ||
) | ||
|
||
directory( | ||
name = "generate_tree", | ||
contents = "hello there", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the place we should fix it.
For correctness, it needs to be in pkg.bzl, where we test that the input file has
is_directory
set. But we are already doing that.