From e71b109b1fad114c20332b72a6804f0225715090 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 23:33:28 +0000 Subject: [PATCH 1/2] feat: Add Address Sanitizer to CI --- .github/workflows/R-CMD-check.yaml | 35 ++++++++++++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 14159b7..d3cd711 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -48,3 +48,38 @@ jobs: with: upload-snapshots: true build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + + ASAN: + runs-on: ubuntu-latest + name: Ubuntu (release) with ASAN + strategy: + fail-fast: false + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + ASAN_OPTIONS: "detect_leaks=0" + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 'release' + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - name: Build with ASAN + run: make asan + + - name: Run R CMD check + run: | + install.packages("remotes") + remotes::install_local(".") + rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran")) + shell: Rscript {0} diff --git a/Makefile b/Makefile index fee0eed..d83929d 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ SRC=./src lib: clean # build the shared library version of dbc2dbf R CMD SHLIB -o src/db2dbf.so src/*.c -fsanitize=undefined +.PHONY: asan +asan: clean # build the shared library with Address Sanitizer + R CMD SHLIB -o src/db2dbf.so src/*.c -fsanitize=address -fno-omit-frame-pointer + .PHONY: clean clean: # clean generated files rm -rf revdep/* From 66d76e20b425888bcb71ca3d79ba2dbf09670d70 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 23:37:48 +0000 Subject: [PATCH 2/2] feat: Add Address Sanitizer to CI --- .github/workflows/R-CMD-check.yaml | 43 ++++++------------------------ Makefile | 4 --- 2 files changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index d3cd711..182e929 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -44,42 +44,15 @@ jobs: extra-packages: any::rcmdcheck needs: check + - name: Build with ASAN + if: runner.os == 'Linux' + run: make lib + + - name: Set ASAN_OPTIONS + if: runner.os == 'Linux' + run: echo "ASAN_OPTIONS=detect_leaks=0" >> $GITHUB_ENV + - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' - - ASAN: - runs-on: ubuntu-latest - name: Ubuntu (release) with ASAN - strategy: - fail-fast: false - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - ASAN_OPTIONS: "detect_leaks=0" - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: 'release' - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - name: Build with ASAN - run: make asan - - - name: Run R CMD check - run: | - install.packages("remotes") - remotes::install_local(".") - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran")) - shell: Rscript {0} diff --git a/Makefile b/Makefile index d83929d..3bda982 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,6 @@ SRC=./src .PHONY: lib lib: clean # build the shared library version of dbc2dbf - R CMD SHLIB -o src/db2dbf.so src/*.c -fsanitize=undefined - -.PHONY: asan -asan: clean # build the shared library with Address Sanitizer R CMD SHLIB -o src/db2dbf.so src/*.c -fsanitize=address -fno-omit-frame-pointer .PHONY: clean