From e3ed5a7adcab0f519717c054bf88b664e4e2f5b1 Mon Sep 17 00:00:00 2001 From: botengyao Date: Fri, 27 Sep 2024 16:28:43 -0400 Subject: [PATCH] wasm: re-enable envoy wasm coverage build by disabling rust coverage build (#36337) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve been explored other solutions to https://github.com/envoyproxy/envoy/issues/24164#issuecomment-2374859550 over the past few days, and here is the final fix, and I think we don't need rust coverage as whole at current stage. Commit Message: re-enable envoy wasm coverage build by disabling rust coverage build Additional Description: Risk Level: no Fix: #24164 Testing: Docs Changes: --------- Signed-off-by: Boteng Yao --- bazel/envoy_select.bzl | 9 --------- bazel/rules_rust.patch | 12 ++++++++++++ test/per_file_coverage.sh | 1 - 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bazel/envoy_select.bzl b/bazel/envoy_select.bzl index 873126819da0..2135eab05705 100644 --- a/bazel/envoy_select.bzl +++ b/bazel/envoy_select.bzl @@ -149,9 +149,6 @@ def envoy_select_wasm_cpp_tests(xs): def envoy_select_wasm_rust_tests(xs): return select({ "@envoy//bazel:wasm_disabled": [], - # TODO(phlax): re-enable once issues with llvm profiler are resolved - # (see https://github.com/envoyproxy/envoy/issues/24164) - "@envoy//bazel:coverage_build": [], "//conditions:default": xs, }) @@ -162,9 +159,6 @@ def envoy_select_wasm_v8(xs): "@envoy//bazel:wasm_wamr": [], "@envoy//bazel:wasm_wasmtime": [], "@envoy//bazel:wasm_disabled": [], - # TODO(phlax): re-enable once issues with llvm profiler are resolved - # (see https://github.com/envoyproxy/envoy/issues/24164) - "@envoy//bazel:coverage_build": [], "//conditions:default": xs, # implicit default (v8) }) @@ -175,9 +169,6 @@ def envoy_select_wasm_v8_bool(): "@envoy//bazel:wasm_wamr": False, "@envoy//bazel:wasm_wasmtime": False, "@envoy//bazel:wasm_disabled": False, - # TODO(phlax): re-enable once issues with llvm profiler are resolved - # (see https://github.com/envoyproxy/envoy/issues/24164) - "@envoy//bazel:coverage_build": False, "//conditions:default": True, # implicit default (v8) }) diff --git a/bazel/rules_rust.patch b/bazel/rules_rust.patch index e00bfdfd006d..04fc47181b01 100644 --- a/bazel/rules_rust.patch +++ b/bazel/rules_rust.patch @@ -9,3 +9,15 @@ # These rules are not supposed to be depended on by other rust targets, and # as such they shouldn't provide a CrateInfo. However, one may still want to # write a rust_test for them, so we provide the CrateInfo wrapped in a provider + +--- rust/private/rustc.bzl ++++ rust/private/rustc.bzl +@@ -1043,7 +1043,7 @@ def construct_arguments( + + if toolchain.llvm_cov and ctx.configuration.coverage_enabled: + # https://doc.rust-lang.org/rustc/instrument-coverage.html +- rustc_flags.add("--codegen=instrument-coverage") ++ pass + + if toolchain._experimental_link_std_dylib: + rustc_flags.add("--codegen=prefer-dynamic") diff --git a/test/per_file_coverage.sh b/test/per_file_coverage.sh index c5bc35cf786e..a31b15d9fef3 100755 --- a/test/per_file_coverage.sh +++ b/test/per_file_coverage.sh @@ -35,7 +35,6 @@ declare -a KNOWN_LOW_COVERAGE=( "source/extensions/filters/http/grpc_json_transcoder:94.2" # TODO(#28232) "source/extensions/filters/http/ip_tagging:88.2" "source/extensions/filters/http/kill_request:91.7" # Death tests don't report LCOV -"source/extensions/filters/http/wasm:1.3" # Disabled due to issue (#24164) "source/extensions/filters/listener/original_src:92.1" "source/extensions/filters/network/mongo_proxy:96.1" "source/extensions/filters/network/sni_cluster:88.9"