* [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
@ 2021-03-25 17:38 Ross Burton
2021-03-25 17:39 ` [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools Ross Burton
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Ross Burton @ 2021-03-25 17:38 UTC (permalink / raw)
To: openembedded-core
When building G-I we want to use *native* binaries (as they need to be
executed) but the *cross* libraries, as otherwise when using the correct
pkg-config binary in native lookups Meson will end up linking native and
cross libraries together.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta/recipes-devtools/meson/meson.inc | 1 +
.../meson/meson/gi-target-dep.patch | 41 +++++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 meta/recipes-devtools/meson/meson/gi-target-dep.patch
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index fc3ca85fae..e186dede92 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -15,6 +15,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
file://cross-prop-default.patch \
file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
file://0001-minstall-Correctly-set-uid-gid-of-installed-files.patch \
+ file://gi-target-dep.patch \
"
SRC_URI[sha256sum] = "72e1c782ba9bda204f4a1ed57f98d027d7b6eb9414c723eebbd6ec7f1955c8a6"
diff --git a/meta/recipes-devtools/meson/meson/gi-target-dep.patch b/meta/recipes-devtools/meson/meson/gi-target-dep.patch
new file mode 100644
index 0000000000..25b30ca27a
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/gi-target-dep.patch
@@ -0,0 +1,41 @@
+When building gobject-introspection we want the *native* binaries (as they need
+to be executed) but *host* gobject-introspection libraries, as otherwise the
+native pkg-config can be used and the build will try to link native and host
+binaries together.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
+index f9660838e..2eefc3fc7 100644
+--- a/mesonbuild/modules/gnome.py
++++ b/mesonbuild/modules/gnome.py
+@@ -84,8 +84,8 @@ class GnomeModule(ExtensionModule):
+ mlog.bold('https://github.com/mesonbuild/meson/issues/1387'),
+ once=True)
+
+- def _get_native_dep(self, state, depname, required=True):
+- kwargs = {'native': True, 'required': required}
++ def _get_dep(self, state, depname, native=False, required=True):
++ kwargs = {'native': native, 'required': required}
+ holder = self.interpreter.func_dependency(state.current_node, [depname], kwargs)
+ return holder.held_object
+
+@@ -101,7 +101,7 @@ class GnomeModule(ExtensionModule):
+ return ExternalProgram.from_entry(name, prog)
+
+ # Check if pkgconfig has a variable
+- dep = self._get_native_dep(state, depname, required=False)
++ dep = self._get_dep(state, depname, native=True, required=False)
+ if dep.found() and dep.type_name == 'pkgconfig':
+ value = dep.get_pkgconfig_variable(varname, {})
+ if value:
+@@ -481,7 +481,7 @@ class GnomeModule(ExtensionModule):
+
+ def _get_gir_dep(self, state):
+ if not self.gir_dep:
+- self.gir_dep = self._get_native_dep(state, 'gobject-introspection-1.0')
++ self.gir_dep = self._get_dep(state, 'gobject-introspection-1.0')
+ self.giscanner = self._get_native_binary(state, 'g-ir-scanner', 'gobject-introspection-1.0', 'g_ir_scanner')
+ self.gicompiler = self._get_native_binary(state, 'g-ir-compiler', 'gobject-introspection-1.0', 'g_ir_compiler')
+ return self.gir_dep, self.giscanner, self.gicompiler
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools
2021-03-25 17:38 [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Ross Burton
@ 2021-03-25 17:39 ` Ross Burton
2021-03-25 17:39 ` [PATCH v2 3/3] meson: use native-file instead of environment variables Ross Burton
2021-03-25 18:15 ` [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Alexander Kanavin
2 siblings, 0 replies; 8+ messages in thread
From: Ross Burton @ 2021-03-25 17:39 UTC (permalink / raw)
To: openembedded-core
Add a few more tools to the BUILD_* list, to match the target tool list.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta/conf/bitbake.conf | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index ecd4d1638e..4c472156e9 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -541,7 +541,10 @@ export BUILD_AR = "${BUILD_PREFIX}ar"
export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
export BUILD_STRIP = "${BUILD_PREFIX}strip"
+BUILD_OBJCOPY = "${BUILD_PREFIX}objcopy"
+BUILD_OBJDUMP = "${BUILD_PREFIX}objdump"
export BUILD_NM = "${BUILD_PREFIX}nm"
+BUILD_READELF = "${BUILD_PREFIX}readelf"
export MAKE = "make"
EXTRA_OEMAKE = ""
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] meson: use native-file instead of environment variables
2021-03-25 17:38 [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Ross Burton
2021-03-25 17:39 ` [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools Ross Burton
@ 2021-03-25 17:39 ` Ross Burton
2021-03-25 18:15 ` [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Alexander Kanavin
2 siblings, 0 replies; 8+ messages in thread
From: Ross Burton @ 2021-03-25 17:39 UTC (permalink / raw)
To: openembedded-core
Meson now supports native-files, which are the same as cross files but
describe the native build.
By writing and using a native file which describes the tools to use, we
can drop the environment variable overriding.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta/classes/meson.bbclass | 54 +++++++++++++++++---------------------
1 file changed, 24 insertions(+), 30 deletions(-)
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index a7644e70cb..bf9b02e06e 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -26,7 +26,8 @@ MESONOPTS = " --prefix ${prefix} \
--sysconfdir ${sysconfdir} \
--localstatedir ${localstatedir} \
--sharedstatedir ${sharedstatedir} \
- --wrap-mode nodownload"
+ --wrap-mode nodownload \
+ --native-file ${WORKDIR}/meson.native"
EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}"
@@ -102,12 +103,14 @@ cups-config = 'cups-config'
g-ir-scanner = '${STAGING_BINDIR}/g-ir-scanner-wrapper'
g-ir-compiler = '${STAGING_BINDIR}/g-ir-compiler-wrapper'
-[properties]
-needs_exe_wrapper = true
+[built-in options]
c_args = ${@meson_array('CFLAGS', d)}
c_link_args = ${@meson_array('LDFLAGS', d)}
cpp_args = ${@meson_array('CXXFLAGS', d)}
cpp_link_args = ${@meson_array('LDFLAGS', d)}
+
+[properties]
+needs_exe_wrapper = true
gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
[host_machine]
@@ -121,9 +124,27 @@ system = '${@meson_operating_system('TARGET_OS', d)}'
cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
cpu = '${TARGET_ARCH}'
endian = '${@meson_endian('TARGET', d)}'
+EOF
+
+ cat >${WORKDIR}/meson.native <<EOF
+[binaries]
+c = ${@meson_array('BUILD_CC', d)}
+cpp = ${@meson_array('BUILD_CXX', d)}
+ar = ${@meson_array('BUILD_AR', d)}
+nm = ${@meson_array('BUILD_NM', d)}
+strip = ${@meson_array('BUILD_STRIP', d)}
+readelf = ${@meson_array('BUILD_READELF', d)}
+pkgconfig = 'pkg-config-native'
+
+[built-in options]
+c_args = ${@meson_array('BUILD_CFLAGS', d)}
+c_link_args = ${@meson_array('BUILD_LDFLAGS', d)}
+cpp_args = ${@meson_array('BUILD_CXXFLAGS', d)}
+cpp_link_args = ${@meson_array('BUILD_LDFLAGS', d)}
EOF
}
+# Tell externalsrc that changes to this file require a reconfigure
CONFIGURE_FILES = "meson.build"
meson_do_configure() {
@@ -140,33 +161,6 @@ meson_do_configure() {
fi
}
-override_native_tools() {
- # Set these so that meson uses the native tools for its build sanity tests,
- # which require executables to be runnable. The cross file will still
- # override these for the target build.
- export CC="${BUILD_CC}"
- export CXX="${BUILD_CXX}"
- export LD="${BUILD_LD}"
- export AR="${BUILD_AR}"
- export STRIP="${BUILD_STRIP}"
- # These contain *target* flags but will be used as *native* flags. The
- # correct native flags will be passed via -Dc_args and so on, unset them so
- # they don't interfere with tools invoked by Meson (such as g-ir-scanner)
- unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
-}
-
-meson_do_configure_prepend_class-target() {
- override_native_tools
-}
-
-meson_do_configure_prepend_class-nativesdk() {
- override_native_tools
-}
-
-meson_do_configure_prepend_class-native() {
- export PKG_CONFIG="pkg-config-native"
-}
-
python meson_do_qa_configure() {
import re
warn_re = re.compile(r"^WARNING: Cross property (.+) is using default value (.+)$", re.MULTILINE)
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
2021-03-25 17:38 [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Ross Burton
2021-03-25 17:39 ` [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools Ross Burton
2021-03-25 17:39 ` [PATCH v2 3/3] meson: use native-file instead of environment variables Ross Burton
@ 2021-03-25 18:15 ` Alexander Kanavin
2021-03-25 19:07 ` Ross Burton
2 siblings, 1 reply; 8+ messages in thread
From: Alexander Kanavin @ 2021-03-25 18:15 UTC (permalink / raw)
To: Ross Burton; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 4202 bytes --]
I don't think I fully understand this. Is g-i in meson projects already
broken for a while (there was a bit of refactor in the latest meson
version, which I tested, but perhaps not well enough), or is this necessary
for the other patches in your set?
Alex
On Thu, 25 Mar 2021 at 18:39, Ross Burton <ross@burtonini.com> wrote:
> When building G-I we want to use *native* binaries (as they need to be
> executed) but the *cross* libraries, as otherwise when using the correct
> pkg-config binary in native lookups Meson will end up linking native and
> cross libraries together.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
> meta/recipes-devtools/meson/meson.inc | 1 +
> .../meson/meson/gi-target-dep.patch | 41 +++++++++++++++++++
> 2 files changed, 42 insertions(+)
> create mode 100644 meta/recipes-devtools/meson/meson/gi-target-dep.patch
>
> diff --git a/meta/recipes-devtools/meson/meson.inc
> b/meta/recipes-devtools/meson/meson.inc
> index fc3ca85fae..e186dede92 100644
> --- a/meta/recipes-devtools/meson/meson.inc
> +++ b/meta/recipes-devtools/meson/meson.inc
> @@ -15,6 +15,7 @@ SRC_URI = "
> https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
> file://cross-prop-default.patch \
>
> file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
>
> file://0001-minstall-Correctly-set-uid-gid-of-installed-files.patch \
> + file://gi-target-dep.patch \
> "
> SRC_URI[sha256sum] =
> "72e1c782ba9bda204f4a1ed57f98d027d7b6eb9414c723eebbd6ec7f1955c8a6"
>
> diff --git a/meta/recipes-devtools/meson/meson/gi-target-dep.patch
> b/meta/recipes-devtools/meson/meson/gi-target-dep.patch
> new file mode 100644
> index 0000000000..25b30ca27a
> --- /dev/null
> +++ b/meta/recipes-devtools/meson/meson/gi-target-dep.patch
> @@ -0,0 +1,41 @@
> +When building gobject-introspection we want the *native* binaries (as
> they need
> +to be executed) but *host* gobject-introspection libraries, as otherwise
> the
> +native pkg-config can be used and the build will try to link native and
> host
> +binaries together.
> +
> +Upstream-Status: Pending
> +Signed-off-by: Ross Burton <ross.burton@arm.com>
> +
> +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
> +index f9660838e..2eefc3fc7 100644
> +--- a/mesonbuild/modules/gnome.py
> ++++ b/mesonbuild/modules/gnome.py
> +@@ -84,8 +84,8 @@ class GnomeModule(ExtensionModule):
> + mlog.bold('
> https://github.com/mesonbuild/meson/issues/1387'),
> + once=True)
> +
> +- def _get_native_dep(self, state, depname, required=True):
> +- kwargs = {'native': True, 'required': required}
> ++ def _get_dep(self, state, depname, native=False, required=True):
> ++ kwargs = {'native': native, 'required': required}
> + holder = self.interpreter.func_dependency(state.current_node,
> [depname], kwargs)
> + return holder.held_object
> +
> +@@ -101,7 +101,7 @@ class GnomeModule(ExtensionModule):
> + return ExternalProgram.from_entry(name, prog)
> +
> + # Check if pkgconfig has a variable
> +- dep = self._get_native_dep(state, depname, required=False)
> ++ dep = self._get_dep(state, depname, native=True, required=False)
> + if dep.found() and dep.type_name == 'pkgconfig':
> + value = dep.get_pkgconfig_variable(varname, {})
> + if value:
> +@@ -481,7 +481,7 @@ class GnomeModule(ExtensionModule):
> +
> + def _get_gir_dep(self, state):
> + if not self.gir_dep:
> +- self.gir_dep = self._get_native_dep(state,
> 'gobject-introspection-1.0')
> ++ self.gir_dep = self._get_dep(state,
> 'gobject-introspection-1.0')
> + self.giscanner = self._get_native_binary(state,
> 'g-ir-scanner', 'gobject-introspection-1.0', 'g_ir_scanner')
> + self.gicompiler = self._get_native_binary(state,
> 'g-ir-compiler', 'gobject-introspection-1.0', 'g_ir_compiler')
> + return self.gir_dep, self.giscanner, self.gicompiler
> --
> 2.25.1
>
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 5303 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
2021-03-25 18:15 ` [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Alexander Kanavin
@ 2021-03-25 19:07 ` Ross Burton
2021-03-26 18:48 ` Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Ross Burton @ 2021-03-25 19:07 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: OE-core
On Thu, 25 Mar 2021 at 18:15, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> I don't think I fully understand this. Is g-i in meson projects already broken for a while (there was a bit of refactor in the latest meson version, which I tested, but perhaps not well enough), or is this necessary for the other patches in your set?
I just sent a mail which sort-of answers this question without seeing it.
Basically, the change is that Meson now knows that it should call
pkg-config-native for native pkgconfig lookups. Before, it was using
pkg-config.
As far as I can tell there is very little code which hits that
codepath, so we didn't notice. When setting pkgconfig-native
correctly, this broke.
Ross
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
2021-03-25 19:07 ` Ross Burton
@ 2021-03-26 18:48 ` Khem Raj
2021-03-29 9:25 ` Ross Burton
0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2021-03-26 18:48 UTC (permalink / raw)
To: Ross Burton; +Cc: Alexander Kanavin, OE-core
I am seeing some failures
https://errors.yoctoproject.org/Errors/Details/574541/
On Thu, Mar 25, 2021 at 12:08 PM Ross Burton <ross@burtonini.com> wrote:
>
> On Thu, 25 Mar 2021 at 18:15, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> > I don't think I fully understand this. Is g-i in meson projects already broken for a while (there was a bit of refactor in the latest meson version, which I tested, but perhaps not well enough), or is this necessary for the other patches in your set?
>
> I just sent a mail which sort-of answers this question without seeing it.
>
> Basically, the change is that Meson now knows that it should call
> pkg-config-native for native pkgconfig lookups. Before, it was using
> pkg-config.
>
> As far as I can tell there is very little code which hits that
> codepath, so we didn't notice. When setting pkgconfig-native
> correctly, this broke.
>
> Ross
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
2021-03-26 18:48 ` Khem Raj
@ 2021-03-29 9:25 ` Ross Burton
2021-03-29 15:26 ` Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Ross Burton @ 2021-03-29 9:25 UTC (permalink / raw)
To: Khem Raj; +Cc: Alexander Kanavin, OE-core
This is the universe telling you that one line native file should have
been put in oe-core. :)
Ross
On Fri, 26 Mar 2021 at 18:49, Khem Raj <raj.khem@gmail.com> wrote:
>
> I am seeing some failures
>
> https://errors.yoctoproject.org/Errors/Details/574541/
>
> On Thu, Mar 25, 2021 at 12:08 PM Ross Burton <ross@burtonini.com> wrote:
> >
> > On Thu, 25 Mar 2021 at 18:15, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> > > I don't think I fully understand this. Is g-i in meson projects already broken for a while (there was a bit of refactor in the latest meson version, which I tested, but perhaps not well enough), or is this necessary for the other patches in your set?
> >
> > I just sent a mail which sort-of answers this question without seeing it.
> >
> > Basically, the change is that Meson now knows that it should call
> > pkg-config-native for native pkgconfig lookups. Before, it was using
> > pkg-config.
> >
> > As far as I can tell there is very little code which hits that
> > codepath, so we didn't notice. When setting pkgconfig-native
> > correctly, this broke.
> >
> > Ross
> >
> >
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
2021-03-29 9:25 ` Ross Burton
@ 2021-03-29 15:26 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2021-03-29 15:26 UTC (permalink / raw)
To: Ross Burton; +Cc: Alexander Kanavin, OE-core
On 3/29/21 2:25 AM, Ross Burton wrote:
> This is the universe telling you that one line native file should have
> been put in oe-core. :)
>
yeah I dropped it from meta-gnom now
> Ross
>
> On Fri, 26 Mar 2021 at 18:49, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> I am seeing some failures
>>
>> https://errors.yoctoproject.org/Errors/Details/574541/
>>
>> On Thu, Mar 25, 2021 at 12:08 PM Ross Burton <ross@burtonini.com> wrote:
>>>
>>> On Thu, 25 Mar 2021 at 18:15, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>>>> I don't think I fully understand this. Is g-i in meson projects already broken for a while (there was a bit of refactor in the latest meson version, which I tested, but perhaps not well enough), or is this necessary for the other patches in your set?
>>>
>>> I just sent a mail which sort-of answers this question without seeing it.
>>>
>>> Basically, the change is that Meson now knows that it should call
>>> pkg-config-native for native pkgconfig lookups. Before, it was using
>>> pkg-config.
>>>
>>> As far as I can tell there is very little code which hits that
>>> codepath, so we didn't notice. When setting pkgconfig-native
>>> correctly, this broke.
>>>
>>> Ross
>>>
>>>
>>>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-03-29 15:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 17:38 [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Ross Burton
2021-03-25 17:39 ` [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools Ross Burton
2021-03-25 17:39 ` [PATCH v2 3/3] meson: use native-file instead of environment variables Ross Burton
2021-03-25 18:15 ` [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Alexander Kanavin
2021-03-25 19:07 ` Ross Burton
2021-03-26 18:48 ` Khem Raj
2021-03-29 9:25 ` Ross Burton
2021-03-29 15:26 ` Khem Raj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.