Skip to content

Commit

Permalink
build: Bump rules_go and protobuf to pick up Windows fixes (envoyprox…
Browse files Browse the repository at this point in the history
…y#4556)

- Bump rules_go to 1.15.3 (latest). This picks up some fixes so that
  rules_go works on Windows. The api go tests don't appear to build with
  go1.11, so pin to go1.10.4
- Bump google/protobuf to fa252ec2, which picks up a fix for handling
  Windows path separators

Signed-off-by: Sam Smith <[email protected]>
  • Loading branch information
sesmith177 authored and mattklein123 committed Oct 5, 2018
1 parent 4d149e6 commit 1071264
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
workspace(name = "envoy")

load("//bazel:repositories.bzl", "envoy_dependencies")
load("//bazel:repositories.bzl", "envoy_dependencies", "GO_VERSION")
load("//bazel:cc_configure.bzl", "cc_configure")

envoy_dependencies()
Expand All @@ -11,4 +11,4 @@ api_dependencies()

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
go_register_toolchains(go_version = GO_VERSION)
17 changes: 17 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_env_var")
# dict of {build recipe name: longform extension name,}
PPC_SKIP_TARGETS = {"luajit": "envoy.filters.http.lua"}

# go version for rules_go
GO_VERSION = "1.10.4"

def _repository_impl(name, **kwargs):
# `existing_rule_keys` contains the names of repositories that have already
# been defined in the Bazel workspace. By skipping repos with existing keys,
Expand Down Expand Up @@ -212,7 +215,21 @@ def _go_deps(skip_targets):
# Keep the skip_targets check around until Istio Proxy has stopped using
# it to exclude the Go rules.
if "io_bazel_rules_go" not in skip_targets:
_repository_impl(
name = "com_github_golang_protobuf",
# These patches are to add BUILD files to golang/protobuf.
# TODO(sesmith177): Remove this dependency when both:
# 1. There's a release of golang/protobuf that includes
# https://github.com/golang/protobuf/commit/31e0d063dd98c052257e5b69eeb006818133f45c
# 2. That release is included in rules_go
patches = [
"@io_bazel_rules_go//third_party:com_github_golang_protobuf-gazelle.patch",
"@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch",
],
patch_args = ["-p1"],
)
_repository_impl("io_bazel_rules_go")
_repository_impl("bazel_gazelle")

def _envoy_api_deps():
# Treat the data plane API as an external repo, this simplifies exporting the API to
Expand Down
21 changes: 17 additions & 4 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
REPOSITORY_LOCATIONS = dict(
bazel_gazelle = dict(
sha256 = "1b959bd6b6ce88fc3fdfc28946adf1eafb1d5e4d470d2e08a51774d09078d031",
strip_prefix = "bazel-gazelle-0.14.0",
urls = ["https://github.com/bazelbuild/bazel-gazelle/archive/0.14.0.tar.gz"],
),
boringssl = dict(
# Use commits from branch "chromium-stable-with-bazel"
commit = "ab36a84b91b3116bacc85973995504818748d8a9", # chromium-69.0.3497.81
Expand Down Expand Up @@ -129,17 +134,25 @@ REPOSITORY_LOCATIONS = dict(
# that includes:
# - https://github.com/google/protobuf/commit/f35669b8d3f46f7f1236bd21f14d744bba251e60
# - https://github.com/google/protobuf/commit/6a4fec616ec4b20f54d5fb530808b855cb664390
commit = "6a4fec616ec4b20f54d5fb530808b855cb664390",
# - https://github.com/google/protobuf/commit/fa252ec2a54acb24ddc87d48fed1ecfd458445fd
commit = "fa252ec2a54acb24ddc87d48fed1ecfd458445fd",
remote = "https://github.com/google/protobuf",
),
grpc_httpjson_transcoding = dict(
commit = "05a15e4ecd0244a981fdf0348a76658def62fa9c", # 2018-05-30
remote = "https://github.com/grpc-ecosystem/grpc-httpjson-transcoding",
),
com_github_golang_protobuf = dict(
# TODO(sesmith177): Remove this dependency when both:
# 1. There's a release of golang/protobuf that includes
# https://github.com/golang/protobuf/commit/31e0d063dd98c052257e5b69eeb006818133f45c
# 2. That release is included in rules_go
commit = "31e0d063dd98c052257e5b69eeb006818133f45c", # 2018-10-03
remote = "https://github.com/golang/protobuf",
),
io_bazel_rules_go = dict(
sha256 = "5a89e9c1fe89d45c4a45132fae94bf130842ce3c77e3a735a68f6991d4e00a25",
strip_prefix = "rules_go-0.11.2",
urls = ["https://github.com/bazelbuild/rules_go/archive/0.11.2.tar.gz"],
commit = "3d966375ff7971d43b863f785f495c7dcd6923da", # 2018-10-02
remote = "https://github.com/bazelbuild/rules_go",
),
six_archive = dict(
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
Expand Down
4 changes: 2 additions & 2 deletions ci/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
workspace(name = "ci")

load("//bazel:repositories.bzl", "envoy_dependencies")
load("//bazel:repositories.bzl", "envoy_dependencies", "GO_VERSION")
load("//bazel:cc_configure.bzl", "cc_configure")

# We shouldn't need this, but it's a workaround for https://github.com/bazelbuild/bazel/issues/3580.
Expand All @@ -20,4 +20,4 @@ api_dependencies()

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
go_register_toolchains(go_version = GO_VERSION)
4 changes: 2 additions & 2 deletions ci/WORKSPACE.filter.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local_repository(
path = "/source",
)

load("//bazel:repositories.bzl", "envoy_dependencies")
load("//bazel:repositories.bzl", "envoy_dependencies", "GO_VERSION")
load("//bazel:cc_configure.bzl", "cc_configure")

envoy_dependencies(
Expand All @@ -19,4 +19,4 @@ api_dependencies()

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
go_register_toolchains(go_version = GO_VERSION)
4 changes: 2 additions & 2 deletions windows/tools/bazel.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Windows/Envoy specific Bazel build/test options.

// TODO: remove experimental_shortened_obj_file_path for Bazel 0.16.0
build --experimental_shortened_obj_file_path
build --define signal_trace=disabled
build --define hot_restart=disabled
build --define tcmalloc=disabled
# Build GRPC without c-ares support -- otherwise it will not link
build --define grpc_no_ares=true

0 comments on commit 1071264

Please sign in to comment.