Skip to content

Commit 3ade9a9

Browse files
committed
Remove spurious leading @ from target name
Since `repository_name()` already contains leading `@`, we don't need to prefix it with `@`. Previously, it would produce double at-sign `@@` addressing [canonical repository name](https://bazel.build/external/overview#canonical-repo-name) which is a syntax introduced in Bazel 6.0, so it failed to run aquery command on Bazel < 6.0.
1 parent 3cf87f6 commit 3ade9a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refresh_compile_commands.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def refresh_compile_commands(
7979

8080
# Make any package-relative labels absolute
8181
targets = {
82-
target if target.startswith("/") or target.startswith("@") else "@{}//{}:{}".format(native.repository_name(), native.package_name(), target.removeprefix(":")): flags for target, flags in targets.items()
82+
target if target.startswith("/") or target.startswith("@") else "{}//{}:{}".format(native.repository_name(), native.package_name(), target.removeprefix(":")): flags for target, flags in targets.items()
8383
}
8484

8585
# Create a wrapper script that prints a helpful error message if the python version is too old, generated from check_python_version.template.py

0 commit comments

Comments
 (0)