package_group.packages does not accept packages in external repositories
bazel 0.6.0 linux
package_group.package does not allow labels in other packages. repro:
$ cat WORKSPACE
workspace(name = "main")
local_repository(
name = "foo",
path = "foo",
)
$ cat foo/BUILD
filegroup(
name = "foo",
visibility = [":my_package_group"],
)
package_group(
name = "my_package_group",
packages = ["@main//..."],
)
$ bazel build @foo//:foo
ERROR: /usr/local/google/home/ajmichael/.cache/bazel/_bazel_ajmichael/cb85aea2fd8fffc63d6f3e90b5e08db1/external/foo/BUILD:5:1: invalid package name '@main//...': must start with '//'.
ERROR: error loading package '@foo//': Package '' contains errors.
INFO: Elapsed time: 0.089s
I ran into this issue indirectly, where I want to add default lint rules for java. I'm not allowed to use //... because that will match external rules as well, and I find no way to exclude external packages (which presumably this issue would fix).
So I need to do something like:
package_group(
name = "javalint",
packages = [
"//every/...",
"//dir/...",
"//with/...",
"//java/...",
"//must/...",
"//be/...",
"//manually/...",
"//added/...",
],
)
when this should have been all that's needed:
package_group(
name = "javalint",
packages = [
"//...",
],
)
//... should not really match external rules at all, but as of 0.14 it does.
Any progress on this? Bazel 0.24 still doesn't allow external packages in package_groups.
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen (or ping me to reopen) if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.
Hi there, I just happened across this issue after attempting to make such a package group. It would be great if this feature could be added! 😃