File tree Expand file tree Collapse file tree 16 files changed +12
-26
lines changed
nix-meson-build-support/common/asan-options
tests/functional/test-libstoreconsumer Expand file tree Collapse file tree 16 files changed +12
-26
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ pymod = import('python')
1515python = pymod.find_installation(' python3' )
1616
1717nix_env_for_docs = {
18- ' ASAN_OPTIONS' : ' abort_on_error=1:print_summary=1:detect_leaks=0' ,
1918 ' HOME' : ' /dummy' ,
2019 ' NIX_CONF_DIR' : ' /dummy' ,
2120 ' NIX_SSL_CERT_FILE' : ' /dummy/no-ca-bundle.crt' ,
Original file line number Diff line number Diff line change 1- extern " C" [[gnu::retain]] const char * __asan_default_options ()
1+ extern " C" [[gnu::retain, gnu::weak ]] const char * __asan_default_options ()
22{
33 // We leak a bunch of memory knowingly on purpose. It's not worthwhile to
44 // diagnose that memory being leaked for now.
Original file line number Diff line number Diff line change 1- asan_test_options_env = {
2- ' ASAN_OPTIONS' : ' abort_on_error=1:print_summary=1:detect_leaks=0' ,
3- }
4-
51# Clang gets grumpy about missing libasan symbols if -shared-libasan is not
62# passed when building shared libs, at least on Linux
73if cxx.get_id() == ' clang' and (' address' in get_option (' b_sanitize' ) or ' undefined' in get_option (
@@ -10,3 +6,6 @@ if cxx.get_id() == 'clang' and ('address' in get_option('b_sanitize') or 'undefi
106 add_project_link_arguments (' -shared-libasan' , language : ' cpp' )
117endif
128
9+ if ' address' in get_option (' b_sanitize' )
10+ deps_other += declare_dependency (sources : ' asan-options.cc' )
11+ endif
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ this_exe = executable(
8282test (
8383 meson .project_name(),
8484 this_exe,
85- env : asan_test_options_env + {
85+ env : {
8686 ' _NIX_TEST_UNIT_DATA' : meson .current_source_dir() / ' data' ,
8787 },
8888 protocol : ' gtest' ,
Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ mkMesonExecutable (finalAttrs: {
6262 mkdir -p "$HOME"
6363 ''
6464 + ''
65- export ASAN_OPTIONS=abort_on_error=1:print_summary=1:detect_leaks=0
6665 export _NIX_TEST_UNIT_DATA=${ resolvePath ./data }
6766 ${ stdenv . hostPlatform . emulator buildPackages } ${ lib . getExe finalAttrs . finalPackage }
6867 touch $out
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ this_exe = executable(
6363test (
6464 meson .project_name(),
6565 this_exe,
66- env : asan_test_options_env + {
66+ env : {
6767 ' _NIX_TEST_UNIT_DATA' : meson .current_source_dir() / ' data' ,
6868 },
6969 protocol : ' gtest' ,
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ mkMesonExecutable (finalAttrs: {
6161 buildInputs = [ writableTmpDirAsHomeHook ] ;
6262 }
6363 ''
64- export ASAN_OPTIONS=abort_on_error=1:print_summary=1:detect_leaks=0
6564 export _NIX_TEST_UNIT_DATA=${ resolvePath ./data }
6665 ${ stdenv . hostPlatform . emulator buildPackages } ${ lib . getExe finalAttrs . finalPackage }
6766 touch $out
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ this_exe = executable(
5858test (
5959 meson .project_name(),
6060 this_exe,
61- env : asan_test_options_env + {
61+ env : {
6262 ' _NIX_TEST_UNIT_DATA' : meson .current_source_dir() / ' data' ,
6363 ' NIX_CONFIG' : ' extra-experimental-features = flakes' ,
6464 ' HOME' : meson .current_build_dir() / ' test-home' ,
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ mkMesonExecutable (finalAttrs: {
5959 buildInputs = [ writableTmpDirAsHomeHook ] ;
6060 }
6161 ( ''
62- export ASAN_OPTIONS=abort_on_error=1:print_summary=1:detect_leaks=0
6362 export _NIX_TEST_UNIT_DATA=${ resolvePath ./data }
6463 export NIX_CONFIG="extra-experimental-features = flakes"
6564 ${ stdenv . hostPlatform . emulator buildPackages } ${ lib . getExe finalAttrs . finalPackage }
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ this_exe = executable(
104104test (
105105 meson .project_name(),
106106 this_exe,
107- env : asan_test_options_env + {
107+ env : {
108108 ' _NIX_TEST_UNIT_DATA' : meson .current_source_dir() / ' data' ,
109109 ' HOME' : meson .current_build_dir() / ' test-home' ,
110110 ' NIX_REMOTE' : meson .current_build_dir() / ' test-home' / ' store' ,
@@ -138,7 +138,7 @@ if get_option('benchmarks')
138138 benchmark (
139139 ' nix-store-benchmarks' ,
140140 benchmark_exe,
141- env : asan_test_options_env + {
141+ env : {
142142 ' _NIX_TEST_UNIT_DATA' : meson .current_source_dir() / ' data' ,
143143 },
144144 )
You can’t perform that action at this time.
0 commit comments