srctree

Robin Linden parent cdd832bc 326e6c62
Add an asan Bazel configuration

inlinesplit
.bazelrc added: 37, removed: 3, total 34
@@ -60,6 +60,20 @@ build:msvc --per_file_copt='external/sfml[:/]@/wd4456' # C4456: declaration of '
build:msvc --per_file_copt='external/sfml[:/]@/wd4701' # C4701: potentially uninitialized local variable 'shape' used
build:msvc --per_file_copt='external/sfml[:/]@/wd4703' # C4703: potentially uninitialized local pointer variable 'shape' used
 
# Special build options
# =========================================================
 
# Some of this is from "Can I run AddressSanitizer with more aggressive diagnostics enabled?"
# on https://github.com/google/sanitizers/wiki/AddressSanitizer#faq and some is from
# https://chromium.googlesource.com/external/github.com/grpc/grpc/+/4e9206f48c91e17f43856b016b12f59dd5118293/tools/bazel.rc
build:asan --strip=never
build:asan --copt=-fsanitize=address
build:asan --copt=-fsanitize-address-use-after-scope
build:asan --copt=-fno-omit-frame-pointer
build:asan --linkopt=-fsanitize=address
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
build:asan --action_env=LSAN_OPTIONS=report_objects=1
 
# Misc configuration
# =========================================================
 
 
.bazelrc.local.example added: 37, removed: 3, total 34
@@ -9,3 +9,6 @@ build --config debug
# Choose a compiler
build --config gnulike # gcc/clang
# build --config msvc
 
# Other interesting build options
# build --config asan
 
.github/workflows/ci.yaml added: 37, removed: 3, total 34
@@ -34,6 +34,23 @@ jobs:
- name: Run
run: bazel run browser --config gnulike
 
linux-clang-asan:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install
run: |
sudo apt install libxrandr-dev libgl-dev libudev-dev libfreetype-dev
echo "CC=clang-10" >> $GITHUB_ENV
echo "CXX=clang++-10" >> $GITHUB_ENV
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-linux-amd64 --output-document=bazel
- name: Build
run: bazel build //... --config gnulike --config asan
- name: Test
run: bazel test //... --config gnulike --config asan
- name: Run
run: bazel run browser --config gnulike --config asan
 
windows-msvc:
runs-on: windows-2019
defaults: