diff mbox series

[v7,1/7] meson: Allow user to override setup command options

Message ID 20250417180834.1722588-1-tom.hochstein@oss.nxp.com
State Accepted, archived
Commit 045a53349a5c00b318feb7029470d3fb084b61c8
Headers show
Series [v7,1/7] meson: Allow user to override setup command options | expand

Commit Message

Tom Hochstein April 17, 2025, 6:08 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

Ross Burton May 8, 2025, 10:40 a.m. UTC | #1
Hi Tom,

On 17 Apr 2025, at 19:08, Tom Hochstein via lists.openembedded.org <tom.hochstein=oss.nxp.com@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.

So I’ve been trying to test this series in eSDKs and have discovered that some bugs meant our eSDK coverage is basically zero.  I fixed those and now have the interesting situation that:
- fully populated eSDKs fail to install
- minimal eSDKs install, but meson doesn’t install a cross-file

Did you manage to test this series inside an eSDK, or just a traditional SDK?

Thanks,
Ross
Tom Hochstein May 8, 2025, 12:27 p.m. UTC | #2
Hi Ross,

On 5/8/2025 5:40 AM, Ross Burton wrote:
> Hi Tom,
> 
> On 17 Apr 2025, at 19:08, Tom Hochstein via lists.openembedded.org <tom.hochstein=oss.nxp.com@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.
> 
> So I’ve been trying to test this series in eSDKs and have discovered that some bugs meant our eSDK coverage is basically zero.  I fixed those and now have the interesting situation that:
> - fully populated eSDKs fail to install
> - minimal eSDKs install, but meson doesn’t install a cross-file
> 
> Did you manage to test this series inside an eSDK, or just a traditional SDK?

I did not try eSDK.

> 
> Thanks,
> Ross
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 \
+    "$@"