From a3bc4734e07528abf898ae176e0ba30196d165cd Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 4 Nov 2019 12:09:04 -0800 Subject: [PATCH] ci: use bash for Windows and build more targets in CI (#8865) * ci: use bash for Windows and build more targets Signed-off-by: Lizan Zhou --- .azure-pipelines/windows.yml | 18 +++++++++--------- .bazelrc | 5 ++++- bazel/envoy_binary.bzl | 1 + ci/windows_ci_steps.ps1 | 1 - ci/windows_ci_steps.sh | 22 ++++++++++++++++++++++ 5 files changed, 36 insertions(+), 11 deletions(-) delete mode 100644 ci/windows_ci_steps.ps1 create mode 100755 ci/windows_ci_steps.sh diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index 8877ce28d0f8..ebdc0c7aff60 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -7,15 +7,15 @@ jobs: - job: Windows timeoutInMinutes: 360 pool: - vmImage: 'windows-latest' + vmImage: "windows-latest" steps: - - powershell: | - .\ci\windows_ci_setup.ps1 - Write-Host "##vso[task.prependpath]$env:TOOLS_BIN_DIR" - displayName: 'Install dependencies' - env: - TOOLS_BIN_DIR: $(Pipeline.Workspace)\bin + - powershell: | + .\ci\windows_ci_setup.ps1 + Write-Host "##vso[task.prependpath]$env:TOOLS_BIN_DIR" + displayName: "Install dependencies" + env: + TOOLS_BIN_DIR: $(Pipeline.Workspace)\bin - - powershell: .\ci\windows_ci_steps.ps1 - displayName: 'Run Windows CI' + - bash: ci/windows_ci_steps.sh + displayName: "Run Windows CI" diff --git a/.bazelrc b/.bazelrc index 92fbe61e9fd0..ab9a2c74b741 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,7 +19,10 @@ build --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a build --action_env=BAZEL_LINKOPTS=-lm build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11 build --javabase=@bazel_tools//tools/jdk:remote_jdk11 -build --copt=-fPIC +build --enable_platform_specific_config + +# Enable position independent code, this option is not supported on Windows and default on on macOS. +build:linux --copt=-fPIC # We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace. build --define absl=1 diff --git a/bazel/envoy_binary.bzl b/bazel/envoy_binary.bzl index 0f1fe50fd00f..52eb337877e1 100644 --- a/bazel/envoy_binary.bzl +++ b/bazel/envoy_binary.bzl @@ -71,6 +71,7 @@ def _envoy_linkopts(): ], }) + select({ "@envoy//bazel:boringssl_fips": [], + "@envoy//bazel:windows_x86_64": [], "//conditions:default": ["-pie"], }) + _envoy_select_exported_symbols(["-Wl,-E"]) diff --git a/ci/windows_ci_steps.ps1 b/ci/windows_ci_steps.ps1 deleted file mode 100644 index 6c8f906cb9e7..000000000000 --- a/ci/windows_ci_steps.ps1 +++ /dev/null @@ -1 +0,0 @@ -bazel --bazelrc=windows\.bazelrc test @envoy_api//test/build/... diff --git a/ci/windows_ci_steps.sh b/ci/windows_ci_steps.sh new file mode 100755 index 000000000000..487bf5926e6c --- /dev/null +++ b/ci/windows_ci_steps.sh @@ -0,0 +1,22 @@ +# No hashbang here because this script is intended for Windows + +set -e + +function finish { + echo "disk space at end of build:" + df -h +} +trap finish EXIT + +echo "disk space at beginning of build:" +df -h + +. "$(dirname "$0")"/setup_cache.sh + +BAZEL_STARTUP_OPTIONS="--bazelrc=windows/.bazelrc" +BAZEL_BUILD_OPTIONS="--show_task_finish --verbose_failures \ + --test_output=all ${BAZEL_BUILD_EXTRA_OPTIONS} ${BAZEL_EXTRA_TEST_OPTIONS}" + +bazel ${BAZEL_STARTUP_OPTIONS} build ${BAZEL_BUILD_OPTIONS} //bazel/foreign_cc:nghttp2 //bazel/foreign_cc:event //bazel/foreign_cc:yaml + +bazel ${BAZEL_STARTUP_OPTIONS} test ${BAZEL_BUILD_OPTIONS} @envoy_api//test/build/...