Skip to contentSkip to conversation

meson: make wrapper options sub-command specific

PATCH In review Liam Beguin 3 participants 5 messages Sep 29, 2022 – Oct 12, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 meson: make wrapper options sub-command specific

The meson-wrapper adds setup options to facilitate cross-compilation. The current options are exclusive to the setup sub-command and might cause issues with other sub-commands.

Update the wrapper to make options sub-command specific.

---
 .../meson/meson/meson-wrapper                 | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
meta/recipes-devtools/meson/meson/meson-wrapper +17 -4
index c62007f5077e..fca64a569299 100755
@@ -5,7 +5,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
 fi
 
 if [ -z "$SSL_CERT_DIR" ]; then
-    export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
+    export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
 fi
 
 # If these are set to a cross-compile path, meson will get confused and try to
@@ -13,7 +13,20 @@ fi
 # config is already in meson.cross.
 unset CC CXX CPP LD AR NM STRIP
 
+for arg in "$@"; do
+    case "$arg" in
+    -*) continue ;;
+    *) SUBCMD="$arg"; break ;;
+    esac
+done
+
+if [ "$SUBCMD" = "setup" ] || [ -d "$SUBCMD" ]; then
+    MESON_SUB_OPTS=" \
+        --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+        --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
+        "
+fi
+
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-     --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
-     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
-     "$@"
+    "$@" \
+    $MESON_SUB_OPTS

base-commit: a2659cc2bf5d3f1cedf5c52c3b45e0427d40732d

Signature · 1 line
2.37.1.223.g6a475b71f8c4
#1 lore raw

Hi,

Quoted 10 lines · Liam Beguin

The meson-wrapper adds setup options to facilitate cross-compilation. The current options are exclusive to the setup sub-command and might cause issues with other sub-commands.

Update the wrapper to make options sub-command specific.

---
 .../meson/meson/meson-wrapper                 | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Any comments on this patch?

Cheers,
Liam

Quoted 42 lines
meta/recipes-devtools/meson/meson/meson-wrapper +17 -4
index c62007f5077e..fca64a569299 100755
@@ -5,7 +5,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
 fi
 
 if [ -z "$SSL_CERT_DIR" ]; then
-    export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
+    export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
 fi
 
 # If these are set to a cross-compile path, meson will get confused and try to
@@ -13,7 +13,20 @@ fi
 # config is already in meson.cross.
 unset CC CXX CPP LD AR NM STRIP
 
+for arg in "$@"; do
+    case "$arg" in
+    -*) continue ;;
+    *) SUBCMD="$arg"; break ;;
+    esac
+done
+
+if [ "$SUBCMD" = "setup" ] || [ -d "$SUBCMD" ]; then
+    MESON_SUB_OPTS=" \
+        --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+        --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
+        "
+fi
+
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-     --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
-     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
-     "$@"
+    "$@" \
+    $MESON_SUB_OPTS

base-commit: a2659cc2bf5d3f1cedf5c52c3b45e0427d40732d

Signature · 1 line
2.37.1.223.g6a475b71f8c4
#2 lore raw

No one seems to have objections, it's that there is no explicit confirmation that your patch (or anyone's) is in staging branches, and integration is currently on pause for a couple weeks.

Alex

Quoted 71 lines · Liam Beguin

Hi,

Quoted 10 lines · Liam Beguin

The meson-wrapper adds setup options to facilitate cross-compilation. The current options are exclusive to the setup sub-command and might cause issues with other sub-commands.

Update the wrapper to make options sub-command specific.

---
 .../meson/meson/meson-wrapper                 | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Any comments on this patch?

Cheers,
Liam

Quoted 38 lines
meta/recipes-devtools/meson/meson/meson-wrapper +17 -4
index c62007f5077e..fca64a569299 100755
@@ -5,7 +5,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
 fi
 
 if [ -z "$SSL_CERT_DIR" ]; then
-    export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
+    export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
 fi
 
 # If these are set to a cross-compile path, meson will get confused and try to
@@ -13,7 +13,20 @@ fi
 # config is already in meson.cross.
 unset CC CXX CPP LD AR NM STRIP
 
+for arg in "$@"; do
+    case "$arg" in
+    -*) continue ;;
+    *) SUBCMD="$arg"; break ;;
+    esac
+done
+
+if [ "$SUBCMD" = "setup" ] || [ -d "$SUBCMD" ]; then
+    MESON_SUB_OPTS=" \
+        --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+        --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
+        "
+fi
+
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-     --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
-     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
-     "$@"
+    "$@" \
+    $MESON_SUB_OPTS
Quoted 4 lines

