Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Bazel 5.0.0 #2034

Merged
merged 24 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
93b9c63
envoy: 71248e512
jpsim Jan 27, 2022
435a068
Intercept stream idle timeout events and propagate to errors
jpsim Jan 28, 2022
662a6af
Empty commit to re-run CI
jpsim Feb 1, 2022
fdb8fa1
format
jpsim Feb 1, 2022
6fff489
Empty commit to re-run CI
jpsim Feb 1, 2022
ee8ff64
fixup! Empty commit to re-run CI
jpsim Feb 1, 2022
174239c
Merge branch 'main' into envoy-71248e512
jpsim Feb 1, 2022
7408ccf
Fix rules_android-0.1.1 checksum
jpsim Feb 1, 2022
13ab5bf
Revert rules_android checksum
jpsim Feb 1, 2022
4841c33
Bump Envoy to 49f3d95
jpsim Feb 1, 2022
63d56e5
WIP: Use Bazel 5
jpsim Feb 2, 2022
5804bed
Migrate EngFlow configurations from rbe_autoconfig to rbe_configs_gen
jpsim Feb 2, 2022
a8987be
Merge remote-tracking branch 'origin/main' into bazel-5
jpsim Feb 2, 2022
006da8f
Add tmate session to python_tests CI job
jpsim Feb 2, 2022
2327a92
WIP: Remove android_sdk_repository references in WORKSPACE
jpsim Feb 2, 2022
b16319b
Fix toolchain
jpsim Feb 2, 2022
4f6c9f8
Set Pool in exec_properties
jpsim Feb 2, 2022
ee9d209
Add workaround for https://github.com/bazelbuild/bazel/issues/2722
jpsim Feb 2, 2022
a77a0e7
fixup! Add workaround for https://github.com/bazelbuild/bazel/issues/…
jpsim Feb 2, 2022
cba9d40
Merge branch 'main' into bazel-5
jpsim Feb 3, 2022
00a0557
Comment out android_ndk_repository line in WORKSPACE file
jpsim Feb 3, 2022
b11cd4d
fixup! Comment out android_ndk_repository line in WORKSPACE file
jpsim Feb 3, 2022
a97ba24
bazel: Add androidndk fetching workaround
keith Feb 4, 2022
3047dae
Revert "Comment out android_ndk_repository line in WORKSPACE file"
jpsim Feb 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ build --spawn_strategy=local
build --verbose_failures
build --workspace_status_command=envoy/bazel/get_workspace_status
build --xcode_version=13.2.1
build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a new way to provide these values on Bazel 5.0 if you want to preserve this. At minimum you might want to provide the java_language_version and tool_java_language_version just to make sure that it's consistent moving forward.

Ex:

build \
  --java_language_version=8 \
  --tool_java_language_version=8 \
  --java_runtime_version=lyft_jdk11 \
  --tool_java_runtime_version=lyft_jdk11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are actually defined in Envoy now, and we import that .bazelrc file: https://github.com/envoyproxy/envoy/blob/708742e9e8ec44e634a02d16eee0dce826130298/.bazelrc#L19-L20

build --javabase=@bazel_tools//tools/jdk:remote_jdk11
build --tool_java_runtime_version=remotejdk_11
build --java_runtime_version=remotejdk_11
# https://github.com/bazelbuild/rules_jvm_external/issues/445
build --repo_env=JAVA_HOME=../bazel_tools/jdk
build --define disable_known_issue_asserts=true
Expand Down
7 changes: 5 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ python_configure(name = "local_config_python", python_version = "3")
load("//bazel:python.bzl", "declare_python_abi")
declare_python_abi(name = "python_abi", python_version = "3")

android_sdk_repository(name = "androidsdk", api_level = 30, build_tools_version = "30.0.2")
android_ndk_repository(name = "androidndk", api_level = 21)
load("//bazel:android_configure.bzl", "android_configure")
android_configure(name = "local_config_android")

load("@local_config_android//:android_configure.bzl", "android_workspace")
android_workspace()
53 changes: 53 additions & 0 deletions bazel/android_configure.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""Repository rule for Android SDK and NDK autoconfiguration.

