glib-2.0 Introspection Data Question #poky
Was wondering if someone can help me with an issue I'm seeing with my workflow after upgrading to styhead/master on poky - specifically related to gobject-introspection data for the GLib-2.0 recipe. In particular, I see that the gobject-introspection/glib recipes were updated in this patch/mailing list discussion:
https://lists.openembedded.org/g/openembedded-core/topic/105860089
But it is unclear to me if this patch still supports producing native GLib-2.0/Gio/GObject .typelib files in a recipe's sysroot?
It looks suspect to me that the PACKAGECONFIG for the native class is wiped in this line:
https://github.com/yoctoproject/poky/blob/master/meta/recipes-core/glib-2.0/glib.inc#L40
Which would lead me to believe that glib-2.0-native does not produce any .typelib files?
However, when digging, I noticed that the missing .typelib file existed in the gobject-introspection-native build directory, but was just not being shipped to the sysroot-destdir. I needed to add the following do_install:append to gobject-introspection_%.bbappend:
do_install:append:class-native() {
cp -f ${B}/gir/GLib-2.0.typelib ${D}${RECIPE_SYSROOT_NATIVE}/usr/lib/girepository-1.0/GLib-2.0.typelib cp -f ${B}/gir/GObject-2.0.typelib ${D}${RECIPE_SYSROOT_NATIVE}/usr/lib/girepository-1.0/GObject-2.0.typelib cp -f ${B}/gir/Gio-2.0.typelib ${D}${RECIPE_SYSROOT_NATIVE}/usr/lib/girepository-1.0/Gio-2.0.typelib }
(OR this patch will also accomplish similar behavior):
gobject-introspection_%.bbappend:
SRC_URI:append:class-native = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'file://0001-Install-typelib-files-if-native-build.patch', '', d)}"
0001-Install-typelib-files-if-native-build.patch:
+--- + gir/meson.build | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gir/meson.build b/gir/meson.build +index e5a7a13..e8100fd 100644
+--- a/gir/meson.build
++++ b/gir/meson.build
+@@ -541,6 +541,8 @@ foreach gir: uninstalled_gir_files
+ output: '@[email protected]',
+ depends: [gobject_gir, gircompiler, ],
+ command: gircompiler_command,
++ install: true,
++ install_dir: typelibdir,
+ )
+ endforeach
I'm hesitant to submit either patch due to the fear that I'm (1) missing something/not understanding something right and (2) doing something completely wrong.
I've verified that GI_DATA_ENABLED is set to True on my system, according to this page:
https://docs.yoctoproject.org/dev/dev-manual/gobject-introspection.html
And I've tried to remove the PACKAGECONFIG:class-native = "" line in glib.inc without any luck - this just introduces a bunch of circular dependencies.
For context, we are running with a workflow that executes python unit tests on the native host environment and these *.typelib files are required for certain functionality.
Ideally, we would migrate to ptest which would probably solve this issue, but this unfortunately isn't an option at the time for us due to the integration effort it would require.
Any help is appreciated in advance.
Thanks!
Quoted 5 lines · Eric Meyers via lists.openembedded.org
Was wondering if someone can help me with an issue I'm seeing with my workflow after upgrading to styhead/master on poky - specifically related to gobject-introspection data for the GLib-2.0 recipe. In particular, I see that the gobject-introspection/glib recipes were updated in this patch/mailing list discussion:
https://lists.openembedded.org/g/openembedded-core/topic/105860089
Quoted 7 lines
But it is unclear to me if this patch still supports producing native GLib-2.0/Gio/GObject .typelib files in a recipe's sysroot?
It looks suspect to me that the PACKAGECONFIG for the native class is wiped in this line:
https://github.com/yoctoproject/poky/blob/master/meta/recipes-core/glib-2.0/glib.inc#L40
Which would lead me to believe that glib-2.0-native does not produce any .typelib files?
Correct. I think native gir/typelib files were never enabled, oe-core only ever had them enabled for target.
Quoted 32 lines
However, when digging, I noticed that the missing .typelib file existed in the gobject-introspection-native build directory, but was just not being shipped to the sysroot-destdir. I needed to add the following do_install:append to gobject-introspection_%.bbappend:
do_install:append:class-native() { cp -f ${B}/gir/GLib-2.0.typelib ${D}${RECIPE_SYSROOT_NATIVE}/usr/lib/girepository-1.0/GLib-2.0.typelib cp -f ${B}/gir/GObject-2.0.typelib ${D}${RECIPE_SYSROOT_NATIVE}/usr/lib/girepository-1.0/GObject-2.0.typelib cp -f ${B}/gir/Gio-2.0.typelib ${D}${RECIPE_SYSROOT_NATIVE}/usr/lib/girepository-1.0/Gio-2.0.typelib }(OR this patch will also accomplish similar behavior):
gobject-introspection_%.bbappend:
SRC_URI:append:class-native = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'file://0001-Install-typelib-files-if-native-build.patch', '', d)}"
0001-Install-typelib-files-if-native-build.patch:
+--- + gir/meson.build | 2 +++ 1 file changed, 2 insertions(+)
(quoted diff) +13
-0+ +diff --git a/gir/meson.build b/gir/meson.build +index e5a7a13..e8100fd 100644 +--- a/gir/meson.build ++++ b/gir/meson.build +@@ -541,6 +541,8 @@ foreach gir: uninstalled_gir_files + output: '@[email protected]', + depends: [gobject_gir, gircompiler, ], + command: gircompiler_command, ++ install: true, ++ install_dir: typelibdir, + ) + endforeach
Quoted 1 line
I'm hesitant to submit either patch due to the fear that I'm (1) missing something/not understanding something right and (2) doing something completely wrong.
Upstream has made the decision to transition from installing static pre-generated gir/typelib files in g-i to generating them from actual, current glib libraries inside glib itself. This indeed introduced a circular dependency, which was solved for the target by first building glib-2.0-initial (that does not enable gir/typelib generation), then building target g-i with it, then building final target glib with gir/typelib generation
You would have to replicate this sequence for the native recipes. Pre-built files in g-i are not meant for installation, only for running tests during the build. Any attempt to change that will be rejected by both g-i upstream and oe-core.
Alex