[Tarantool-patches] [PATCH luajit 1/3][v4] ci: execute LuaJIT tests with GCC 10 and ASAN
Sergey Bronnikov
estetus at gmail.com
Thu Mar 21 17:01:58 MSK 2024
From: Sergey Bronnikov <sergeyb at tarantool.org>
The commit fa8e9e9a721e ("test: enable <catch_wrap.lua> LuaJIT test")
bring a workaround to CMake for running tests with LuaJIT built
by GCC with enabled AddressSanitizer. However, we have
no such configuration in CI, it 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 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
---
.github/actions/setup-sanitizers/action.yml | 15 ++++++++++++---
.github/workflows/sanitizers-testing.yml | 11 +++++++++++
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.github/actions/setup-sanitizers/action.yml b/.github/actions/setup-sanitizers/action.yml
index 4b74f39d..bab40d2b 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 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..5a24d4ca 100644
--- a/.github/workflows/sanitizers-testing.yml
+++ b/.github/workflows/sanitizers-testing.yml
@@ -33,15 +33,24 @@ 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
+ CC: gcc-10
+ - BUILDTYPE: Debug
+ CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
+ CC: clang-11
- BUILDTYPE: Release
CMAKEFLAGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ exclude:
+ - BUILDTYPE: Release
+ CC: gcc-10
runs-on: [self-hosted, regular, Linux, x86_64]
name: >
LuaJIT with ASan (Linux/x86_64)
${{ matrix.BUILDTYPE }}
+ CC:${{ matrix.CC }}
GC64:ON SYSMALLOC:ON
steps:
- uses: actions/checkout at v3
@@ -50,6 +59,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