Skip to content

Commit

Permalink
Migrating to Bazel 1.0. Fixes #101. (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ola Rozenfeld authored Nov 4, 2019
1 parent b773405 commit e77c4eb
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 24 deletions.
61 changes: 43 additions & 18 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,42 @@ workspace(name = "bazel_remote_apis")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Pull in go rules, which we need selectively pull in Go dependencies.
http_archive(
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

# Pull in go rules, which we need in order to selectively pull in Go dependencies.
http_archive(
name = "io_bazel_rules_go",
sha256 = "513c12397db1bc9aa46dd62f02dd94b49a9b5d17444d49b5a04c5a89f3053c1c",
sha256 = "842ec0e6b4fbfdd3de6150b61af92901eeb73681fd4d185746644c338f51d4c0",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.19.5/rules_go-v0.19.5.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.19.5/rules_go-v0.19.5.tar.gz",
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz",
],
)

# Gazelle, which we need in order to selectively pull in Gazelle dependencies for Go.
http_archive(
name = "bazel_gazelle",
sha256 = "7fc87f4170011201b1690326e8c16c5d802836e3a0d617d8f75c3af2b23180c4",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.2/bazel-gazelle-0.18.2.tar.gz"],
sha256 = "41bff2a0b32b02f20c227d234aa25ef3783998e5453f7eade929704dcff7cd4b",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.0/bazel-gazelle-v0.19.0.tar.gz"],
)

# Needed for protobuf.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
http_archive(
name = "com_google_protobuf",
commit = "09745575a923640154bcf307fba8aedff47f240a",
remote = "https://github.com/protocolbuffers/protobuf",
shallow_since = "1558721209 -0700",
sha256 = "678d91d8a939a1ef9cb268e1f20c14cd55e40361dc397bb5881e4e1e532679b1",
strip_prefix = "protobuf-3.10.1",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.10.1.zip"],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
Expand All @@ -36,19 +47,33 @@ protobuf_deps()
# Needed for C++ gRPC.
http_archive(
name = "com_github_grpc_grpc",
sha256 = "11ac793c562143d52fd440f6549588712badc79211cdc8c509b183cb69bddad8",
strip_prefix = "grpc-1.22.0",
urls = [
"https://github.com/grpc/grpc/archive/v1.22.0.tar.gz",
"https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.22.0.tar.gz",
],
sha256 = "b391a327429279f6f29b9ae7e5317cd80d5e9d49cc100e6d682221af73d984a6",
strip_prefix = "grpc-93e8830070e9afcbaa992c75817009ee3f4b63a0", # v1.24.3 with fixes
urls = ["https://github.com/grpc/grpc/archive/93e8830070e9afcbaa992c75817009ee3f4b63a0.zip"],
)

# Pull in all gRPC dependencies.
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

grpc_deps()

# More gRPC dependencies. grpc_extra_deps does not work out of the box.
load("@upb//bazel:workspace_deps.bzl", "upb_deps")
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")

upb_deps()

apple_rules_dependencies()

apple_support_dependencies()

load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")

bazel_version_repository(
name = "bazel_version",
)

bind(
name = "grpc_cpp_plugin",
actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
Expand Down
8 changes: 5 additions & 3 deletions build/bazel/remote/execution/v2/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@bazel_remote_apis_imports//:imports.bzl", "java_proto_library", "go_library", "go_proto_library", "cc_grpc_library")

licenses(["notice"])
Expand All @@ -25,16 +27,16 @@ java_proto_library(
cc_grpc_library(
name = "remote_execution_cc_proto",
srcs = ["remote_execution.proto"],
proto_only = False,
use_external = False,
well_known_protos = True,
deps = [
"//build/bazel/semver:semver_cc_proto",
"@googleapis//:google_api_annotations_cc_proto",
"@googleapis//:google_api_http_cc_proto",
"@googleapis//:google_longrunning_operations_cc_proto",
"@googleapis//:google_rpc_status_cc_proto",
],
proto_only = False,
well_known_protos = True,
use_external = False,
)

go_proto_library(
Expand Down
49 changes: 49 additions & 0 deletions build/bazel/remote/execution/v2/remote_execution.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions build/bazel/semver/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@bazel_remote_apis_imports//:imports.bzl", "java_proto_library", "go_library", "go_proto_library", "cc_grpc_library")

licenses(["notice"])
Expand All @@ -16,10 +18,10 @@ java_proto_library(
cc_grpc_library(
name = "semver_cc_proto",
srcs = ["semver.proto"],
deps = [],
proto_only = False,
well_known_protos = True,
use_external = False,
well_known_protos = True,
deps = [],
)

go_proto_library(
Expand Down
2 changes: 1 addition & 1 deletion external/BUILD.googleapis
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")

licenses(["notice"])
Expand Down Expand Up @@ -75,4 +76,3 @@ cc_grpc_library(
well_known_protos = True,
use_external = False,
)

0 comments on commit e77c4eb

Please sign in to comment.