This rule is a no-op unless the required android environment variables are set.
"""

# Based on https://github.com/tensorflow/tensorflow/tree/34c03ed67692eb76cb3399cebca50ea8bcde064c/third_party/android
# Workaround for https://github.com/bazelbuild/bazel/issues/14260

_ANDROID_NDK_HOME = "ANDROID_NDK_HOME"
_ANDROID_SDK_HOME = "ANDROID_HOME"

def _android_autoconf_impl(repository_ctx):
sdk_home = repository_ctx.os.environ.get(_ANDROID_SDK_HOME)
ndk_home = repository_ctx.os.environ.get(_ANDROID_NDK_HOME)

sdk_rule = ""
if sdk_home:
sdk_rule = """
native.android_sdk_repository(
name="androidsdk",
path="{}",
api_level=30,
build_tools_version="30.0.2",
)
""".format(sdk_home)

ndk_rule = ""
if ndk_home:
ndk_rule = """
native.android_ndk_repository(
name="androidndk",
path="{}",
api_level=21,
)
""".format(ndk_home)

if ndk_rule == "" and sdk_rule == "":
sdk_rule = "pass"

repository_ctx.file("BUILD.bazel", "")
repository_ctx.file("android_configure.bzl", """
def android_workspace():
{}
{}
""".format(sdk_rule, ndk_rule))

android_configure = repository_rule(
implementation = _android_autoconf_impl,
environ = [
_ANDROID_NDK_HOME,
_ANDROID_SDK_HOME,
],
)
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 49 files
+3 −2 .bazelrc
+1 −1 .bazelversion
+2 −0 .python-version
+1 −0 api/BUILD
+2 −1 api/envoy/config/common/mutation_rules/v3/mutation_rules.proto
+1 −0 api/envoy/extensions/filters/http/ext_proc/v3/BUILD
+10 −2 api/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto
+2 −0 api/test/build/BUILD
+2 −0 api/test/validate/BUILD
+1 −1 bazel/README.md
+0 −39 bazel/external/envoy_build_tools.patch
+1 −5 bazel/repositories.bzl
+10 −11 bazel/repository_locations.bzl
+1 −0 docs/root/api-v3/common_messages/common_messages.rst
+2 −0 docs/root/version_history/current.rst
+27 −27 examples/grpc-bridge/client/requirements.txt
+26 −3 source/common/quic/envoy_quic_client_stream.cc
+2 −0 source/common/quic/envoy_quic_client_stream.h
+25 −3 source/common/quic/envoy_quic_server_stream.cc
+2 −0 source/common/quic/envoy_quic_server_stream.h
+36 −0 source/common/quic/envoy_quic_stream.h
+1 −1 source/common/router/router.cc
+6 −3 source/extensions/filters/common/mutation_rules/mutation_rules.cc
+10 −1 source/extensions/filters/common/mutation_rules/mutation_rules.h
+6 −0 source/extensions/filters/http/ext_proc/BUILD
+62 −14 source/extensions/filters/http/ext_proc/ext_proc.cc
+13 −2 source/extensions/filters/http/ext_proc/ext_proc.h
+51 −93 source/extensions/filters/http/ext_proc/mutation_utils.cc
+14 −19 source/extensions/filters/http/ext_proc/mutation_utils.h
+60 −26 source/extensions/filters/http/ext_proc/processor_state.cc
+6 −3 source/extensions/filters/http/ext_proc/processor_state.h
+3 −2 test/common/network/resolver_impl_test.cc
+64 −0 test/common/quic/envoy_quic_client_stream_test.cc
+60 −0 test/common/quic/envoy_quic_server_stream_test.cc
+6 −6 test/common/tracing/http_tracer_manager_impl_test.cc
+1 −1 test/extensions/filters/http/ext_authz/ext_authz_fuzz.proto
+3 −0 test/extensions/filters/http/ext_proc/BUILD
+88 −0 test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc
+96 −17 test/extensions/filters/http/ext_proc/filter_test.cc
+21 −2 test/extensions/filters/http/ext_proc/mutation_utils_test.cc
+25 −33 test/extensions/filters/http/ext_proc/ordering_test.cc
+49 −6 test/integration/http_protocol_integration.cc
+4 −2 test/integration/http_protocol_integration.h
+2 −0 test/integration/multiplexed_integration_test.cc
+35 −16 test/integration/protocol_integration_test.cc
+4 −0 test/integration/redirect_integration_test.cc
+10 −5 test/server/api_listener_test.cc
+1 −1 test/test_common/environment.cc
+3 −3 tools/dependency/requirements.txt