bazelbuild / bazel-skylib

Common useful functions and rules for Bazel
https://bazel.build/
Apache License 2.0
394 stars 180 forks source link

Bug: `subpackages.all()` returns broken results when applied on root package #530

Closed kilian-funk closed 3 months ago

kilian-funk commented 3 months ago

The macro subpackages.all() delivers broken results when applied in a root package. This is due to a string manipulation not taking into account that the root package name is an empty string.

Assuming there is a package //foo. Then subpackages.all returns ["///foo"]. However, the expected result would be ["//foo"].

I have a pull request to fix this. I would be happy to contribute.