Skip to content

Commit

Permalink
[tint][ir][fuzz] Disable building IR fuzzer when ASAN is enabled
Browse files Browse the repository at this point in the history
There are false positives in libprotobuf occuring.

Issue: 345196552

Change-Id: I620affcd52e1642b181efb76c2768b6bb74c6b0b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/193641
Commit-Queue: James Price <[email protected]>
Reviewed-by: James Price <[email protected]>
Commit-Queue: Ryan Harrison <[email protected]>
Auto-Submit: Ryan Harrison <[email protected]>
  • Loading branch information
zoddicus authored and Dawn LUCI CQ committed Jun 14, 2024
1 parent 7d04e68 commit 88e0d75
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 16 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ message(STATUS "Tint build tests: ${TINT_BUILD_TESTS}")
message(STATUS "Tint build checking [chromium-style]: ${TINT_CHECK_CHROMIUM_STYLE}")
message(STATUS "Tint external benchmark corpus dir: ${TINT_EXTERNAL_BENCHMARK_CORPUS_DIR}")

set(IS_ASAN ${DAWN_ENABLE_ASAN})

if (NOT ${TINT_LIB_FUZZING_ENGINE_LINK_OPTIONS} STREQUAL "")
message(STATUS "Using provided LIB_FUZZING_ENGINE options: ${TINT_LIB_FUZZING_ENGINE_LINK_OPTIONS}")
Expand Down
2 changes: 1 addition & 1 deletion src/tint/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ group("fuzzers") {
deps += [ "${tint_src_dir}/cmd/fuzz/wgsl" ]
}

if (tint_build_ir_fuzzer) {
if (tint_build_ir_fuzzer && (!is_asan || build_with_chromium)) {
deps += [ "${tint_src_dir}/cmd/fuzz/ir" ]
}
}
Expand Down
21 changes: 20 additions & 1 deletion src/tint/cmd/fuzz/ir/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
load("//src/tint:flags.bzl", "COPTS")
load("@bazel_skylib//lib:selects.bzl", "selects")

alias(
name = "build_with_chromium",
actual = "//src/tint:build_with_chromium_true",
)

alias(
name = "_not_is_asan_",
actual = "//src/tint:is_asan_false",
)

alias(
name = "tint_build_glsl_writer",
actual = "//src/tint:tint_build_glsl_writer_true",
Expand Down Expand Up @@ -78,10 +88,19 @@ alias(
)

selects.config_setting_group(
name = "tint_build_ir_binary_and_tint_build_ir_fuzzer",
name = "_not_is_asan__or_build_with_chromium",
match_any = [
"_not_is_asan_",
"build_with_chromium",
],
)

selects.config_setting_group(
name = "tint_build_ir_binary_and_tint_build_ir_fuzzer_and___not_is_asan__or_build_with_chromium_",
match_all = [
":tint_build_ir_binary",
":tint_build_ir_fuzzer",
":_not_is_asan__or_build_with_chromium",
],
)

7 changes: 4 additions & 3 deletions src/tint/cmd/fuzz/ir/BUILD.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"proto": {
"Condition": "tint_build_ir_binary && tint_build_ir_fuzzer",
"Condition": "tint_build_ir_binary && tint_build_ir_fuzzer && (!is_asan || build_with_chromium)",
"AdditionalDependencies": {
"Internal": [ "lang/core/ir/binary:proto" ]
"Internal": [ "lang/core/ir/binary:proto" ]
}
},
"fuzz_cmd": {
"Condition": "tint_build_ir_binary && tint_build_ir_fuzzer",
/* Fuzzer has known false positive with ASAN in standalone builds */
"Condition": "tint_build_ir_binary && tint_build_ir_fuzzer && (!is_asan || build_with_chromium)",
/* The Tint fuzzer executable for IR-input. */
"OutputName": "tint_ir_fuzzer",
"AdditionalDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions src/tint/cmd/fuzz/ir/BUILD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
# Do not modify this file directly
################################################################################

if(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER)
if(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM))
################################################################################
# Target: tint_cmd_fuzz_ir_proto
# Kind: proto
# Condition: TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER
# Condition: TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM)
################################################################################
tint_add_target(tint_cmd_fuzz_ir_proto proto
cmd/fuzz/ir/fuzz.proto
Expand All @@ -50,12 +50,12 @@ if(TINT_BUILD_IR_BINARY)
)
endif(TINT_BUILD_IR_BINARY)

endif(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER)
if(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER)
endif(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM))
if(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM))
################################################################################
# Target: tint_cmd_fuzz_ir_fuzz_cmd
# Kind: fuzz_cmd
# Condition: TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER
# Condition: TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM)
################################################################################
tint_add_target(tint_cmd_fuzz_ir_fuzz_cmd fuzz_cmd
cmd/fuzz/ir/main_fuzz.cc
Expand Down Expand Up @@ -113,11 +113,11 @@ if(TINT_BUILD_IR_BINARY)
)
endif(TINT_BUILD_IR_BINARY)

if(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER)
if(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM))
tint_target_add_dependencies(tint_cmd_fuzz_ir_fuzz_cmd fuzz_cmd
tint_cmd_fuzz_ir_proto
)
endif(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER)
endif(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM))

if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_cmd_fuzz_ir_fuzz_cmd fuzz_cmd
Expand Down Expand Up @@ -146,7 +146,7 @@ endif(TINT_BUILD_WGSL_WRITER)

tint_target_set_output_name(tint_cmd_fuzz_ir_fuzz_cmd fuzz_cmd "tint_ir_fuzzer")

endif(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER)
endif(TINT_BUILD_IR_BINARY AND TINT_BUILD_IR_FUZZER AND ((NOT IS_ASAN) OR BUILD_WITH_CHROMIUM))
################################################################################
# Target: tint_cmd_fuzz_ir_fuzz
# Kind: fuzz
Expand Down
9 changes: 6 additions & 3 deletions src/tint/cmd/fuzz/ir/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
import("../../../../../scripts/tint_overrides_with_defaults.gni")

import("${tint_src_dir}/tint.gni")
if (tint_build_ir_binary && tint_build_ir_fuzzer) {
if (tint_build_ir_binary && tint_build_ir_fuzzer &&
(!is_asan || build_with_chromium)) {
tint_proto_library("proto") {
sources = [ "fuzz.proto" ]
deps = []
Expand Down Expand Up @@ -90,7 +91,8 @@ tint_fuzz_source_set("fuzz") {
]
}
}
if (tint_build_ir_binary && tint_build_ir_fuzzer) {
if (tint_build_ir_binary && tint_build_ir_fuzzer &&
(!is_asan || build_with_chromium)) {
tint_fuzzer_test("ir") {
output_name = "tint_ir_fuzzer"
sources = [ "main_fuzz.cc" ]
Expand Down Expand Up @@ -139,7 +141,8 @@ if (tint_build_ir_binary && tint_build_ir_fuzzer) {
]
}

if (tint_build_ir_binary && tint_build_ir_fuzzer) {
if (tint_build_ir_binary && tint_build_ir_fuzzer &&
(!is_asan || build_with_chromium)) {
deps += [ "${tint_src_dir}/cmd/fuzz/ir:proto" ]
}

Expand Down

0 comments on commit 88e0d75

Please sign in to comment.