From cc62753cf3a8a837d1c3df6149b2f2cb4d68dd49 Mon Sep 17 00:00:00 2001 From: Sean T Allen Date: Fri, 24 Jan 2025 13:56:58 -0500 Subject: [PATCH] Reorganize CI sanitizers pull request job (#4596) --- .github/workflows/pr.yml | 54 +++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 17fb575b81..107239b9a4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -452,9 +452,6 @@ jobs: - image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu24.04-builder:20250115 debugger: lldb directives: runtimestats - - image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu24.04-builder:20250115 - debugger: lldb - directives: pool_memalign,address_sanitizer,undefined_behavior_sanitizer name: use ${{ matrix.directives }} container: @@ -479,34 +476,61 @@ jobs: path: build/libs key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt') }} - name: Build Debug Runtime - if: matrix.directives != 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' run: | make configure arch=x86-64 config=debug use=${{ matrix.directives }} make build config=debug - name: Test with Debug Runtime - if: matrix.directives != 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' run: make test-ci config=debug usedebugger='${{ matrix.debugger }}' - name: Build Release Runtime - if: matrix.directives != 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' run: | make configure arch=x86-64 config=release use=${{ matrix.directives }} make build config=release - name: Test with Release Runtime - if: matrix.directives != 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' run: make test-ci config=release usedebugger='${{ matrix.debugger }}' - - name: Build Debug Runtime (sanitizers) - if: matrix.directives == 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' + + with_sanitizers: + runs-on: ubuntu-latest + needs: x86_64-linux + + strategy: + fail-fast: false + matrix: + include: + - image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu24.04-builder:20250115 + debugger: lldb + directives: pool_memalign,address_sanitizer,undefined_behavior_sanitizer + + name: with sanitizers ${{ matrix.directives }} + container: + image: ${{ matrix.image }} + options: --user pony --cap-add=SYS_PTRACE --security-opt seccomp=unconfined + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Restore Libs Cache + id: restore-libs + uses: actions/cache/restore@v4 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt') }} + - name: Build Libs + if: steps.restore-libs.outputs.cache-hit != 'true' + run: make libs build_flags=-j8 + - name: Save Libs Cache + if: steps.restore-libs.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: build/libs + key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt') }} + - name: Build Debug Runtime run: | ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make configure arch=x86-64 config=debug use=${{ matrix.directives }} ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make build config=debug - - name: Test with Debug Runtime (sanitizers) - if: matrix.directives == 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' + - name: Test with Debug Runtime run: ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make test-ci config=debug - - name: Build Release Runtime (sanitizers) - if: matrix.directives == 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' + - name: Build Release Runtime run: | ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make configure arch=x86-64 config=release use=${{ matrix.directives }} ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make build config=release - - name: Test with Release Runtime (sanitizers) - if: matrix.directives == 'pool_memalign,address_sanitizer,undefined_behavior_sanitizer' + - name: Test with Release Runtime run: ASAN_OPTIONS=detect_leaks=0:external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer UBSAN_OPTIONS=external_symbolizer_path=$PWD/build/libs/bin/llvm-symbolizer make test-ci config=release