[CI,v1,1/2] Add compilation test with C++20
diff mbox series

Message ID 20240507181756.32635-2-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera CI coverage improvements
Related show

Commit Message

Laurent Pinchart May 7, 2024, 6:17 p.m. UTC
libcamera currently uses C++17, but we want to prepare for a switch to
C++20 in the somehow distant future. Avoid C++20 regressions by adding a
compilation test with C++20. Do so with g++ 13, which is the most likely
version of g++ to support this newer language version properly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 gitlab-ci.yml | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Kieran Bingham May 7, 2024, 8:15 p.m. UTC | #1
Quoting Laurent Pinchart (2024-05-07 19:17:55)
> libcamera currently uses C++17, but we want to prepare for a switch to
> C++20 in the somehow distant future. Avoid C++20 regressions by adding a
> compilation test with C++20. Do so with g++ 13, which is the most likely
> version of g++ to support this newer language version properly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  gitlab-ci.yml | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index 3dcb512525ed..225d929bd2ed 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -185,10 +185,17 @@ build-full:debian:13:
>    needs:
>      - job: container-debian:13
>        artifacts: false
> -  variables:
> -    ARCH: amd64
> -    CC: gcc-13
> -    CXX: g++-13
> +  parallel:
> +    matrix:
> +      - ARCH: amd64
> +        CC: gcc-13
> +        CXX: g++-13
> +      - ARCH: amd64
> +        CC: gcc-13
> +        CXX: g++-13
> +        MESON_OPTIONS: >-
> +          ${MESON_ALL_OPTIONS}
> +          -D cpp_std=c++20

Sounds good to me, but is there really a need to build with gcc-13
twice?

I guess it does still ensure gcc-13 still is valid at C++17, and means
we can update our C++20 builds to later compilers too sooo

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>  
>  # Build each commit in the branch individually to detect compilation breakages.
>  build-history:
> -- 
> Regards,
> 
> Laurent Pinchart
>
Laurent Pinchart May 7, 2024, 8:25 p.m. UTC | #2
On Tue, May 07, 2024 at 09:15:24PM +0100, Kieran Bingham wrote:
> Quoting Laurent Pinchart (2024-05-07 19:17:55)
> > libcamera currently uses C++17, but we want to prepare for a switch to
> > C++20 in the somehow distant future. Avoid C++20 regressions by adding a
> > compilation test with C++20. Do so with g++ 13, which is the most likely
> > version of g++ to support this newer language version properly.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  gitlab-ci.yml | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> > index 3dcb512525ed..225d929bd2ed 100644
> > --- a/gitlab-ci.yml
> > +++ b/gitlab-ci.yml
> > @@ -185,10 +185,17 @@ build-full:debian:13:
> >    needs:
> >      - job: container-debian:13
> >        artifacts: false
> > -  variables:
> > -    ARCH: amd64
> > -    CC: gcc-13
> > -    CXX: g++-13
> > +  parallel:
> > +    matrix:
> > +      - ARCH: amd64
> > +        CC: gcc-13
> > +        CXX: g++-13
> > +      - ARCH: amd64
> > +        CC: gcc-13
> > +        CXX: g++-13
> > +        MESON_OPTIONS: >-
> > +          ${MESON_ALL_OPTIONS}
> > +          -D cpp_std=c++20
> 
> Sounds good to me, but is there really a need to build with gcc-13
> twice?
> 
> I guess it does still ensure gcc-13 still is valid at C++17, and means
> we can update our C++20 builds to later compilers too sooo

I suppose we could save CPU cycles by compiling for C++20 only in the
gcc 13 test. Do you have a preference ?

> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> >  # Build each commit in the branch individually to detect compilation breakages.
> >  build-history:

Patch
diff mbox series

diff --git a/gitlab-ci.yml b/gitlab-ci.yml
index 3dcb512525ed..225d929bd2ed 100644
--- a/gitlab-ci.yml
+++ b/gitlab-ci.yml
@@ -185,10 +185,17 @@  build-full:debian:13:
   needs:
     - job: container-debian:13
       artifacts: false
-  variables:
-    ARCH: amd64
-    CC: gcc-13
-    CXX: g++-13
+  parallel:
+    matrix:
+      - ARCH: amd64
+        CC: gcc-13
+        CXX: g++-13
+      - ARCH: amd64
+        CC: gcc-13
+        CXX: g++-13
+        MESON_OPTIONS: >-
+          ${MESON_ALL_OPTIONS}
+          -D cpp_std=c++20
 
 # Build each commit in the branch individually to detect compilation breakages.
 build-history: