diff mbox series

[3/4,v2] meson.bbclass: Allow early compiler tests to be bypassed if necessary

Message ID 20240522061016.1763718-1-alejandro@enedino.org
State New
Headers show
Series None | expand

Commit Message

Alejandro Enedino Hernandez Samaniego May 22, 2024, 6:10 a.m. UTC
Setting skip_sanity_check=true in the [properties] section of meson.cross allows
early compiler tests to be skipped on cross compilation environments where
sanity applications cant be compiled or tested.

Setting MESON_SKIP_SANITY_CHECK=1 enables this behavior.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
---
 meta/classes-recipe/meson.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ross Burton June 4, 2024, 12:09 p.m. UTC | #1
This is pretty niche behaviour - is it worth adding to the increasingly complex meson.bbclass?  Can it just be added to the picolibc recipe instead?

Ross

> On 22 May 2024, at 07:10, Alejandro Hernandez Samaniego via lists.openembedded.org <alejandro=enedino.org@lists.openembedded.org> wrote:
> 
> Setting skip_sanity_check=true in the [properties] section of meson.cross allows
> early compiler tests to be skipped on cross compilation environments where
> sanity applications cant be compiled or tested.
> 
> Setting MESON_SKIP_SANITY_CHECK=1 enables this behavior.
> 
> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
> ---
> meta/classes-recipe/meson.bbclass | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
> index 03fa2c06eb..492243c3c0 100644
> --- a/meta/classes-recipe/meson.bbclass
> +++ b/meta/classes-recipe/meson.bbclass
> @@ -61,7 +61,7 @@ def rust_tool(d, target_var):
>     return "rust = %s" % repr(cmd)
> 
> addtask write_config before do_configure
> -do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED"
> +do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED MESON_SKIP_SANITY_CHECK"
> do_write_config() {
>     # This needs to be Py to split the args into single-element lists
>     cat >${WORKDIR}/meson.cross <<EOF
> @@ -89,6 +89,7 @@ cpp_args = ${@meson_array('CXXFLAGS', d)}
> cpp_link_args = ${@meson_array('LDFLAGS', d)}
> 
> [properties]
> +${@"skip_sanity_check = true" if d.getVar('MESON_SKIP_SANITY_CHECK') == '1' else ""}
> needs_exe_wrapper = true
> sys_root = '${STAGING_DIR_HOST}'
> 
> -- 
> 2.45.1
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#199686): https://lists.openembedded.org/g/openembedded-core/message/199686
> Mute This Topic: https://lists.openembedded.org/mt/106238394/6875888
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ross.burton@arm.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index 03fa2c06eb..492243c3c0 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -61,7 +61,7 @@  def rust_tool(d, target_var):
     return "rust = %s" % repr(cmd)
 
 addtask write_config before do_configure
-do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED"
+do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED MESON_SKIP_SANITY_CHECK"
 do_write_config() {
     # This needs to be Py to split the args into single-element lists
     cat >${WORKDIR}/meson.cross <<EOF
@@ -89,6 +89,7 @@  cpp_args = ${@meson_array('CXXFLAGS', d)}
 cpp_link_args = ${@meson_array('LDFLAGS', d)}
 
 [properties]
+${@"skip_sanity_check = true" if d.getVar('MESON_SKIP_SANITY_CHECK') == '1' else ""}
 needs_exe_wrapper = true
 sys_root = '${STAGING_DIR_HOST}'