-
Notifications
You must be signed in to change notification settings - Fork 458
Description
Our project uses the re2 library. Presently this is named "com_google_re2" in our workspace, but I'm trying to rename the repository to follow more common conventions.
This rename gives me a BUILD.bazel file with the following:
cc_library(
name = ...
deps = [
...
"@re2//:re2"
]
)
After running buildifier on it the deps are rewritten to:
deps = [
...
"@re2",
...
]
This rewrite causes bazel build errors like:
ERROR: git/tensorstore/tensorstore/util/BUILD?l=694:23: no such package '@@re2//': The repository '@@re2' could not be resolved: '@@re2' is not a repository rule and referenced by '//tensorstore/util:unit'
I believe that this is incorrect; buildifier should leave this dep as-is since in @re2//:re2, the repository is re2, the package is the empty string, and the target is re2.
This behavior is tested in build/testdata/019.build.golden
// Second, it removes redundant target qualifiers, turning labels like
// "//third_party/m4:m4" into "//third_party/m4" as well as ones like
// "@foo//:foo" into "@foo".
Line 291 in f37c35d
| } else if m[3] != "" && m[4] == "" && m[3] == m[5] { // e.g. @foo//:foo |