Skip to content

Commit

Permalink
[c++] Add ASAN run of CI to weekly CI job (#3434)
Browse files Browse the repository at this point in the history
* Update Makefile and dev docs for sanitizer builds
* Add weekly workflow for ASAN CI
* Run workflow for PRs that modify workflow
  • Loading branch information
jp-dark authored Dec 16, 2024
1 parent 1fa2666 commit 68eeced
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/libtiledbsoma-asan-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: libtiledbsoma ASAN

on:
pull_request:
paths:
- '.github/workflows/libtiledbsoma-asan-ci.yml'
schedule:
- cron: 20 8 * * 0
workflow_dispatch:

jobs:
asan:
runs-on: ubuntu-24.04
steps:
- name: Checkout TileDB-SOMA
uses: actions/checkout@v4
- name: Install pre-built libtiledb
run: |
mkdir -p external
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.27.0/tiledb-linux-x86_64-2.27.0-2862c30.tar.gz
tar -C external -xzf tiledb-*.tar.gz
ls external/lib/
- name: Build and install libtiledbsoma
run: |
cmake -S libtiledbsoma -B build \
-D CMAKE_BUILD_TYPE=ASAN \
-D CMAKE_PREFIX_PATH=$(pwd)/external/ \
-D CMAKE_INSTALL_PREFIX:PATH=$(pwd)/external/ \
-D OVERRIDE_INSTALL_PREFIX=OFF \
-D DOWNLOAD_TILEDB_PREBUILT=OFF \
-D TILEDB_REMOVE_DEPRECATIONS=ON \
-D FORCE_BUILD_TILEDB=OFF
cmake --build build -j 2
ls external/lib/
- name: Run C++ unittests
run: ctest --test-dir build/libtiledbsoma -C ASAN --verbose --rerun-failed --output-on-failure
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Rules:
clean Remove build artifacts

Options:
build=BUILD_TYPE Cmake build type = Release|Debug|RelWithDebInfo|Coverage [Release]
build=BUILD_TYPE Cmake build type = Release|Debug|RelWithDebInfo|ASAN|TSAN|LSAN|UBSAN|MSAN|Coverage [Release]
prefix=PREFIX Install location [${PWD}/dist]
tiledb=TILEDB_DIST Absolute path to custom TileDB build

Expand Down Expand Up @@ -118,4 +118,3 @@ export HELP
.PHONY: help
help:
@printf "$${HELP}"

6 changes: 3 additions & 3 deletions libtiledbsoma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This approach leverages the build-system defined in [pyproject.toml](../apis/pyt

## Python and C++ Development

Developers who plan to modify the C++ code must use these build commands:
Developers who plan to modify the C++ code must use these build commands:

```
# clean, build, and install
Expand Down Expand Up @@ -77,9 +77,9 @@ Rules:
clean Remove build artifacts
Options:
build=BUILD_TYPE Cmake build type = Release|Debug|RelWithDebInfo|Coverage [Release]
build=BUILD_TYPE Cmake build type = Release|Debug|RelWithDebInfo|ASAN|TSAN|LSAN|UBSAN|MSAN|Coverage [Release]
prefix=PREFIX Install location [dist]
tiledb=TILEDB_DIST Absolute path to custom TileDB build
tiledb=TILEDB_DIST Absolute path to custom TileDB build
Examples:
Install Release build
Expand Down
2 changes: 1 addition & 1 deletion scripts/bld
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
# set extra cmake options
# -------------------------------------------------------------------
extra_opts=""
if [ "${build}" == "Debug" ] && [ -z "${tiledb}" ]; then
if [ "${build}" != "Release" ] && [ -z "${tiledb}" ]; then
# Debug build of TileDB from source
extra_opts+=" -DDOWNLOAD_TILEDB_PREBUILT=OFF"
fi
Expand Down
5 changes: 5 additions & 0 deletions scripts/update-tiledb-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ def main(args):
)
update_version(filepath, new_version, new_hash)

filepath = (
f"{os.path.dirname(__file__)}/../.github/workflows/libtiledbsoma-asan-ci.yml"
)
update_version(filepath, new_version, new_hash)


if __name__ == "__main__":
description = (
Expand Down

0 comments on commit 68eeced

Please sign in to comment.