Closed matts1 closed 2 months ago
Build failures appear to be for an unrelated reason.
It's not unrelated, the test runs on skylib itself and you thus need to add the new directory directories
you created.
Ah, thanks, I was in a hurry when I looked at it last and didn't get a chance to fully check it out. Should be fixed now.
The handling of this would be a lot simpler if this Bazel bug was fixed: https://github.com/bazelbuild/bazel/issues/12954
Would it make sense to have a single directory
rule instead?
directory(
name = "root",
dir = ":__pkg__", # special-case "__pkg__" to match the existing special-cased label.
srcs = glob(["**"]),
)
directory(
name = "subdir",
dir = ":a",
srcs = glob(["a/**"]),
)
I first created this rule to better support sysroots inside rules_cc (https://github.com/bazelbuild/bazel/issues/20334).
However, upon review, @t-rad679 wrote "This issue of wanting packages (directories) instead of individual target labels is coming up frequently for me. Maybe we could reuse this provider for use cases other than sysroot?".
I think this is sufficiently broadly applicable to work with anything. For example, here is some things I plan to do with it down the line:
@armandomontanez FYI
Note: for now, I haven't written any documentation, but I can add them once the concept gets approval.