From 5ba05d97f602cd47a2ad0637fb7e7ae9207582de Mon Sep 17 00:00:00 2001 From: Yan Avlasov Date: Tue, 28 Sep 2021 20:41:44 -0400 Subject: [PATCH 1/4] Update bazel to 4.2.1 Signed-off-by: Yan Avlasov --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index ee74734aa225..fae6e3d04b2c 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -4.1.0 +4.2.1 From 9a29f89f83dd0707ccaed2c5a7a89fe890a4c457 Mon Sep 17 00:00:00 2001 From: Yan Avlasov Date: Tue, 28 Sep 2021 20:50:06 -0400 Subject: [PATCH 2/4] Update toolchains Signed-off-by: Yan Avlasov --- .bazelrc | 2 +- .devcontainer/Dockerfile | 2 +- bazel/repository_locations.bzl | 6 +++--- examples/wasm-cc/docker-compose-wasm.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.bazelrc b/.bazelrc index 0028a084e27f..70132d553d9f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -265,7 +265,7 @@ build:remote-clang-cl --config=rbe-toolchain-clang-cl # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5f9ca2079ec8..00194ed54c57 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 +FROM gcr.io/envoy-ci/envoy-build:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d ARG USERNAME=vscode ARG USER_UID=501 diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 4a53163f310f..6e245ea3aea8 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -65,11 +65,11 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "envoy-build-tools", project_desc = "Common build tools shared by the Envoy/UDPA ecosystem", project_url = "https://github.com/envoyproxy/envoy-build-tools", - version = "a9db6cde8e8d4404621e9631bba237c45e04ceed", - sha256 = "f2c7d4d5c4b18d85321d4c43686b8c5b5473a4ad9b1f8f4245d863a10367a9c0", + version = "55a7bbe700586729bd38231a9a6f3dcd1ff85e7d", + sha256 = "11893be9f0334a7e12ffc04b3b034dffe0bb5516d36654011532136c7929ae27", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], - release_date = "2021-09-17", + release_date = "2021-09-28", use_category = ["build"], ), boringssl = dict( diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index 2d88bf48f173..655a4c91cc00 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -2,7 +2,7 @@ version: "3.7" services: wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 + image: envoyproxy/envoy-build-ubuntu:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source @@ -11,7 +11,7 @@ services: - ./lib:/build wasm_compile: - image: envoyproxy/envoy-build-ubuntu:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 + image: envoyproxy/envoy-build-ubuntu:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source From 9f79431ec373d9e2dd99943c944398b0c0a9668a Mon Sep 17 00:00:00 2001 From: Yan Avlasov Date: Tue, 28 Sep 2021 21:01:21 -0400 Subject: [PATCH 3/4] Use correct build image sha Signed-off-by: Yan Avlasov --- .bazelrc | 2 +- .devcontainer/Dockerfile | 2 +- examples/wasm-cc/docker-compose-wasm.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index 70132d553d9f..d71b1261bd08 100644 --- a/.bazelrc +++ b/.bazelrc @@ -265,7 +265,7 @@ build:remote-clang-cl --config=rbe-toolchain-clang-cl # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:81a93046060dbe5620d5b3aa92632090a9ee4da6 build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 00194ed54c57..8da867149806 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d +FROM gcr.io/envoy-ci/envoy-build:81a93046060dbe5620d5b3aa92632090a9ee4da6 ARG USERNAME=vscode ARG USER_UID=501 diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index 655a4c91cc00..537b46d2485e 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -2,7 +2,7 @@ version: "3.7" services: wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d + image: envoyproxy/envoy-build-ubuntu:81a93046060dbe5620d5b3aa92632090a9ee4da6 command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source @@ -11,7 +11,7 @@ services: - ./lib:/build wasm_compile: - image: envoyproxy/envoy-build-ubuntu:55a7bbe700586729bd38231a9a6f3dcd1ff85e7d + image: envoyproxy/envoy-build-ubuntu:81a93046060dbe5620d5b3aa92632090a9ee4da6 command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source From 4c50b578de13cb784387fd39189434f3a1df96ed Mon Sep 17 00:00:00 2001 From: William A Rowe Jr Date: Fri, 16 Apr 2021 16:21:11 -0500 Subject: [PATCH 4/4] Experimental feature generate_pdb_file in opt build to capture pdb output See https://github.com/bazelbuild/rules_cc/issues/94 for details Use generate_pdb_file feature to capture pdb from envoy-static.exe - Introduces features list arg to envoy_cc_binary - Toggles the feature only for the windows opt case in the envoy-static target - Capture the resulting envoy-static.pdb output Signed-off-by: William A Rowe Jr --- bazel/envoy_binary.bzl | 4 +++- ci/windows_ci_steps.sh | 4 +++- source/exe/BUILD | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bazel/envoy_binary.bzl b/bazel/envoy_binary.bzl index 6ea24b9888cf..d7a17c2ff615 100644 --- a/bazel/envoy_binary.bzl +++ b/bazel/envoy_binary.bzl @@ -22,7 +22,8 @@ def envoy_cc_binary( stamped = False, deps = [], linkopts = [], - tags = []): + tags = [], + features = []): if not linkopts: linkopts = _envoy_linkopts() if stamped: @@ -42,6 +43,7 @@ def envoy_cc_binary( stamp = 1, deps = deps, tags = tags, + features = features, ) # Select the given values if exporting is enabled in the current build. diff --git a/ci/windows_ci_steps.sh b/ci/windows_ci_steps.sh index eed32c121886..110535e63576 100755 --- a/ci/windows_ci_steps.sh +++ b/ci/windows_ci_steps.sh @@ -91,11 +91,13 @@ fi if [[ $BUILD_ENVOY_STATIC -eq 1 ]]; then bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //source/exe:envoy-static - # Copy binary to delivery directory + # Copy binary and pdb to delivery directory cp -f bazel-bin/source/exe/envoy-static.exe "${ENVOY_DELIVERY_DIR}/envoy.exe" + cp -f bazel-bin/source/exe/envoy-static.pdb "${ENVOY_DELIVERY_DIR}/envoy.pdb" # Copy for azp, creating a tar archive tar czf "${ENVOY_BUILD_DIR}"/envoy_binary.tar.gz -C "${ENVOY_DELIVERY_DIR}" envoy.exe + tar czf "${ENVOY_BUILD_DIR}"/envoy_binary_debug.tar.gz -C "${ENVOY_DELIVERY_DIR}" envoy.exe envoy.pdb fi # Test invocations of known-working tests on Windows diff --git a/source/exe/BUILD b/source/exe/BUILD index f3fb551eb83a..0eb4078c164c 100644 --- a/source/exe/BUILD +++ b/source/exe/BUILD @@ -22,6 +22,10 @@ alias( envoy_cc_binary( name = "envoy-static", + features = select({ + "//bazel:windows_opt_build": ["generate_pdb_file"], + "//conditions:default": [], + }), stamped = True, deps = [":envoy_main_entry_lib"], )