base-commit: a2659cc2bf5d3f1cedf5c52c3b45e0427d40732d --
2.37.1.223.g6a475b71f8c4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171643): https://lists.openembedded.org/g/openembedded-core/message/171643
Mute This Topic: https://lists.openembedded.org/mt/93987385/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Hi Alex,

Quoted 3 lines · Alexander Kanavin

No one seems to have objections, it's that there is no explicit confirmation that your patch (or anyone's) is in staging branches, and integration is currently on pause for a couple weeks.

Understood, thanks for taking the time to explain. I'll keep monitoring the tree.

Cheers,
Liam

Quoted 74 lines

Alex

Quoted 71 lines · Liam Beguin

Hi,

Quoted 10 lines · Liam Beguin

The meson-wrapper adds setup options to facilitate cross-compilation. The current options are exclusive to the setup sub-command and might cause issues with other sub-commands.

Update the wrapper to make options sub-command specific.

---
 .../meson/meson/meson-wrapper                 | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Any comments on this patch?

Cheers,
Liam

Quoted 38 lines
meta/recipes-devtools/meson/meson/meson-wrapper +17 -4
index c62007f5077e..fca64a569299 100755
@@ -5,7 +5,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
 fi
 
 if [ -z "$SSL_CERT_DIR" ]; then
-    export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
+    export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
 fi
 
 # If these are set to a cross-compile path, meson will get confused and try to
@@ -13,7 +13,20 @@ fi
 # config is already in meson.cross.
 unset CC CXX CPP LD AR NM STRIP
 
+for arg in "$@"; do
+    case "$arg" in
+    -*) continue ;;
+    *) SUBCMD="$arg"; break ;;
+    esac
+done
+
+if [ "$SUBCMD" = "setup" ] || [ -d "$SUBCMD" ]; then
+    MESON_SUB_OPTS=" \
+        --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+        --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
+        "
+fi
+
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-     --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
-     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
-     "$@"
+    "$@" \
+    $MESON_SUB_OPTS
Quoted 4 lines

base-commit: a2659cc2bf5d3f1cedf5c52c3b45e0427d40732d --
2.37.1.223.g6a475b71f8c4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171643): https://lists.openembedded.org/g/openembedded-core/message/171643
Mute This Topic: https://lists.openembedded.org/mt/93987385/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
Quoted 9 lines · Liam Beguin

Hi Alex,

Quoted 3 lines · Alexander Kanavin

No one seems to have objections, it's that there is no explicit confirmation that your patch (or anyone's) is in staging branches, and integration is currently on pause for a couple weeks.

Understood, thanks for taking the time to explain. I'll keep monitoring the tree.

It is actually the first oe-core patch we carry in master-next because it didn't make langdale. It will get applied after the release.

Quoted 78 lines

Cheers,
Liam

Quoted 74 lines

Alex

Quoted 71 lines · Liam Beguin

Hi,

Quoted 10 lines · Liam Beguin

The meson-wrapper adds setup options to facilitate cross-compilation. The current options are exclusive to the setup sub-command and might cause issues with other sub-commands.

Update the wrapper to make options sub-command specific.

---
 .../meson/meson/meson-wrapper                 | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Any comments on this patch?

Cheers,
Liam

Quoted 38 lines
meta/recipes-devtools/meson/meson/meson-wrapper +17 -4
index c62007f5077e..fca64a569299 100755
@@ -5,7 +5,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
 fi
 
 if [ -z "$SSL_CERT_DIR" ]; then
-    export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
+    export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
 fi
 
 # If these are set to a cross-compile path, meson will get confused and try to
@@ -13,7 +13,20 @@ fi
 # config is already in meson.cross.
 unset CC CXX CPP LD AR NM STRIP
 
+for arg in "$@"; do
+    case "$arg" in
+    -*) continue ;;
+    *) SUBCMD="$arg"; break ;;
+    esac
+done
+
+if [ "$SUBCMD" = "setup" ] || [ -d "$SUBCMD" ]; then
+    MESON_SUB_OPTS=" \
+        --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+        --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
+        "
+fi
+
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-     --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
-     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
-     "$@"
+    "$@" \
+    $MESON_SUB_OPTS
Quoted 4 lines

base-commit: a2659cc2bf5d3f1cedf5c52c3b45e0427d40732d --
2.37.1.223.g6a475b71f8c4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171643): https://lists.openembedded.org/g/openembedded-core/message/171643
Mute This Topic: https://lists.openembedded.org/mt/93987385/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com