ci: test stdatomic API
PATCH 1/1 ci: test stdatomic API
Add some compilation tests with C11 atomics enabled. The headers check can't be enabled (as gcc and clang don't provide stdatomic before C++23).
--- .ci/linux-build.sh | 6 +++++- .github/workflows/build.yml | 8 ++++++++ devtools/test-meson-builds.sh | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-)
.ci/linux-build.sh +5 -1
@@ -92,7 +92,11 @@ fi OPTS="$OPTS -Dplatform=generic" OPTS="$OPTS -Ddefault_library=$DEF_LIB" OPTS="$OPTS -Dbuildtype=$buildtype" -OPTS="$OPTS -Dcheck_includes=true" +if [ "$STDATOMIC" = "true" ]; then + OPTS="$OPTS -Denable_stdatomic=true" +else + OPTS="$OPTS -Dcheck_includes=true" +fi if [ "$MINI" = "true" ]; then OPTS="$OPTS -Denable_drivers=net/null" OPTS="$OPTS -Ddisable_libs=*"
.github/workflows/build.yml +8 -0
@@ -30,6 +30,7 @@ jobs: REF_GIT_TAG: none RISCV64: ${{ matrix.config.cross == 'riscv64' }} RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }} + STDATOMIC: ${{ contains(matrix.config.checks, 'stdatomic') }} strategy: fail-fast: false
@@ -38,6 +39,12 @@ jobs: - os: ubuntu-20.04 compiler: gcc mini: mini + - os: ubuntu-20.04 + compiler: gcc + checks: stdatomic + - os: ubuntu-20.04 + compiler: clang + checks: stdatomic - os: ubuntu-20.04 compiler: gcc checks: debug+doc+examples+tests
@@ -241,6 +248,7 @@ jobs: > ~/env echo CC=ccache ${{ matrix.config.compiler }} >> ~/env echo DEF_LIB=${{ matrix.config.library }} >> ~/env + echo STDATOMIC=false >> ~/env - name: Load the cached image run: | docker load -i ~/.image/${{ matrix.config.image }}.tar
devtools/test-meson-builds.sh +3 -0
@@ -239,6 +239,9 @@ done build build-mini cc skipABI $use_shared -Ddisable_libs=* \ -Denable_drivers=net/null +build build-gcc-shared-stdatomic gcc skipABI -Denable_stdatomic=true $use_shared +build build-clang-shared-stdatomic clang skipABI -Denable_stdatomic=true $use_shared + # test compilation with minimal x86 instruction set # Set the install path for libraries to "lib" explicitly to prevent problems # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
Signature · 1 line
2.41.0
Quoted 6 lines · David Marchand
Add some compilation tests with C11 atomics enabled. The headers check can't be enabled (as gcc and clang don't provide stdatomic before C++23).
Signed-off-by David Marchand <[email protected]>---
PATCH v2 1/1 ci: test stdatomic API
In reply to David MarchandAdd some compilation tests with C11 atomics enabled. The headers check can't be enabled (as gcc and clang don't provide stdatomic before C++23).
---
Changelog from v1:
- following Thomas offlist review, tweaked coverage in test-meson-builds.sh to reduce the number of build targets,
--- .ci/linux-build.sh | 6 +++++- .github/workflows/build.yml | 8 ++++++++ devtools/test-meson-builds.sh | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-)
.ci/linux-build.sh +5 -1
@@ -92,7 +92,11 @@ fi OPTS="$OPTS -Dplatform=generic" OPTS="$OPTS -Ddefault_library=$DEF_LIB" OPTS="$OPTS -Dbuildtype=$buildtype" -OPTS="$OPTS -Dcheck_includes=true" +if [ "$STDATOMIC" = "true" ]; then + OPTS="$OPTS -Denable_stdatomic=true" +else + OPTS="$OPTS -Dcheck_includes=true" +fi if [ "$MINI" = "true" ]; then OPTS="$OPTS -Denable_drivers=net/null" OPTS="$OPTS -Ddisable_libs=*"
.github/workflows/build.yml +8 -0
@@ -30,6 +30,7 @@ jobs: REF_GIT_TAG: none RISCV64: ${{ matrix.config.cross == 'riscv64' }} RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }} + STDATOMIC: ${{ contains(matrix.config.checks, 'stdatomic') }} strategy: fail-fast: false
@@ -38,6 +39,12 @@ jobs: - os: ubuntu-20.04 compiler: gcc mini: mini + - os: ubuntu-20.04 + compiler: gcc + checks: stdatomic + - os: ubuntu-20.04 + compiler: clang + checks: stdatomic - os: ubuntu-20.04 compiler: gcc checks: debug+doc+examples+tests
@@ -241,6 +248,7 @@ jobs: > ~/env echo CC=ccache ${{ matrix.config.compiler }} >> ~/env echo DEF_LIB=${{ matrix.config.library }} >> ~/env + echo STDATOMIC=false >> ~/env - name: Load the cached image run: | docker load -i ~/.image/${{ matrix.config.image }}.tar
devtools/test-meson-builds.sh +3 -1
@@ -227,11 +227,13 @@ for c in gcc clang ; do for s in static shared ; do if [ $s = shared ] ; then abicheck=ABI + stdatomic=-Denable_stdatomic=true else abicheck=skipABI # save time and disk space + stdatomic=-Denable_stdatomic=false fi export CC="$CCACHE $c" - build build-$c-$s $c $abicheck --default-library=$s + build build-$c-$s $c $abicheck $stdatomic --default-library=$s unset CC done done
Signature · 1 line
2.41.0
David Marchand
AppliedQuoted 7 lines · David Marchand
Add some compilation tests with C11 atomics enabled. The headers check can't be enabled (as gcc and clang don't provide stdatomic before C++23).
Signed-off-by David Marchand <[email protected]>Reviewed-by Aaron Conole <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand