mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 09:55:45 +02:00
fix(ci): sanitizers build (#4457)
* compile with clang * update container to version 24 * move to x86 github runner ubuntu 24 * use compiler-rt instead of libgcc * add cmake glue
This commit is contained in:
parent
e89c15bc6a
commit
0eff6c93f2
2 changed files with 21 additions and 5 deletions
18
.github/workflows/daily-sanitizers.yml
vendored
18
.github/workflows/daily-sanitizers.yml
vendored
|
@ -7,13 +7,14 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: [self-hosted, linux, ARM64]
|
||||
runs-on: [ubuntu-24.04]
|
||||
strategy:
|
||||
matrix:
|
||||
container: ["ubuntu-dev:22"]
|
||||
container: ["ubuntu-dev:24"]
|
||||
build-type: [Debug]
|
||||
compiler: [{ cxx: g++, c: gcc }]
|
||||
cxx_flags: ["-Werror"]
|
||||
compiler: [{ cxx: clang++, c: clang }]
|
||||
# TODO bring it back when warnings on clang are fixed
|
||||
# cxx_flags: ["-Werror"]
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
|
@ -59,6 +60,10 @@ jobs:
|
|||
|
||||
- name: Configure & Build
|
||||
run: |
|
||||
apt -y update
|
||||
apt -y upgrade
|
||||
apt install -y clang
|
||||
which clang
|
||||
echo "ulimit is"
|
||||
ulimit -s
|
||||
echo "-----------------------------"
|
||||
|
@ -76,7 +81,10 @@ jobs:
|
|||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
|
||||
-DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}}" \
|
||||
-DWITH_ASAN=ON \
|
||||
-DWITH_USAN=ON
|
||||
-DWITH_USAN=ON \
|
||||
-DCMAKE_C_FLAGS=-Wno-error=unused-command-line-argument \
|
||||
-DCMAKE_CXX_FLAGS=-Wno-error=unused-command-line-argument
|
||||
# https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt)
|
||||
|
||||
ninja src/all
|
||||
|
||||
|
|
|
@ -40,16 +40,24 @@ option(DF_USE_SSL "Provide support for SSL connections" ON)
|
|||
|
||||
find_package(OpenSSL)
|
||||
|
||||
SET(SANITIZERS OFF)
|
||||
|
||||
option(WITH_ASAN "Enable -fsanitize=address" OFF)
|
||||
if (SUPPORT_ASAN AND WITH_ASAN)
|
||||
message(STATUS "address sanitizer enabled")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
|
||||
set(SANITIZERS ON)
|
||||
endif()
|
||||
|
||||
option(WITH_USAN "Enable -fsanitize=undefined" OFF)
|
||||
if (SUPPORT_USAN AND WITH_USAN)
|
||||
message(STATUS "ub sanitizer enabled")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined")
|
||||
set(SANITIZERS ON)
|
||||
endif()
|
||||
|
||||
if(SANITIZERS)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -rtlib=compiler-rt")
|
||||
endif()
|
||||
|
||||
include(third_party)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue