[v2] ci: check C++ headers with clang

Message ID 20250703082010.2002295-1-david.marchand@redhat.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series [v2] ci: check C++ headers with clang |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/aws-unit-testing success Unit Testing PASS
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing warning Testing issues
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

David Marchand July 3, 2025, 8:20 a.m. UTC
If not passing an explicit compiler for C++, meson uses c++ which
defaults to /usr/bin/g++ on a Ubuntu system.
Explicitly choose which compiler to use for C++.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- rebased,
- moved CXX tweaking in the branch enabling headers check,

---
 .ci/linux-build.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
  

Comments

Aaron Conole July 7, 2025, 1:41 p.m. UTC | #1
David Marchand <david.marchand@redhat.com> writes:

> If not passing an explicit compiler for C++, meson uses c++ which
> defaults to /usr/bin/g++ on a Ubuntu system.
> Explicitly choose which compiler to use for C++.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changes since v1:
> - rebased,
> - moved CXX tweaking in the branch enabling headers check,
>

Not sure why we got a segfault with this in IOL:

 36/120 DPDK:fast-tests / eal_flags_misc_autotest        FAIL             3.78s   killed by signal 11 SIGSEGV

I don't think it is related.

Acked-by: Aaron Conole <aconole@redhat.com>
  
David Marchand July 7, 2025, 2:08 p.m. UTC | #2
On Mon, Jul 7, 2025 at 3:41 PM Aaron Conole <aconole@redhat.com> wrote:
>
> David Marchand <david.marchand@redhat.com> writes:
>
> > If not passing an explicit compiler for C++, meson uses c++ which
> > defaults to /usr/bin/g++ on a Ubuntu system.
> > Explicitly choose which compiler to use for C++.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > Changes since v1:
> > - rebased,
> > - moved CXX tweaking in the branch enabling headers check,
> >
>
> Not sure why we got a segfault with this in IOL:
>
>  36/120 DPDK:fast-tests / eal_flags_misc_autotest        FAIL             3.78s   killed by signal 11 SIGSEGV

Strange segfault indeed.

The logs show:
...
EAL: VFIO support initialized
EAL: invalid parameters for --log-color
EAL: invalid log arguments.
EAL: Unregistering with invalid input parameter
EAL: Memzone is not allocated


This smells like a double free... maybe a race in the cleanup phase.

And then this reminds me of a change we did for v25.07.
d84bf0d9aeb4 ("eal/linux: unregister alarm callback before free")

But I don't see something wrong with this change.

Copying author and reviewer.


> I don't think it is related.

I don't see how my patch on testing headers with C++ could be related :-).
  
David Marchand July 9, 2025, 9:32 a.m. UTC | #3
On Thu, Jul 3, 2025 at 10:20 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> If not passing an explicit compiler for C++, meson uses c++ which
> defaults to /usr/bin/g++ on a Ubuntu system.
> Explicitly choose which compiler to use for C++.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Aaron Conole <aconole@redhat.com>

Applied, thanks.
  

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e9272d3931..5c4bfa75c3 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -102,9 +102,14 @@  OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS -Ddefault_library=$DEF_LIB"
 OPTS="$OPTS -Dbuildtype=$buildtype"
 if [ "$STDATOMIC" = "true" ]; then
-	OPTS="$OPTS -Denable_stdatomic=true"
+    OPTS="$OPTS -Denable_stdatomic=true"
 else
-	OPTS="$OPTS -Dcheck_includes=true"
+    OPTS="$OPTS -Dcheck_includes=true"
+    if [ "${CC%%clang}" != "$CC" ]; then
+        export CXX=clang++
+    else
+        export CXX=g++
+    fi
 fi
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"