Skip to content

Commit

Permalink
Update bzl_library targets (#2942)
Browse files Browse the repository at this point in the history
* Update `bzl_library` targets

With bazel-contrib/bazel-gazelle#760 submitted, it
should now be possible to use stardoc to generate documentation for
rules_go and gazelle.
  • Loading branch information
achew22 authored Oct 15, 2021
1 parent e82f2ea commit 027d78b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions go/platform/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ bzl_library(
name = "apple",
srcs = ["apple.bzl"],
)

bzl_library(
name = "crosstool",
srcs = ["crosstool.bzl"],
)
6 changes: 6 additions & 0 deletions go/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ bzl_library(
],
)

bzl_library(
name = "rpath",
srcs = ["rpath.bzl"],
visibility = ["//go:__subpackages__"],
)

# Usually false. This is only true when we are building nogo itself in which
# because that rule uses an incoming transition to switch this to true.
bool_setting(
Expand Down
2 changes: 2 additions & 0 deletions go/private/actions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ bzl_library(
srcs = ["link.bzl"],
visibility = ["//go:__subpackages__"],
deps = [
"@bazel_skylib//lib:collections",
"@io_bazel_rules_go//go/private:common",
"@io_bazel_rules_go//go/private:mode",
"@io_bazel_rules_go//go/private:rpath",
],
)

Expand Down
3 changes: 2 additions & 1 deletion go/private/context.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ def _infer_importpath(ctx):
def go_context(ctx, attr = None):
"""Returns an API used to build Go code.
See /go/toolchains.rst#go-context"""
See /go/toolchains.rst#go-context
"""
if not attr:
attr = ctx.attr
toolchain = ctx.toolchains["@io_bazel_rules_go//go:toolchain"]
Expand Down
1 change: 1 addition & 0 deletions go/private/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
bzl_library(
name = "def",
srcs = ["def.bzl"],
visibility = ["//visibility:public"],
)
"""
ctx.file("BUILD.bazel", build_content)
Expand Down
5 changes: 3 additions & 2 deletions go/private/rules/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ bzl_library(
"//go:__subpackages__",
"//proto:__pkg__",
],
# Don't list dependency on @io_bazel_rules_go_name_hack//:def
deps = [
"@io_bazel_rules_go//go/platform:crosstool",
"@io_bazel_rules_go//go/private:mode",
"@io_bazel_rules_go//go/private:platforms",
"@io_bazel_rules_go//go/private:providers",
], # keep
"@io_bazel_rules_go_name_hack//:def",
],
)

bzl_library(
Expand Down

0 comments on commit 027d78b

Please sign in to comment.