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

Step 6: Add clang cl pipeline for Windows #14668

Merged
merged 20 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c447b04
Step 5: Introduce clang_cl job for Windows to envoy azure pipelines
sunjayBhatia Nov 20, 2020
93c7287
Experiment: attempt to inject flake publishing+reporting
wrowe Jan 8, 2021
90c2416
Mark known-problem clang-cl tests
wrowe Jan 12, 2021
4e358af
Distinguish clang-cl from msvc ('windows') failures
wrowe Jan 13, 2021
1a0d507
Use the modern syntax for windows preprocessor flag
wrowe Jan 13, 2021
6e7e28b
Format spelling mystery, clarify comment
wrowe Jan 13, 2021
e19f9ee
Expand all args testing for --config=clang-cl
wrowe Jan 13, 2021
e3ff0cf
Work around odd format check
wrowe Jan 13, 2021
a781595
Add repository cache to avoid download/sync failures
wrowe Jan 14, 2021
14de8cd
Adjust for 2nd build schema/target clang-cl
wrowe Jan 14, 2021
3a3f80c
Simplify test, trigger on all clang-cl flavors including remote
wrowe Jan 14, 2021
59f1059
Add explanation of failures with logs
wrowe Jan 14, 2021
2e28989
Job changes per PR review
wrowe Jan 14, 2021
e7ecf59
Remaining test case failing in CI under clang-cl build
wrowe Jan 15, 2021
d27fd2e
Merge remote-tracking branch 'origin/master' into add-clang-cl-pipeline
wrowe Jan 15, 2021
020ad0f
Merge remote-tracking branch 'origin/main' into add-clang-cl-pipeline
wrowe Jan 16, 2021
e499361
Merge remote-tracking branch 'origin/main' into add-clang-cl-pipeline
wrowe Jan 17, 2021
f153afd
Restore windows-docker job timeout
wrowe Jan 17, 2021
82cd4a7
Simplify summary output as it is unused
wrowe Jan 21, 2021
8e51ba7
Merge remote-tracking branch 'origin/main' into add-clang-cl-pipeline
wrowe Jan 21, 2021
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
38 changes: 36 additions & 2 deletions .azure-pipelines/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ stages:
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- bash: ci/run_envoy_docker.sh ci/windows_ci_steps.sh
displayName: "Run Windows CI"
displayName: "Run Windows msvc-cl CI"
env:
CI_TARGET: "windows"
ENVOY_DOCKER_BUILD_DIR: "$(Build.StagingDirectory)"
Expand All @@ -415,9 +415,43 @@ stages:
artifactName: windows.release
condition: always()

- job: clang_cl
timeoutInMinutes: 120
pool:
vmImage: "windows-latest"
steps:
- task: Cache@2
inputs:
key: '"windows.release" | ./WORKSPACE | **/*.bzl'
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- bash: ci/run_envoy_docker.sh ci/windows_ci_steps.sh
displayName: "Run Windows clang-cl CI"
env:
CI_TARGET: "windows"
ENVOY_DOCKER_BUILD_DIR: "$(Build.StagingDirectory)"
SLACK_TOKEN: $(SLACK_TOKEN)
REPO_URI: $(Build.Repository.Uri)
BUILD_URI: $(Build.BuildUri)
ENVOY_RBE: "true"
BAZEL_BUILD_EXTRA_OPTIONS: "--config=remote-ci --config=remote-clang-cl --jobs=$(RbeJobs) --flaky_test_attempts=2"
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/bazel-out/**/testlogs/**/test.xml"
testRunTitle: "clang-cl"
searchFolder: $(Build.StagingDirectory)/tmp
condition: always()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/envoy"
artifactName: windows.clang-cl
condition: always()

