more sanitizers

This commit is contained in:
2026-02-22 11:33:19 +01:00
committed by Romain BOULLARD
parent d67c041df1
commit 56418bb401
3 changed files with 44 additions and 9 deletions

View File

@@ -21,11 +21,20 @@ jobs:
include: include:
- build_type: Release - build_type: Release
conan_profile: ./ConanProfiles/clang conan_profile: ./ConanProfiles/clang
name: Release
- build_type: Debug - build_type: Debug
conan_profile: ./ConanProfiles/clangd conan_profile: ./ConanProfiles/clangd
name: Debug (ASAN, LSAN, UBSAN)
- build_type: Debug
conan_profile: ./ConanProfiles/clangd2
name: Debug (TSAN, MSAN)
- build_type: RelWithDebInfo - build_type: RelWithDebInfo
conan_profile: ./ConanProfiles/clangd conan_profile: ./ConanProfiles/clangd
name: "Build & Test ${{ matrix.build_type }}" name: RelWithDebInfo (ASAN, LSAN, UBSAN)
- build_type: RelWithDebInfo
conan_profile: ./ConanProfiles/clangd2
name: RelWithDebInfo (TSAN, MSAN)
name: "Build & Test ${{ matrix.name }}"
steps: steps:
- name: Install Node.js - name: Install Node.js
run: apt-get update && apt-get install -y nodejs run: apt-get update && apt-get install -y nodejs
@@ -35,9 +44,6 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Show ccache stats before
run: ccache --zero-stats
- name: Build - name: Build
run: | run: |
conan profile detect conan profile detect
@@ -45,9 +51,6 @@ jobs:
cmake -S . -B ./build/${{ matrix.build_type }} --toolchain ./build/${{ matrix.build_type }}/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G "Ninja" cmake -S . -B ./build/${{ matrix.build_type }} --toolchain ./build/${{ matrix.build_type }}/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G "Ninja"
cmake --build build/${{ matrix.build_type }} --parallel $(nproc) cmake --build build/${{ matrix.build_type }} --parallel $(nproc)
- name: Show ccache stats after
run: ccache --show-stats
- name: Unit Tests - name: Unit Tests
run: | run: |
cd ./build/${{ matrix.build_type }} cd ./build/${{ matrix.build_type }}

View File

@@ -11,8 +11,8 @@ build_type=Debug
[conf] [conf]
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'} tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fsanitize=address,undefined;-fno-sanitize-recover=all', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bin2CPP', 'force': True}} tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fsanitize=address,undefined,leak;-fno-sanitize-recover=all', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bin2CPP', 'force': True}}
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fsanitize=address,undefined', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bin2CPP', 'force': True}} tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fsanitize=address,undefined,leak', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bin2CPP', 'force': True}}
tools.system.package_manager:mode=install tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True tools.system.package_manager:sudo=True

32
ConanProfiles/clangd2 Normal file
View File

@@ -0,0 +1,32 @@
[settings]
os=Linux
arch=x86_64
compiler=clang
compiler.version=20
compiler.libcxx=libstdc++11
compiler.cppstd=20
compiler.cstd=17
compiler.runtime=static
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_CXX_COMPILER_LAUNCHER': 'ccache', 'CMAKE_C_COMPILER_LAUNCHER': 'ccache'}
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_CXX_FLAGS': {'value': '-Wall;-Wextra;-Wpedantic;-Werror;-fsanitize=memory,thread;-fno-sanitize-recover=all', 'cache': True, 'type': 'STRING', 'docstring': 'CXX flags for Bin2CPP', 'force': True}}
tools.cmake.cmaketoolchain:extra_variables*={'BIN2CPP_EXE_LINK_FLAGS': {'value': '-fsanitize=memory,thread', 'cache': True, 'type': 'STRING', 'docstring': 'EXE link flags for Bin2CPP', 'force': True}}
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
tools.build:exelinkflags=["-fuse-ld=mold"]
tools.build:sharedlinkflags=["-fuse-ld=mold"]
tools.cmake.cmaketoolchain:generator=Ninja
tools.build:compiler_executables={"c": "clang", "cpp": "clang++"}
[tool_requires]
!cmake/*: cmake/[>=4.2]
[options]
Bin2CPP/*:asan=True
Bin2CPP/*:build_tests=True