11load ("//go:def.bzl" , "go_binary" , "go_library" )
22load (":aspect.bzl" , "bazel_supports_canonical_label_literals" )
3+ load ("//go/private:common.bzl" , "RULES_GO_REPO_NAME" )
34
45go_library (
56 name = "gopackagesdriver_lib" ,
@@ -21,19 +22,10 @@ go_library(
2122go_binary (
2223 name = "gopackagesdriver" ,
2324 embed = [":gopackagesdriver_lib" ],
25+ visibility = ["//visibility:public" ],
2426 x_defs = {
25- # Determine the name of the rules_go repository as we need to specify it when invoking the
26- # aspect.
27- # If canonical label literals are supported, we can use a canonical label literal (starting
28- # with @@) to pass the repository_name() through repo mapping unchanged.
29- # If canonical label literals are not supported, then bzlmod is certainly not enabled and
30- # we can assume that the repository name is not affected by repo mappings.
31- # If run in the rules_go repo itself, repository_name() returns "@", which is equivalent to
32- # "@io_bazel_rules_go" since Bazel 6:
33- # https://github.com/bazelbuild/bazel/commit/7694cf75e6366b92e3905c2ad60234cda57627ee
34- # TODO: Once we drop support for Bazel 5, we can remove the feature detection logic and
35- # use "@" + repository_name().
36- "rulesGoRepositoryName" : "@" + repository_name () if bazel_supports_canonical_label_literals () else repository_name (),
27+ # Determine the repository part of labels pointing into the rules_go repo. This is needed
28+ # both to specify the aspect and to match labels in query output.
29+ "rulesGoRepositoryName" : RULES_GO_REPO_NAME ,
3730 },
38- visibility = ["//visibility:public" ],
3931)
0 commit comments