Skip to content

Commit

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

The boringssl tests don't compile with asan on Mac.

Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
woody-apple and bzbarsky-apple authored Jul 29, 2022
1 parent 78f9125 commit a6365eb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 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_gcc_mbedtls_build=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
15 changes: 14 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,20 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
enable_host_gcc_build = enable_default_builds && host_os != "win"

# Enable building chip with gcc & mbedtls.
enable_host_gcc_mbedtls_build = enable_default_builds && host_os != "win"
enable_host_gcc_mbedtls_build = false

# Enable limited testing with gcc & mbedtls.
enable_host_gcc_mbedtls_crypto_tests =
enable_default_builds && host_os != "win"

# Enable building chip with clang & boringssl
enable_host_clang_boringssl_build = false

# 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" &&
!(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 a6365eb

Please sign in to comment.