[libcamera-ci,v2] Enable `cpp_debugstl`
diff mbox series

Message ID 20241209171128.270901-1-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-ci,v2] Enable `cpp_debugstl`
Related show

Commit Message

Barnabás Pőcze Dec. 9, 2024, 5:11 p.m. UTC
Meson's `cpp_debugstl` built-in option enables extra checks
in libstdc++ and libc++, such as iterator invalidation tests,
bounds checking in the `operator[]` of multiple types, etc.
by setting `GLIBCXX_DEBUG` and `_LIBCPP_HARDENING_MODE`.

Enable it in the same cases ASan is enabled as they are
somewhat similar debugging tools.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
https://gitlab.freedesktop.org/pobrn/libcamera/-/pipelines/1326230

Changes in v2:
  * do not rebuild containers
  * note that it is enabled when ASan is enabled
---
 gitlab-ci.yml | 2 ++
 1 file changed, 2 insertions(+)

--
2.47.1

Comments

Laurent Pinchart Dec. 9, 2024, 11:45 p.m. UTC | #1
Hi Barnabás,

Thank you for the patch.

On Mon, Dec 09, 2024 at 06:11:28PM +0100, Barnabás Pőcze wrote:
> Meson's `cpp_debugstl` built-in option enables extra checks
> in libstdc++ and libc++, such as iterator invalidation tests,
> bounds checking in the `operator[]` of multiple types, etc.
> by setting `GLIBCXX_DEBUG` and `_LIBCPP_HARDENING_MODE`.
> 
> Enable it in the same cases ASan is enabled as they are
> somewhat similar debugging tools.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> https://gitlab.freedesktop.org/pobrn/libcamera/-/pipelines/1326230
> 
> Changes in v2:
>   * do not rebuild containers
>   * note that it is enabled when ASan is enabled
> ---
>  gitlab-ci.yml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index ea038ec..c78235e 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -15,6 +15,7 @@ variables:
>      -D android=enabled
>      -D b_sanitize=address
>      -D cam=enabled
> +    -D cpp_debugstl=true
>      -D documentation=enabled
>      -D gstreamer=enabled
>      -D lc-compliance=enabled
> @@ -389,6 +390,7 @@ test-unit:
>      MESON_OPTIONS: >-
>        -D b_sanitize=address
>        -D cam=disabled
> +      -D cpp_debugstl=true
>        -D documentation=disabled
>        -D gstreamer=enabled
>        -D lc-compliance=disabled
Kieran Bingham Dec. 10, 2024, 10:10 a.m. UTC | #2
Quoting Barnabás Pőcze (2024-12-09 17:11:28)
> Meson's `cpp_debugstl` built-in option enables extra checks
> in libstdc++ and libc++, such as iterator invalidation tests,
> bounds checking in the `operator[]` of multiple types, etc.
> by setting `GLIBCXX_DEBUG` and `_LIBCPP_HARDENING_MODE`.
> 
> Enable it in the same cases ASan is enabled as they are
> somewhat similar debugging tools.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
> https://gitlab.freedesktop.org/pobrn/libcamera/-/pipelines/1326230
> 
> Changes in v2:
>   * do not rebuild containers
>   * note that it is enabled when ASan is enabled

Sounds good to me.


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

> ---
>  gitlab-ci.yml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index ea038ec..c78235e 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -15,6 +15,7 @@ variables:
>      -D android=enabled
>      -D b_sanitize=address
>      -D cam=enabled
> +    -D cpp_debugstl=true
>      -D documentation=enabled
>      -D gstreamer=enabled
>      -D lc-compliance=enabled
> @@ -389,6 +390,7 @@ test-unit:
>      MESON_OPTIONS: >-
>        -D b_sanitize=address
>        -D cam=disabled
> +      -D cpp_debugstl=true
>        -D documentation=disabled
>        -D gstreamer=enabled
>        -D lc-compliance=disabled
> --
> 2.47.1

Patch
diff mbox series

diff --git a/gitlab-ci.yml b/gitlab-ci.yml
index ea038ec..c78235e 100644
--- a/gitlab-ci.yml
+++ b/gitlab-ci.yml
@@ -15,6 +15,7 @@  variables:
     -D android=enabled
     -D b_sanitize=address
     -D cam=enabled
+    -D cpp_debugstl=true
     -D documentation=enabled
     -D gstreamer=enabled
     -D lc-compliance=enabled
@@ -389,6 +390,7 @@  test-unit:
     MESON_OPTIONS: >-
       -D b_sanitize=address
       -D cam=disabled
+      -D cpp_debugstl=true
       -D documentation=disabled
       -D gstreamer=enabled
       -D lc-compliance=disabled