Skip to content

Commit

Permalink
Update to rules_go 0.17.1
Browse files Browse the repository at this point in the history
Due to a change in how the dependencies work, we need to be careful to
load go_repository from deps.bzl, not def.bzl:

bazelbuild/rules_go#1933

Additionally, Gazelle 0.17.0 seems to find the dependencies in
src/.gopath, so I've added a gazelle:ignore directive for them. At the
same time, I've added the path to .bazelignore, so that Bazel doesn't
try to build or run files in there.

This pulls in some Bazel compatibility fixes (#2).

Change-Id: Ic215ca30c0e6bb438e8fff134e439e4e4a032879
GitOrigin-RevId: 8c7708b
  • Loading branch information
drigz authored and Copybara-Service committed Mar 5, 2019
1 parent 0642c7b commit c103df8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/.gopath
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ gazelle(
# We ignore the build files generated by bazel-deps as it doesn't use buildifer.
# gazelle:exclude third_party

# Also ignore the Go sources downloaded by src/go/deps.sh.
# gazelle:exclude src/.gopath

# These directives tell Gazelle how to resolve the proto imports within the
# grpc-gateway repo.
#
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ http_file(
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
load("@bazel_gazelle//:def.bzl", "go_repository")
load("@bazel_gazelle//:deps.bzl", "go_repository")

# Do not call go_rules_dependencies() until after all other go_repository
# calls, or else the top-level definitions may be silently ignored.
Expand Down
3 changes: 1 addition & 2 deletions bazel/proto_crd/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@bazel_gazelle//:def.bzl", "go_repository")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
Expand Down
12 changes: 6 additions & 6 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -585,20 +585,20 @@ cc_library(
_maybe(
http_archive,
name = "io_bazel_rules_go",
sha256 = "b4b38b649354c882774d1a5589402e7874f1e38ddb9bb7dfdc2b3f9902b5b64e",
strip_prefix = "rules_go-0.17.0",
sha256 = "9d7d865b92cc1e16e7c1d53b3d0f6532252a512d7e09d6f074fe41423f036cca",
strip_prefix = "rules_go-0.17.1",
urls = [
"https://github.com/bazelbuild/rules_go/archive/0.17.0.tar.gz",
"https://github.com/bazelbuild/rules_go/archive/0.17.1.tar.gz",
],
)

_maybe(
http_archive,
name = "bazel_gazelle",
sha256 = "1cae8a59e959ffd8359df1d898323236aeffa932de2e49c9639a75daf393af28",
strip_prefix = "bazel-gazelle-0.16.0",
sha256 = "960374b7977958b8626102d3512c7f4b1660d61b9668fea3d404ae9ca3d69083",
strip_prefix = "bazel-gazelle-0.17.0",
urls = [
"https://github.com/bazelbuild/bazel-gazelle/archive/0.16.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/archive/0.17.0.tar.gz",
],
)

Expand Down
2 changes: 1 addition & 1 deletion src/proto/registry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ java_proto_library(

go_proto_library(
name = "registry_proto_go",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
compilers = ["@io_bazel_rules_go//proto:go_grpc"], # keep
importpath = "src/proto/registry",
proto = ":registry_proto",
deps = [
Expand Down

0 comments on commit c103df8

Please sign in to comment.