[Tarantool-patches] [PATCH luajit 1/6] ci: execute LuaJIT tests with GCC 10 and ASAN

Sergey Bronnikov estetus at gmail.com
Tue Mar 26 11:33:27 MSK 2024


From: Sergey Bronnikov <sergeyb at tarantool.org>

The commit fa8e9e9a721e ("test: enable <catch_wrap.lua> LuaJIT test")
brings a workaround to CMake for running tests with LuaJIT built by GCC
with enabled AddressSanitizer. However, we have no such configuration in
CI, which means that sooner or later it will be broken.

The patch adds a job to GH Actions that builds LuaJIT with GCC 10 with
enabled AddressSanitizer and runs LuaJIT tests. Linux builds are built
by runners on Ubuntu Focal, where GCC 10 is the latest version [1]
available in packages.

Library libstdc++ is needed by the test <catch_wrap.lua> for a
workaround with AddressSanitizer.

1. https://packages.ubuntu.com/focal/gcc-10

Follows up tarantool/tarantool#9398
Relates to tarantool/tarantool#9656
---
 .github/actions/setup-sanitizers/action.yml | 15 ++++++++++++---
 .github/workflows/sanitizers-testing.yml    |  4 ++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/.github/actions/setup-sanitizers/action.yml b/.github/actions/setup-sanitizers/action.yml
index 4b74f39d..8642d553 100644
--- a/.github/actions/setup-sanitizers/action.yml
+++ b/.github/actions/setup-sanitizers/action.yml
@@ -1,5 +1,10 @@
 name: Setup CI environment for testing with sanitizers on Linux
 description: Common part to tweak Linux CI runner environment for sanitizers
+inputs:
+  cc_name:
+    description: C compiler name (for example, gcc-12)
+    required: false
+    default: clang-11
 runs:
   using: composite
   steps:
@@ -15,9 +20,13 @@ runs:
     - name: Install build and test dependencies
       run: |
         apt -y update
-        apt -y install clang-11 cmake ninja-build make perl
+        apt -y install ${CC_NAME} libstdc++-10-dev cmake ninja-build make perl
       shell: bash
-    - name: Set Clang as a default toolchain
+      env:
+        CC_NAME: ${{ inputs.cc_name }}
+    - name: Set specific C compiler as a default toolchain
       run: |
-        echo CC=clang-11 | tee -a $GITHUB_ENV
+        echo CC=${CC_NAME} | tee -a $GITHUB_ENV
       shell: bash
+      env:
+        CC_NAME: ${{ inputs.cc_name }}
diff --git a/.github/workflows/sanitizers-testing.yml b/.github/workflows/sanitizers-testing.yml
index 4bccfcef..a06398ea 100644
--- a/.github/workflows/sanitizers-testing.yml
+++ b/.github/workflows/sanitizers-testing.yml
@@ -33,6 +33,7 @@ jobs:
       matrix:
         # XXX: Let's start with only Linux/x86_64
         BUILDTYPE: [Debug, Release]
+        CC: [gcc-10, clang-11]
         include:
           - BUILDTYPE: Debug
             CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
@@ -42,6 +43,7 @@ jobs:
     name: >
       LuaJIT with ASan (Linux/x86_64)
       ${{ matrix.BUILDTYPE }}
+      CC:${{ matrix.CC }}
       GC64:ON SYSMALLOC:ON
     steps:
       - uses: actions/checkout at v3
@@ -50,6 +52,8 @@ jobs:
           submodules: recursive
       - name: setup Linux for sanitizers
         uses: ./.github/actions/setup-sanitizers
+        with:
+          cc_name: ${{ matrix.CC }}
       - name: configure
         # XXX: LuaJIT configuration requires a couple of tweaks:
         # LUAJIT_USE_SYSMALLOC=ON: Unfortunately, internal LuaJIT
-- 
2.34.1



More information about the Tarantool-patches mailing list