- job: docker
dependsOn: ["release"]
timeoutInMinutes: 120
wrowe marked this conversation as resolved.
Show resolved Hide resolved
pool:
vmImage: "windows-latest"
steps:
Expand Down
6 changes: 4 additions & 2 deletions bazel/envoy_internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ def envoy_copts(repository, test = False):
],
repository + "//bazel:gcc_build": ["-Wno-maybe-uninitialized"],
# Allow 'nodiscard' function results values to be discarded for test code only
# TODO(envoyproxy/windows-dev): Replace with /Zc:preprocessor for cl.exe versions >= 16.5
repository + "//bazel:windows_x86_64": ["-wd4834", "-experimental:preprocessor", "-Wv:19.4"] if test else ["-experimental:preprocessor", "-Wv:19.4"],
# TODO(envoyproxy/windows-dev): Replace /Zc:preprocessor with /experimental:preprocessor
# for msvc versions between 15.8 through 16.4.x. see
# https://docs.microsoft.com/en-us/cpp/build/reference/zc-preprocessor
repository + "//bazel:windows_x86_64": ["-wd4834", "-Zc:preprocessor", "-Wv:19.4"] if test else ["-Zc:preprocessor", "-Wv:19.4"],
repository + "//bazel:clang_cl_build": ["-Wno-unused-result"] if test else [],
"//conditions:default": [],
}) + select({
Expand Down
18 changes: 13 additions & 5 deletions ci/windows_ci_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ mkdir -p "${ENVOY_BUILD_DIR}"
ENVOY_DELIVERY_DIR="${ENVOY_BUILD_DIR}"/source/exe
mkdir -p "${ENVOY_DELIVERY_DIR}"

FAIL_GROUP=windows
if [[ "${BAZEL_BUILD_EXTRA_OPTIONS[*]}" =~ "clang-cl" ]]; then
FAIL_GROUP=clang_cl
fi

# Test to validate updates of all dependency libraries in bazel/external and bazel/foreign_cc
# bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //bazel/... --build_tag_filters=-skip_on_windows

Expand All @@ -75,15 +80,18 @@ cp -f bazel-bin/source/exe/envoy-static.exe "${ENVOY_DELIVERY_DIR}/envoy.exe"
tar czf "${ENVOY_BUILD_DIR}"/envoy_binary.tar.gz -C "${ENVOY_DELIVERY_DIR}" envoy.exe

# Test invocations of known-working tests on Windows
bazel "${BAZEL_STARTUP_OPTIONS[@]}" test "${BAZEL_BUILD_OPTIONS[@]}" //test/... --test_tag_filters=-skip_on_windows,-fails_on_windows,-flaky_on_windows --build_tests_only
bazel "${BAZEL_STARTUP_OPTIONS[@]}" test "${BAZEL_BUILD_OPTIONS[@]}" //test/... --test_tag_filters=-skip_on_windows,-fails_on_${FAIL_GROUP} --build_tests_only

echo "running flaky test reporting script"
"${ENVOY_SRCDIR}"/ci/flaky_test/run_process_xml.sh "$CI_TARGET"

# Build tests that are known-flaky or known-failing to ensure no compilation regressions
bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //test/... --test_tag_filters=-skip_on_windows,fails_on_windows,flaky_on_windows --build_tests_only
# Build tests that are known flaky or failing to ensure no compilation regressions
bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //test/... --test_tag_filters=-skip_on_windows,fails_on_${FAIL_GROUP} --build_tests_only

# Summarize tests bypasssed to monitor the progress of porting to Windows
echo "Tests bypassed as skip_on_windows: $(bazel "${BAZEL_STARTUP_OPTIONS[@]}" query 'kind(".*test rule", attr("tags", "skip_on_windows", //test/...))' 2>/dev/null | sort | wc -l) known unbuildable or inapplicable tests"
echo "Tests bypassed as fails_on_windows: $(bazel "${BAZEL_STARTUP_OPTIONS[@]}" query 'kind(".*test rule", attr("tags", "fails_on_windows", //test/...))' 2>/dev/null | sort | wc -l) known incompatible tests"
echo "Tests bypassed as flaky_on_windows: $(bazel "${BAZEL_STARTUP_OPTIONS[@]}" query 'kind(".*test rule", attr("tags", "flaky_on_windows", //test/...))' 2>/dev/null | sort | wc -l) known unstable tests"
if [[ "${FAIL_GROUP}" == "clang_cl" ]]; then
echo "Tests bypassed as fails_on_clang_cl} $(bazel "${BAZEL_STARTUP_OPTIONS[@]}" query 'kind(".*test rule", attr("tags", "fails_on_clang_cl}", //test/...))' 2>/dev/null | sort | wc -l) known incompatible tests"
wrowe marked this conversation as resolved.
Show resolved Hide resolved
else
echo "Tests bypassed as fails_on_windows} $(bazel "${BAZEL_STARTUP_OPTIONS[@]}" query 'kind(".*test rule", attr("tags", "fails_on_windows}", //test/...))' 2>/dev/null | sort | wc -l) known incompatible tests"
fi
4 changes: 4 additions & 0 deletions test/common/network/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ envoy_cc_test(
# Used in createDnsResolver to force creation of DnsResolverImpl when running test on macOS.
"--runtime-feature-disable-for-tests=envoy.restart_features.use_apple_api_for_dns_lookups",
],
# TODO(envoyproxy/windows-dev): Under winsock2 this is behaving unusually for windows, even as
# 127.0.0.1 and ::1 are explicitly added to `c:\windows\system32\drivers\etc\hosts` ... see:
# https://gist.github.com/wrowe/24fe5b93b58bb444bce7ecc134905395
tags = ["fails_on_clang_cl"],
deps = [
"//include/envoy/event:dispatcher_interface",
"//include/envoy/network:address_interface",
Expand Down
3 changes: 3 additions & 0 deletions test/extensions/filters/http/dynamic_forward_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ envoy_extension_cc_test(
"//test/config/integration/certs",
],
extension_name = "envoy.filters.http.dynamic_forward_proxy",
# TODO(envoyproxy/windows-dev): Diagnose failure shown on clang-cl build, see:
# https://gist.github.com/wrowe/a152cb1d12c2f751916122aed39d8517
tags = ["fails_on_clang_cl"],
deps = [
"//source/extensions/clusters/dynamic_forward_proxy:cluster",
"//source/extensions/filters/http/dynamic_forward_proxy:config",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ envoy_extension_cc_test(
"//test/config/integration/certs",
],
extension_name = "envoy.filters.network.sni_dynamic_forward_proxy",
# TODO(envoyproxy/windows-dev): Diagnose failure shown only on clang-cl build, see:
# https://gist.github.com/wrowe/12b0b7579791c541c789c98563999a2e
tags = ["fails_on_clang_cl"],
deps = [
"//source/extensions/clusters/dynamic_forward_proxy:cluster",
"//source/extensions/filters/listener/tls_inspector:config",
Expand Down
7 changes: 5 additions & 2 deletions test/extensions/quic_listeners/quiche/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ envoy_cc_test(
size = "medium",
srcs = ["quic_http_integration_test.cc"],
data = ["//test/config/integration/certs"],
# TODO(envoyproxy/windows-dev): Diagnose why opt build test under Windows GCP RBE
# TODO(envoyproxy/windows-dev): Diagnose failure shown only on clang-cl build, see:
# https://gist.github.com/wrowe/a152cb1d12c2f751916122aed39d8517
# TODO(envoyproxy/windows-dev): Diagnose timeout, why opt build test under Windows GCP RBE
# takes 10x as long as on linux (>300s vs ~30s). Shards = 2 solves for windows, see:
# https://github.com/envoyproxy/envoy/pull/13713/files#r512160087
# Each of these tests exceeds 20s;
# QuicHttpIntegrationTests/QuicHttpIntegrationTest.MultipleQuicConnections[With|No]BPF*
tags = [
"flaky_on_windows",
"fails_on_clang_cl",
"fails_on_windows",
"nofips",
],
deps = [
Expand Down
5 changes: 4 additions & 1 deletion test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,10 @@ envoy_cc_test(
# TODO(envoyproxy/windows-dev): The key rotation in SdsDynamicKeyRotationIntegrationTest via
# TestEnvironment::renameFile() fails on Windows. The renameFile() implementation does not
# correctly handle symlinks.
tags = ["fails_on_windows"],
tags = [
"fails_on_clang_cl",
"fails_on_windows",
],
deps = [
":http_integration_lib",
"//source/common/config:api_version_lib",
Expand Down