diff mbox series

[1/2] meson: Allow user to override setup command options

Message ID 20250327225959.3611495-1-tom.hochstein@oss.nxp.com
State New
Headers show
Series [1/2] meson: Allow user to override setup command options | expand

Commit Message

Tom Hochstein March 27, 2025, 10:59 p.m. UTC
The user cannot override the setup command options --cross-file and
--native-file because the meson-wrapper places these options on the
command line after the user options. This problem was noticed when
trying to build with an SDK using a custom cross-file.

Signed-off-by: Tom Hochstein <tom.hochstein@oss.nxp.com>
---
 meta/recipes-devtools/meson/meson/meson-wrapper | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Mathieu Dubois-Briand March 28, 2025, 10:36 a.m. UTC | #1
On Thu Mar 27, 2025 at 11:59 PM CET, Tom Hochstein via lists.openembedded.org wrote:
> The user cannot override the setup command options --cross-file and
> --native-file because the meson-wrapper places these options on the
> command line after the user options. This problem was noticed when
> trying to build with an SDK using a custom cross-file.
>
> Signed-off-by: Tom Hochstein <tom.hochstein@oss.nxp.com>
> ---

Hi Tom,

Thanks for your patch.

It looks it breaks some test on the autobuilder, maybe specific to x86:

Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/sdk/cases/meson.py", line 42, in test_epoxy
    log = self._run("meson --warnlevel 1 -Degl=no -Dglx=no -Dx11=false {build} {source}".format(**dirs))
  File "/srv/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/sdk/case.py", line 15, in _run
    return subprocess.check_output(". %s > /dev/null; %s;" % \
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
oeqa.utils.subprocesstweak.OETestCalledProcessError: Command '. /srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/environment-setup-core2-32-poky-linux > /dev/null; meson --warnlevel 1 -Degl=no -Dglx=no -Dx11=false /srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/epoxy9vkngm2b/build /srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/epoxy9vkngm2b/libepoxy-1.5.3;' returned non-zero exit status 1
Standard Output: meson-wrapper: Implicit setup command assumed
meson-wrapper: Running meson with setup options: " --cross-file=/srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/share/meson/i686-poky-linux-meson.cross --native-file=/srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/share/meson/meson.native "

ERROR: Unknown CPU family i686, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/30/builds/1265
https://autobuilder.yoctoproject.org/valkyrie/#/builders/19/builds/1283

Can you have a look at these test failures please?
Tom Hochstein March 28, 2025, 7:50 p.m. UTC | #2
On 3/28/2025 5:36 AM, Mathieu Dubois-Briand wrote:
> [You don't often get email from mathieu.dubois-briand@bootlin.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Thu Mar 27, 2025 at 11:59 PM CET, Tom Hochstein via lists.openembedded.org wrote:
>> The user cannot override the setup command options --cross-file and
>> --native-file because the meson-wrapper places these options on the
>> command line after the user options. This problem was noticed when
>> trying to build with an SDK using a custom cross-file.
>>
>> Signed-off-by: Tom Hochstein <tom.hochstein@oss.nxp.com>
>> ---
> 
> Hi Tom,
> 
> Thanks for your patch.
> 
> It looks it breaks some test on the autobuilder, maybe specific to x86:
> 
> Traceback (most recent call last):
>    File "/srv/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/sdk/cases/meson.py", line 42, in test_epoxy
>      log = self._run("meson --warnlevel 1 -Degl=no -Dglx=no -Dx11=false {build} {source}".format(**dirs))
>    File "/srv/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/sdk/case.py", line 15, in _run
>      return subprocess.check_output(". %s > /dev/null; %s;" % \
>    File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
>      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
>    File "/usr/lib/python3.9/subprocess.py", line 528, in run
>      raise CalledProcessError(retcode, process.args,
> oeqa.utils.subprocesstweak.OETestCalledProcessError: Command '. /srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/environment-setup-core2-32-poky-linux > /dev/null; meson --warnlevel 1 -Degl=no -Dglx=no -Dx11=false /srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/epoxy9vkngm2b/build /srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/epoxy9vkngm2b/libepoxy-1.5.3;' returned non-zero exit status 1
> Standard Output: meson-wrapper: Implicit setup command assumed
> meson-wrapper: Running meson with setup options: " --cross-file=/srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/share/meson/i686-poky-linux-meson.cross --native-file=/srv/pokybuild/yocto-worker/qemux86/build/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/share/meson/meson.native "
> 
> ERROR: Unknown CPU family i686, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.
> 
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/30/builds/1265
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/19/builds/1283
> 
> Can you have a look at these test failures please?
> 
> --
> Mathieu Dubois-Briand, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 

Thanks, Mathieu. It appears that the problem goes deeper. V2 coming.

Tom
diff mbox series

Patch

diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
index 7455985297..3aa1a93520 100755
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ b/meta/recipes-devtools/meson/meson/meson-wrapper
@@ -14,8 +14,14 @@  fi
 unset CC CXX CPP LD AR NM STRIP
 
 case "$1" in
-setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help) MESON_CMD="$1" ;;
-*) echo meson-wrapper: Implicit setup command assumed; MESON_CMD=setup ;;
+setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help)
+    MESON_CMD="$1"
+    shift
+    ;;
+*)
+    MESON_CMD=setup
+    echo meson-wrapper: Implicit setup command assumed
+    ;;
 esac
 
 if [ "$MESON_CMD" = "setup" ]; then
@@ -27,5 +33,6 @@  if [ "$MESON_CMD" = "setup" ]; then
 fi
 
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-    "$@" \
-    $MESON_SETUP_OPTS
+    $MESON_CMD \
+    $MESON_SETUP_OPTS \
+    "$@"