-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add sanitizers to ci workflow #4462
Open
kostasrim
wants to merge
15
commits into
main
Choose a base branch
from
kpr6
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5eb421a
chore: add sanitizers to ci workflow
kostasrim d44a95e
add missing run
kostasrim 3ca3d41
try qith single quote
kostasrim 5dd131f
add missing double quotes
kostasrim 7648050
try
kostasrim 079d1af
small fix
kostasrim b3d657e
comments
kostasrim 9c29cf7
clean up
kostasrim 5e409e3
try
kostasrim 9753d98
remove exclude
kostasrim f10bd94
comment out sscache
kostasrim 41e2fb4
comment out alpine
kostasrim 536478c
comment out alpine
kostasrim b6f346b
fix
kostasrim 0d98ac2
alpine
kostasrim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,11 +44,19 @@ jobs: | |
build-type: [Debug, Release] | ||
compiler: [{ cxx: g++, c: gcc }] | ||
cxx_flags: ["-Werror"] | ||
sanitizers: ["NoSanitizers"] | ||
include: | ||
- container: "alpine-dev:latest" | ||
build-type: Debug | ||
compiler: { cxx: clang++, c: clang } | ||
cxx_flags: "" | ||
sanitizers: "NoSanitizers" | ||
- container: "ubuntu-dev:24" | ||
build-type: Debug | ||
compiler: { cxx: clang++, c: clang } | ||
# https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt) | ||
cxx_flags: "-Wno-error=unused-command-line-argument" | ||
sanitizers: "Sanitizers" | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -72,6 +80,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Prepare Environment | ||
run: | | ||
uname -a | ||
|
@@ -89,6 +98,7 @@ jobs: | |
df -h | ||
touch /mnt/foo | ||
ls -la /mnt/foo | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
|
@@ -99,10 +109,35 @@ jobs: | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '') | ||
|
||
- name: Install clang | ||
if: matrix.sanitizers == 'Sanitizers' | ||
run: | | ||
# TODO remove this once the weekly is done | ||
apt -y update | ||
apt -y upgrade | ||
apt install -y clang | ||
which clang | ||
|
||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: | | ||
echo "ulimit is" | ||
ulimit -s | ||
echo "-----------------------------" | ||
echo "disk space is:" | ||
df -h | ||
echo "-----------------------------" | ||
|
||
export ASAN="OFF" | ||
export USAN="OFF" | ||
|
||
if [ '${{matrix.sanitizers}}' = 'Sanitizers' ]; then | ||
echo "ASAN/USAN" | ||
export ASAN="ON" | ||
export USAN="ON" | ||
fi | ||
|
||
# -no-pie to disable address randomization so we could symbolize stacktraces | ||
cmake -B ${GITHUB_WORKSPACE}/build \ | ||
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \ | ||
|
@@ -112,7 +147,10 @@ jobs: | |
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
-DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}} -no-pie" -DWITH_AWS:BOOL=OFF \ | ||
-DHELIO_STACK_CHECK:STRING=4096 \ | ||
-DWITH_ASAN="${ASAN}" \ | ||
-DWITH_USAN="${USAN}" \ | ||
-L | ||
|
||
cd ${GITHUB_WORKSPACE}/build && pwd | ||
du -hcs _deps/ | ||
|
||
|
@@ -149,7 +187,6 @@ jobs: | |
|
||
gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll | ||
FLAGS_force_epoll=true GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 timeout 20m ctest -V -L DFLY | ||
|
||
echo "Finished running tests with --force_epoll" | ||
|
||
echo "Running tests with --cluster_mode=emulated" | ||
|
@@ -161,6 +198,7 @@ jobs: | |
timeout 5m ./dragonfly_test | ||
timeout 5m ./json_family_test --jsonpathv2=false | ||
timeout 5m ./tiered_storage_test --vmodule=db_slice=2 --logtostderr | ||
|
||
- name: Upload unit logs on failure | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this step for sanitizers but not for alpine build that uses clang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make this a separate step to just install clang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because alpine comes prebundled with clang
IMO this is bad as well. It should be prebundled and should go under
container foundtry
and not as part of this workflow file. See: https://github.com/romange/container-foundry/blob/main/u24.04-dev.DockerfileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
romange/container-foundry#14