Skip to content

Commit 7eb1da1

Browse files
committed
ci: Use tsan-instrumented libcxx in sanitizers job
mptest thread sanitizer checks that were failing in bitcoin core CI were not failing in libmultiprocess CI, and this change instruments libcxx so the same checks should happen both places. Credit to MarcoFalke <*~=`'#}+{/-|&$^[email protected]> for pointing this out bitcoin/bitcoin#33518 (comment)
1 parent ec86e43 commit 7eb1da1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ci/configs/sanitize.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CI_DESC="CI job running ThreadSanitizer"
22
CI_DIR=build-sanitize
3+
NIX_ARGS=(--arg enableLibcxx true --argstr libcxxSanitizers "Thread")
34
export CXX=clang++
45
export CXXFLAGS="-ggdb -Werror -Wall -Wextra -Wpedantic -Wthread-safety -Wno-unused-parameter -fsanitize=thread"
56
CMAKE_ARGS=()

shell.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
, minimal ? false # Whether to create minimal shell without extra tools (faster when cross compiling)
55
, capnprotoVersion ? null
66
, cmakeVersion ? null
7+
, libcxxSanitizers ? null # Optional LLVM_USE_SANITIZER value to use for libc++, see https://llvm.org/docs/CMake.html
78
}:
89

910
let
1011
lib = pkgs.lib;
11-
llvm = crossPkgs.llvmPackages_20;
12+
llvmBase = crossPkgs.llvmPackages_21;
13+
llvm = llvmBase // lib.optionalAttrs (libcxxSanitizers != null) {
14+
libcxx = llvmBase.libcxx.override {
15+
devExtraCmakeFlags = [ "-DLLVM_USE_SANITIZER=${libcxxSanitizers}" ];
16+
};
17+
};
1218
capnprotoHashes = {
1319
"0.7.0" = "sha256-Y/7dUOQPDHjniuKNRw3j8dG1NI9f/aRWpf8V0WzV9k8=";
1420
"0.7.1" = "sha256-3cBpVmpvCXyqPUXDp12vCFCk32ZXWpkdOliNH37UwWE=";

0 commit comments

Comments
 (0)