Skip to content

Commit ce2fd5d

Browse files
committed
Add tsan build
- use TSAN llvm/qt deps - build catch with CATCH_CONFIG_NO_POSIX_SIGNALS to avoid TSAN false positives - build tbb with TSAN
1 parent 70500c0 commit ce2fd5d

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ jobs:
4343
BOOST_BOOTSTRAP_OPTIONS: "--with-toolset=clang"
4444
BOOST_B2_OPTIONS: "cxxflags=-fPIC"
4545
TBB_ENABLE_IPO: "ON"
46+
- os: "ubuntu-22.04"
47+
shell: "bash"
48+
BOOST_INSTALL_PREFIX: "/opt/smelibs"
49+
BOOST_BOOTSTRAP_OPTIONS: "--with-toolset=clang"
50+
BOOST_B2_OPTIONS: "cxxflags=-fPIC"
51+
TBB_ENABLE_IPO: "ON"
52+
TBB_SANITIZE: "thread"
53+
BUILD_TAG: "_tsan"
4654
- os: "ubuntu-22.04-arm"
4755
shell: "bash"
4856
BOOST_INSTALL_PREFIX: "/opt/smelibs"
@@ -77,11 +85,15 @@ jobs:
7785
BOOST_BOOTSTRAP_OPTIONS: ${{ matrix.BOOST_BOOTSTRAP_OPTIONS }}
7886
BOOST_B2_OPTIONS: ${{ matrix.BOOST_B2_OPTIONS }}
7987
TBB_ENABLE_IPO: ${{ matrix.TBB_ENABLE_IPO }}
88+
TBB_SANITIZE: ${{ matrix.TBB_SANITIZE }}
89+
BUILD_TAG: ${{ matrix.BUILD_TAG }}
8090
steps:
81-
- uses: spatial-model-editor/[email protected].6
91+
- uses: spatial-model-editor/[email protected].15
8292
with:
83-
sme_deps_llvm: "21.1.2"
84-
sme_deps_qt: "6.9.2"
93+
sme_deps_llvm: "21.1.2-tsan"
94+
sme_deps_qt: "6.9.2-tsan"
95+
build_tag: ${{ matrix.BUILD_TAG }}
96+
cache_id: ${{ matrix.BUILD_TAG }}
8597
- uses: actions/checkout@v4
8698
- run: ./build.sh
8799
- uses: actions/upload-artifact@v4

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ repos:
1111
- id: mixed-line-ending
1212
exclude: '.*\.diff$'
1313
- repo: https://github.com/rhysd/actionlint
14-
rev: v1.7.7
14+
rev: v1.7.8
1515
hooks:
1616
- id: actionlint
1717
- repo: https://github.com/pecigonzalo/pre-commit-shfmt
1818
rev: v2.2.0
1919
hooks:
2020
- id: shell-fmt-go
2121
- repo: https://github.com/google/yamlfmt
22-
rev: v0.17.2
22+
rev: v0.18.0
2323
hooks:
2424
- id: yamlfmt
25+
files: \.(yaml|yml)$
2526
- repo: https://github.com/cheshirekow/cmake-format-precommit
2627
rev: v0.6.13
2728
hooks:

build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ echo "NLOPT_VERSION: ${NLOPT_VERSION}"
3535
export "CMAKE_POLICY_VERSION_MINIMUM=3.5"
3636

3737
NPROCS=4
38+
echo "BUILD_TAG = $BUILD_TAG"
3839
echo "NPROCS: ${NPROCS}"
3940
echo "PATH: ${PATH}"
4041
echo "SUDO_CMD: ${SUDO_CMD}"
@@ -158,6 +159,7 @@ ${SUDO_CMD} ninja install
158159
cd ../../
159160

160161
# build static version of Catch2 library
162+
# build with posix signals disabled to avoid https://github.com/catchorg/Catch2/issues/1833 when using TSAN
161163
git clone -b $CATCH2_VERSION --depth 1 https://github.com/catchorg/Catch2.git
162164
cd Catch2
163165
mkdir build
@@ -173,6 +175,7 @@ cmake -GNinja .. \
173175
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
174176
-DBUILD_SHARED_LIBS=OFF \
175177
-DCATCH_INSTALL_DOCS=OFF \
178+
-DCATCH_CONFIG_NO_POSIX_SIGNALS=1 \
176179
-DCATCH_INSTALL_EXTRAS=ON
177180
time ninja
178181
${SUDO_CMD} ninja install
@@ -304,9 +307,6 @@ cd ../../
304307
git clone -b $TBB_VERSION --depth 1 https://github.com/oneapi-src/oneTBB.git
305308
cd oneTBB
306309
# patch for "c++.exe: fatal error: input file '/dev/null' is the same as output file" issue on windows due to cmake execute_process quoting command
307-
# line 50 of https://github.com/uxlfoundation/oneTBB/commit/377e6c3b1719f8cc7b68f9d0939e652d7e3bf776#diff-08a9ef6921a1ae25a4447b8a4ff5740038771e549fb6f0ff69dafb35c342a8b8R5
308-
# instead of calling c++ to get the binutils version we get it from CMAKE_CXX_COMPILER_LINKER_VERSION
309-
# note: this works fine for us as we use binutils for linker and assembler, haven't checked if it also works if a different linker is used.
310310
git apply --ignore-space-change --ignore-whitespace --verbose ../tbb.diff
311311
mkdir build
312312
cd build
@@ -321,6 +321,7 @@ cmake -GNinja .. \
321321
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
322322
-DTBB_ENABLE_IPO="$TBB_ENABLE_IPO" \
323323
-DTBB_STRICT=OFF \
324+
-DTBB_SANITIZE="$TBB_SANITIZE" \
324325
-DTBB_TEST=OFF
325326
VERBOSE=1 time ninja tbb
326327
${SUDO_CMD} ninja install
@@ -713,4 +714,4 @@ ccache --show-stats
713714

714715
mkdir artefacts
715716
cd artefacts
716-
tar -zcvf sme_deps_common_${OS}.tgz $INSTALL_PREFIX/*
717+
tar -zcvf sme_deps_common_${OS}${BUILD_TAG}.tgz $INSTALL_PREFIX/*

0 commit comments

Comments
 (0)