Skip to content

Commit

Permalink
Make "./gn_build.sh is_asan=true" work by default on Mac. (project-ch…
Browse files Browse the repository at this point in the history
…ip#21308)

The boringssl tests don't compile with asan on Mac.
  • Loading branch information
bzbarsky-apple authored and isiu-apple committed Sep 16, 2022
1 parent 07e5c27 commit f876693
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,10 @@ jobs:
# (similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked
# up as part of the "unified" build. But then to
# save CI resources we want to exclude a few
# redundant things:
#
# * the mbedtls build, since we don't really plan to
# use that on Darwin.
# * the "host clang" build, which uses the pigweed
# clang.
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false enable_host_clang_boringssl_crypto_tests=false';;
# save CI resources we want to exclude the
# "host clang" build, which uses the pigweed
# clang.
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';;
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
esac
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands
Expand Down
6 changes: 4 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Enable building chip with clang & boringssl
enable_host_clang_boringssl_build = false

# Enable limited testing with clang & boringssl
# Enable limited testing with clang & boringssl. On Mac, boringssl does
# not compile with ASAN enabled.
enable_host_clang_boringssl_crypto_tests =
enable_default_builds && host_os != "win"
enable_default_builds && host_os != "win" &&
!(is_asan == true && host_os == "mac")

# Build the chip-cert tool.
enable_standalone_chip_cert_build =
Expand Down
3 changes: 0 additions & 3 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ declare_args() {
# Enable Thread sanitizer
is_tsan = false

# Enable address sanitizer
is_asan = false

# Enable memory sanitizer
is_msan = false

Expand Down
3 changes: 3 additions & 0 deletions build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ declare_args() {

# Generate code coverage analysis artifacts when enabled.
use_coverage = false

# Enable address sanitizer
is_asan = false
}

0 comments on commit f876693

Please sign in to comment.