[oe-commits] [openembedded-core] 08/12: meson: warn if the default value from meson.get_cross_property() is being used

git at git.openembedded.org git at git.openembedded.org
Thu Mar 21 16:21:31 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 46e1a50d356d9fb59ac17725b56a67b41753a0f3
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Thu Mar 21 12:32:17 2019 +0000

    meson: warn if the default value from meson.get_cross_property() is being used
    
    Projects such as glib have tests that execute code to check their behaviour, and
    in cross-compilation environments where they can't execute code fall back on
    meson.get_cross_property() with a default value.  These default values may not
    be appropriate: for example if glib can't verify that vsprintf() isn't broken it
    assumes that it is, and embeds the gnulib copy of vsprintf() instead of using
    glibc's implementation.
    
    Add a warning whenever the default value for get_cross_property() is used so
    that we can tell this is happening and set the value appropriately.
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/meson/meson.inc              |  1 +
 .../meson/meson/cross-prop-default.patch           | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index d5d71c6..ca448b0 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -14,6 +14,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
            file://cross-libdir.patch \
            file://0001-modules-windows-split-WINDRES-env-variable.patch \
            file://0002-environment.py-detect-windows-also-if-the-system-str.patch \
+           file://cross-prop-default.patch \
            "
 SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd"
 SRC_URI[md5sum] = "0267b0871266056184c484792572c682"
diff --git a/meta/recipes-devtools/meson/meson/cross-prop-default.patch b/meta/recipes-devtools/meson/meson/cross-prop-default.patch
new file mode 100644
index 0000000..772395e
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/cross-prop-default.patch
@@ -0,0 +1,23 @@
+meson.build files that use cc.run() in native builds can silently fallback to
+meson.get_cross_property() in cross builds without an exe-wrapper, but there's
+no way to know that this is happening.
+
+As the defaults may be pessimistic (for example, disabling the support for a
+feature that should be enabled) emit a warning when the default is used, so that
+the recipe can explicitly set the cross property as relevant.
+
+Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/5071]
+Signed-off-by: Ross Burton <ross.burton at intel.com>
+
+diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
+index 3c3cfae0..10e741ae 100644
+--- a/mesonbuild/interpreter.py
++++ b/mesonbuild/interpreter.py
+@@ -1890,6 +1890,7 @@ class MesonMain(InterpreterObject):
+             return props[propname]
+         except Exception:
+             if len(args) == 2:
++                mlog.warning('Cross property %s is using default value %s' % (propname, args[1]))
+                 return args[1]
+             raise InterpreterException('Unknown cross property: %s.' % propname)
+ 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list