Skip to contentSkip to conversation

package/poppler: fix introspection build

PATCH Applied Fabrice Fontaine 5 participants 14 messages Aug 12, 2022 – Apr 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/poppler: fix introspection build

Fix the following build failure raised since commit 9d1d4818c39d97ad7a1cdf6e075b9acae6dfff71:

[ 98%] Generating Poppler-0.18.typelib
Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0 If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help. Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"

Fixes:
- http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e

---
Changes v1 -> v2:
- Rebase on top of master
- Use upstream commit

 ...txt-allow-the-user-to-configure-INTR.patch | 43 +++++++++++++++++++
 package/poppler/poppler.mk                    |  3 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch
package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch new file +43 -0
new file mode 100644
index 0000000000..079cf7234d
@@ -0,0 +1,43 @@
+From e9d5731ba254f35e2d94b628c51e48c50a945271 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Mon, 24 Jan 2022 09:28:20 +0100
+Subject: [PATCH] glib/CMakeLists.txt: allow the user to configure
+ INTROSPECTION_COMPILER_ARGS
+
+Allow the user to add its own parameters such as
+--includedir=$(STAGING_DIR)/usr/share/gir-1.0 to
+INTROSPECTION_COMPILER_ARGS to avoid the following build failure when
+cross-compiling with buildroot:
+
+[ 98%] Generating Poppler-0.18.typelib
+Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
+error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0
+If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
+Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"
+
+Fixes:
+ - http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved from:
+https://gitlab.freedesktop.org/poppler/poppler/-/commit/e9d5731ba254f35e2d94b628c51e48c50a945271]
+---
+ glib/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
+index 7510e69ee..f5130e3c9 100644
+--- a/glib/CMakeLists.txt
++++ b/glib/CMakeLists.txt
+@@ -119,7 +119,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS)
+   # General gir: Reset object-list for introspection & load tool args
+   set(INTROSPECTION_GIRS)
+   set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all")
+-  set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
++  set(INTROSPECTION_COMPILER_ARGS ${INTROSPECTION_COMPILER_ARGS} "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+   # Poppler: Assign package to gir & export keys
+   set(Poppler_0_18_gir "poppler-glib")
+-- 
+GitLab
+
package/poppler/poppler.mk +2 -1
index b54262e7c4..db6da25d39 100644
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
 	-DENABLE_GOBJECT_INTROSPECTION=ON \
 	-DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+	-DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Fabrice,

+Adam Duskett for GOI expertise.

Quoted 5 lines · On Fri, 12 Aug 2022 12:17:18 +0200 Fabrice Fontaine…
package/poppler/poppler.mk +0 -0
index b54262e7c4..db6da25d39 100644

package/poppler/poppler.mk POPPLER_DEPENDENCIES += gobject-introspection · line 54

Quoted 9 lines
package/poppler/poppler.mk +2 -1
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
 	-DENABLE_GOBJECT_INTROSPECTION=ON \
 	-DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+	-DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif

I am really not familiar with all the gobject-introspection stuff, but I'm wondering if this is the right solution for this problem.

In package/gobject-introspection/, I can see that we create and install a g-ir-scanner wrapper that passes --add-include-path="$(dirname "$0")"/../share/gir-1.0.

In this same directory, we also have a g-ir-compiler wrapper, which is used to execute things in Qemu. If a special path is needed, why don't we pass it within this wrapper, so that the solution works for all packages?

Apparently, according to package/libglib2/0004-meson.build-add-girdir-to-gio-2.0.pc-and-glib-2.0.pc.patch there are some packages that set girdir in their .pc file so that other packages now where to find the GIR files.

Really not clear in my mind how all of this should work. My only concern is that I would like us to find and use the same solution everywhere to solve the same problem, rather than having 10 different solutions for each package encountering the same issue.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hello Fabrice,

Do you have some feedback? Or perhaps Adam?

Thanks!

Thomas

Quoted 45 lines · On Sun, 14 Aug 2022 12:37:48 +0200 Thomas Petazzoni via buildroot…

Hello Fabrice,

+Adam Duskett for GOI expertise.

Quoted 5 lines · On Fri, 12 Aug 2022 12:17:18 +0200 Fabrice Fontaine…
package/poppler/poppler.mk +0 -0
index b54262e7c4..db6da25d39 100644

package/poppler/poppler.mk POPPLER_DEPENDENCIES += gobject-introspection · line 54

Quoted 9 lines
package/poppler/poppler.mk +2 -1
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
 	-DENABLE_GOBJECT_INTROSPECTION=ON \
 	-DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+	-DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif  

I am really not familiar with all the gobject-introspection stuff, but I'm wondering if this is the right solution for this problem.

In package/gobject-introspection/, I can see that we create and install a g-ir-scanner wrapper that passes --add-include-path="$(dirname "$0")"/../share/gir-1.0.

In this same directory, we also have a g-ir-compiler wrapper, which is used to execute things in Qemu. If a special path is needed, why don't we pass it within this wrapper, so that the solution works for all packages?

Apparently, according to package/libglib2/0004-meson.build-add-girdir-to-gio-2.0.pc-and-glib-2.0.pc.patch there are some packages that set girdir in their .pc file so that other packages now where to find the GIR files.

Really not clear in my mind how all of this should work. My only concern is that I would like us to find and use the same solution everywhere to solve the same problem, rather than having 10 different solutions for each package encountering the same issue.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Hello;

The above patch (and the existing patch currently in package/poppler) are both in the latest version of poppler, so this is probably safe to apply.
However; it may be more advantageous to instead simply bump the poppler package instead of applying more patches.

Thoughts?

Adam

Quoted 56 lines · Thomas Petazzoni

Hello Fabrice,

Do you have some feedback? Or perhaps Adam?

Thanks!

Thomas

Quoted 44 lines · On Sun, 14 Aug 2022 12:37:48 +0200 Thomas Petazzoni via buildroot…

Hello Fabrice,

+Adam Duskett for GOI expertise.

Quoted 5 lines · On Fri, 12 Aug 2022 12:17:18 +0200 Fabrice Fontaine…
package/poppler/poppler.mk +0 -0
index b54262e7c4..db6da25d39 100644

package/poppler/poppler.mk POPPLER_DEPENDENCIES += gobject-introspection · line 54

Quoted 9 lines
package/poppler/poppler.mk +2 -1
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
    -DENABLE_GOBJECT_INTROSPECTION=ON \
    -DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-   -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+   -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+   -DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif

I am really not familiar with all the gobject-introspection stuff, but I'm wondering if this is the right solution for this problem.

In package/gobject-introspection/, I can see that we create and install a g-ir-scanner wrapper that passes --add-include-path="$(dirname "$0")"/../share/gir-1.0.

In this same directory, we also have a g-ir-compiler wrapper, which is used to execute things in Qemu. If a special path is needed, why don't we pass it within this wrapper, so that the solution works for all packages?

Apparently, according to package/libglib2/0004-meson.build-add-girdir-to-gio-2.0.pc-and-glib-2.0.pc.patch there are some packages that set girdir in their .pc file so that other packages now where to find the GIR files.

Really not clear in my mind how all of this should work. My only concern is that I would like us to find and use the same solution everywhere to solve the same problem, rather than having 10 different solutions for each package encountering the same issue.

Quoted 8 lines
Quoted 1 line

Thomas

--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hi Adam,

Bumping poppler will not been enough to fix the build failure. --includedir=$(STAGING_DIR)/usr/share/gir-1.0 will also have to be passed in -DINTROSPECTION_COMPILER_ARGS or do you think that g-ir-scanner wrapper must handle this as suggested by Thomas above?

Best Regards,

Fabrice

Quoted 56 lines · Adam Duskett

Hello;

The above patch (and the existing patch currently in package/poppler) are both in the latest version of poppler, so this is probably safe to apply.
However; it may be more advantageous to instead simply bump the poppler package instead of applying more patches.

Thoughts?

Adam

Quoted 19 lines · Thomas Petazzoni

Hello Fabrice,

Do you have some feedback? Or perhaps Adam?

Thanks!

Thomas

Quoted 7 lines · On Sun, 14 Aug 2022 12:37:48 +0200 Thomas Petazzoni via buildroot…

Hello Fabrice,

+Adam Duskett for GOI expertise.

On Fri, 12 Aug 2022 12:17:18 +0200
Fabrice Fontaine <[email protected]> wrote:

Quoted 11 lines
Quoted 11 lines

package/poppler/poppler.mk POPPLER_DEPENDENCIES += gobject-introspection · line 51

Quoted 11 lines
package/poppler/poppler.mk +2 -1
index b54262e7c4..db6da25d39 100644
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
    -DENABLE_GOBJECT_INTROSPECTION=ON \
    -DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-   -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+   -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+

-DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"

Quoted 11 lines
Quoted 11 lines

package/poppler/poppler.mk POPPLER_DEPENDENCIES += gobject-introspection · line 54

Quoted 3 lines
package/poppler/poppler.mk +0 -0
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif

I am really not familiar with all the gobject-introspection stuff, but I'm wondering if this is the right solution for this problem.

In package/gobject-introspection/, I can see that we create and install a g-ir-scanner wrapper that passes --add-include-path="$(dirname "$0")"/../share/gir-1.0.

Quoted 25 lines
Quoted 7 lines
Quoted 7 lines

In this same directory, we also have a g-ir-compiler wrapper, which is used to execute things in Qemu. If a special path is needed, why don't we pass it within this wrapper, so that the solution works for all packages?

Apparently, according to

package/libglib2/0004-meson.build-add-girdir-to-gio-2.0.pc-and-glib-2.0.pc.patch

Quoted 16 lines
Quoted 9 lines

there are some packages that set girdir in their .pc file so that other packages now where to find the GIR files.

Really not clear in my mind how all of this should work. My only concern is that I would like us to find and use the same solution everywhere to solve the same problem, rather than having 10 different solutions for each package encountering the same issue.

Thomas

--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Hello Fabrice;

Sorry for the late reply, I had a cold which I didn't expect to make me feel so terrible!
I should have been more clear in my earlier response. My suggestion is:

- Bump poppler
- Add -DINTROSPECTION_COMPILER_ARGS=--includedir=$(STAGING_DIR)/usr/share/gir-1.0

It's the simplest solution to the problem and avoids adding a new patch while removing an old patch.

Thanks!

Adam

Quoted 90 lines · Fabrice Fontaine

Hi Adam,

Bumping poppler will not been enough to fix the build failure.
--includedir=$(STAGING_DIR)/usr/share/gir-1.0 will also have to be passed in -DINTROSPECTION_COMPILER_ARGS or do you think that g-ir-scanner wrapper must handle this as suggested by Thomas above?

Best Regards,

Fabrice

Quoted 79 lines · Adam Duskett

Hello;

The above patch (and the existing patch currently in package/poppler) are both in the latest version of poppler, so this is probably safe to apply.
However; it may be more advantageous to instead simply bump the poppler package instead of applying more patches.

Thoughts?

Adam

Quoted 64 lines · Thomas Petazzoni

Hello Fabrice,

Do you have some feedback? Or perhaps Adam?

Thanks!

Thomas

Quoted 39 lines · On Sun, 14 Aug 2022 12:37:48 +0200 Thomas Petazzoni via buildroot…

Hello Fabrice,

+Adam Duskett for GOI expertise.

Quoted 5 lines · On Fri, 12 Aug 2022 12:17:18 +0200 Fabrice Fontaine…
package/poppler/poppler.mk +0 -0
index b54262e7c4..db6da25d39 100644

package/poppler/poppler.mk POPPLER_DEPENDENCIES += gobject-introspection · line 54

Quoted 9 lines
package/poppler/poppler.mk +2 -1
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
    -DENABLE_GOBJECT_INTROSPECTION=ON \
    -DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-   -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+   -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+   -DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif

I am really not familiar with all the gobject-introspection stuff, but I'm wondering if this is the right solution for this problem.

In package/gobject-introspection/, I can see that we create and install a g-ir-scanner wrapper that passes --add-include-path="$(dirname "$0")"/../share/gir-1.0.

In this same directory, we also have a g-ir-compiler wrapper, which is used to execute things in Qemu. If a special path is needed, why don't we pass it within this wrapper, so that the solution works for all packages?

Apparently, according to package/libglib2/0004-meson.build-add-girdir-to-gio-2.0.pc-and-glib-2.0.pc.patch there are some packages that set girdir in their .pc file so that other packages now where to find the GIR files.

Quoted 6 lines

Really not clear in my mind how all of this should work. My only concern is that I would like us to find and use the same solution everywhere to solve the same problem, rather than having 10 different solutions for each package encountering the same issue.

Thomas

--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
In reply to Fabrice Fontaine

Fabrice, All,

+Adam for your insight in GOI

On 2022-08-12 12:17 +0200, Fabrice Fontaine spake thusly:

Quoted 9 lines

Fix the following build failure raised since commit 9d1d4818c39d97ad7a1cdf6e075b9acae6dfff71:

[ 98%] Generating Poppler-0.18.typelib
Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0 If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help. Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"

Quoted 4 lines

Fixes:
- http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e

Sorry for the long delay, I had a look tonight...

I could not find the underlying reason why g-ir-compiler (through our wrapper) could not find the directory with all the gir files.

Given that poppler is so far the only affect package, and since your patch was accepted upstream, I think it is only reasonable that we do indeed use this change. So..

Applied to master, thanks.

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

As Thomas also suggested, should we be doing that systematically in our g-ir-compiler wrapper?

I know Adam said your change was "the simplest solution to the problem". Still, this is not very satisfying...

Regards,
Yann E. MORIN.

Quoted 80 lines

---
Changes v1 -> v2:
- Rebase on top of master
- Use upstream commit

 ...txt-allow-the-user-to-configure-INTR.patch | 43 +++++++++++++++++++
 package/poppler/poppler.mk                    |  3 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch
package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch new file +43 -0
new file mode 100644
index 0000000000..079cf7234d
@@ -0,0 +1,43 @@
+From e9d5731ba254f35e2d94b628c51e48c50a945271 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Mon, 24 Jan 2022 09:28:20 +0100
+Subject: [PATCH] glib/CMakeLists.txt: allow the user to configure
+ INTROSPECTION_COMPILER_ARGS
+
+Allow the user to add its own parameters such as
+--includedir=$(STAGING_DIR)/usr/share/gir-1.0 to
+INTROSPECTION_COMPILER_ARGS to avoid the following build failure when
+cross-compiling with buildroot:
+
+[ 98%] Generating Poppler-0.18.typelib
+Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
+error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0
+If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
+Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"
+
+Fixes:
+ - http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved from:
+https://gitlab.freedesktop.org/poppler/poppler/-/commit/e9d5731ba254f35e2d94b628c51e48c50a945271]
+---
+ glib/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
+index 7510e69ee..f5130e3c9 100644
+--- a/glib/CMakeLists.txt
++++ b/glib/CMakeLists.txt
+@@ -119,7 +119,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS)
+   # General gir: Reset object-list for introspection & load tool args
+   set(INTROSPECTION_GIRS)
+   set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all")
+-  set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
++  set(INTROSPECTION_COMPILER_ARGS ${INTROSPECTION_COMPILER_ARGS} "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+   # Poppler: Assign package to gir & export keys
+   set(Poppler_0_18_gir "poppler-glib")
+-- 
+GitLab
+
package/poppler/poppler.mk +2 -1
index b54262e7c4..db6da25d39 100644
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
 	-DENABLE_GOBJECT_INTROSPECTION=ON \
 	-DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+	-DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+	-DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw
Quoted 31 lines · Yann E. MORIN

Fabrice, All,

+Adam for your insight in GOI

On 2022-08-12 12:17 +0200, Fabrice Fontaine spake thusly:

Quoted 9 lines

Fix the following build failure raised since commit 9d1d4818c39d97ad7a1cdf6e075b9acae6dfff71:

[ 98%] Generating Poppler-0.18.typelib
Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0 If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help. Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"

Quoted 4 lines

Fixes:
- http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e

Sorry for the long delay, I had a look tonight...

I could not find the underlying reason why g-ir-compiler (through our wrapper) could not find the directory with all the gir files.

Given that poppler is so far the only affect package, and since your patch was accepted upstream, I think it is only reasonable that we do indeed use this change. So..

Applied to master, thanks.

Quoted 8 lines

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

From the looks of it most of our packages with a gobject-introspection dependency are meson based which use the native meson integration.

https://gi.readthedocs.io/en/latest/buildsystems/meson.html

From my understanding there is no standardized cmake gobject-introspection integration so there's more likely to be bugs that only affect say one package for cmake packages.

Quoted 3 lines

As Thomas also suggested, should we be doing that systematically in our g-ir-compiler wrapper?

I'm thinking it's probably not needed as it's likely a package specific issue and could interfere with meson's gobject-introspection integration.

Quoted 94 lines

I know Adam said your change was "the simplest solution to the problem". Still, this is not very satisfying...

Regards,
Yann E. MORIN.

Quoted 76 lines

---
Changes v1 -> v2:
- Rebase on top of master
- Use upstream commit

 ...txt-allow-the-user-to-configure-INTR.patch | 43 +++++++++++++++++++
 package/poppler/poppler.mk                    |  3 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch
package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch new file +43 -0
new file mode 100644
index 0000000000..079cf7234d
@@ -0,0 +1,43 @@
+From e9d5731ba254f35e2d94b628c51e48c50a945271 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Mon, 24 Jan 2022 09:28:20 +0100
+Subject: [PATCH] glib/CMakeLists.txt: allow the user to configure
+ INTROSPECTION_COMPILER_ARGS
+
+Allow the user to add its own parameters such as
+--includedir=$(STAGING_DIR)/usr/share/gir-1.0 to
+INTROSPECTION_COMPILER_ARGS to avoid the following build failure when
+cross-compiling with buildroot:
+
+[ 98%] Generating Poppler-0.18.typelib
+Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
+error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0
+If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
+Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"
+
+Fixes:
+ - http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved from:
+https://gitlab.freedesktop.org/poppler/poppler/-/commit/e9d5731ba254f35e2d94b628c51e48c50a945271]
+---
+ glib/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
+index 7510e69ee..f5130e3c9 100644
+--- a/glib/CMakeLists.txt
++++ b/glib/CMakeLists.txt
+@@ -119,7 +119,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS)
+   # General gir: Reset object-list for introspection & load tool args
+   set(INTROSPECTION_GIRS)
+   set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all")
+-  set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
++  set(INTROSPECTION_COMPILER_ARGS ${INTROSPECTION_COMPILER_ARGS} "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
+
+   # Poppler: Assign package to gir & export keys
+   set(Poppler_0_18_gir "poppler-glib")
+--
+GitLab
+
package/poppler/poppler.mk +2 -2
index b54262e7c4..db6da25d39 100644
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
      -DENABLE_GOBJECT_INTROSPECTION=ON \
      -DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-     -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+     -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+     -DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif
--

2.35.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
Quoted 5 lines

'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#8 lore raw

James, All,

On 2023-04-15 20:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 11 lines
Quoted 8 lines

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

From the looks of it most of our packages with a gobject-introspection dependency are meson based which use the native meson integration.

Ah, good point, that would explain.

We have 33 (target) packages that use meson, and 12 that don't; that's 25%, not a small part. But lets look at those:

    $ grep -E '\$\(eval \$\([^-]+-package\)\)' \
        $(git grep -l gobject-introspection '*.mk') \
      |grep -v meson
    package/gconf/gconf.mk:$(eval $(autotools-package))
    package/libffi/libffi.mk:$(eval $(autotools-package))
    package/libgee/libgee.mk:$(eval $(autotools-package))
    package/libgtk2/libgtk2.mk:$(eval $(autotools-package))
    package/libostree/libostree.mk:$(eval $(autotools-package))
    package/libqrtr-glib/libqrtr-glib.mk:$(eval $(autotools-package))
    package/librsvg/librsvg.mk:$(eval $(autotools-package))
    package/libvips/libvips.mk:$(eval $(autotools-package))
    package/midori/midori.mk:$(eval $(cmake-package))
    package/nodejs/nodejs.mk:$(eval $(generic-package))
    package/poppler/poppler.mk:$(eval $(cmake-package))
    package/webkitgtk/webkitgtk.mk:$(eval $(cmake-package))

So, a generic, 3 cmake, the rest is autotools.

- poppler we just fixed

- nodejs is a false positive, goi only appears in a comment.

- midori hasn't failed since 2021-08-22, but hasn't succeed since 2020-04-19 either... The last config that had midori enabled was in 2022-10-19 and failed for another reason. I've started a build locally...

- webkitgtk hasn't failed since 2022-11-13, but hasn't succeeded since 2021-12-07 either... There have been recent configs with webkitgtk enabled since 2022-11-13, but they failed for other reasons. I've started a build here...

- I got bored investigating on the autotools packages, so I started a build here, with as many enabled as possible (a few were missing arch supports, as I'm resuing the failed config as reported by Fabrice, which is on riscv...)

Quoted 4 lines

https://gi.readthedocs.io/en/latest/buildsystems/meson.html
From my understanding there is no standardized cmake gobject-introspection integration so there's more likely to be bugs that only affect say one package for cmake packages.

OK, that makes sense: the poppler fix is really an exception, so we do not need to catter for that in the wrapper.

Thanks for your feedback!

Regards,
Yann E. MORIN.

Quoted 105 lines
Quoted 2 lines

As Thomas also suggested, should we be doing that systematically in our g-ir-compiler wrapper?

I'm thinking it's probably not needed as it's likely a package specific issue and could interfere with meson's gobject-introspection integration.

Quoted 99 lines

I know Adam said your change was "the simplest solution to the problem". Still, this is not very satisfying...

Regards,
Yann E. MORIN.

Quoted 76 lines

---
Changes v1 -> v2:
- Rebase on top of master
- Use upstream commit

 ...txt-allow-the-user-to-configure-INTR.patch | 43 +++++++++++++++++++
 package/poppler/poppler.mk                    |  3 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch
package/poppler/0002-glib-CMakeLists.txt-allow-the-user-to-configure-INTR.patch new file +43 -0
new file mode 100644
index 0000000000..079cf7234d
@@ -0,0 +1,43 @@
+From e9d5731ba254f35e2d94b628c51e48c50a945271 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Mon, 24 Jan 2022 09:28:20 +0100
+Subject: [PATCH] glib/CMakeLists.txt: allow the user to configure
+ INTROSPECTION_COMPILER_ARGS
+
+Allow the user to add its own parameters such as
+--includedir=$(STAGING_DIR)/usr/share/gir-1.0 to
+INTROSPECTION_COMPILER_ARGS to avoid the following build failure when
+cross-compiling with buildroot:
+
+[ 98%] Generating Poppler-0.18.typelib
+Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir
+error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0
+If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
+Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"
+
+Fixes:
+ - http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved from:
+https://gitlab.freedesktop.org/poppler/poppler/-/commit/e9d5731ba254f35e2d94b628c51e48c50a945271]
+---
+ glib/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
+index 7510e69ee..f5130e3c9 100644
+--- a/glib/CMakeLists.txt
++++ b/glib/CMakeLists.txt
+@@ -119,7 +119,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS)
+   # General gir: Reset object-list for introspection & load tool args
+   set(INTROSPECTION_GIRS)
+   set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all")
+-  set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
++  set(INTROSPECTION_COMPILER_ARGS ${INTROSPECTION_COMPILER_ARGS} "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
+
+   # Poppler: Assign package to gir & export keys
+   set(Poppler_0_18_gir "poppler-glib")
+--
+GitLab
+
package/poppler/poppler.mk +2 -2
index b54262e7c4..db6da25d39 100644
@@ -47,7 +47,8 @@ POPPLER_DEPENDENCIES += gobject-introspection
 POPPLER_CONF_OPTS += \
      -DENABLE_GOBJECT_INTROSPECTION=ON \
      -DINTROSPECTION_SCANNER=$(STAGING_DIR)/usr/bin/g-ir-scanner \
-     -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler
+     -DINTROSPECTION_COMPILER=$(STAGING_DIR)/usr/bin/g-ir-compiler \
+     -DINTROSPECTION_COMPILER_ARGS="--includedir=$(STAGING_DIR)/usr/share/gir-1.0"
 else
 POPPLER_CONF_OPTS += -DENABLE_GOBJECT_INTROSPECTION=OFF
 endif
--

2.35.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

James, All,

On 2023-04-16 10:25 +0200, Yann E. MORIN spake thusly:

Quoted 8 lines

On 2023-04-15 20:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 5 lines
Quoted 5 lines

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

From the looks of it most of our packages with a gobject-introspection dependency are meson based which use the native meson integration.

Ah, good point, that would explain.

Unfortuantely, that assumption is wrong: granite uses meson, but fails in the same way:

[51/275] Generating lib/Granite-1.0.typelib with a custom command
FAILED: lib/Granite-1.0.typelibi
/home/ymorin/dev/buildroot/O/master/per-package/granite/host/riscv32-buildroot-linux-gnu/sysroot/usr/bin/g-ir-compiler --shared-library libgranite.so.6.0.0 --output lib/Granite-1.0.typelib /home/ymorin/dev/buildroot/O/master/build/granite-6.0.0/build/lib/Granite-1.0.gir Could not find GIR file 'GLib-2.0.gir'; check XDG_DATA_DIRS or use --includedir
error parsing file /home/ymorin/dev/buildroot/O/master/build/granite-6.0.0/build/lib/Granite-1.0.gir:
Failed to parse included gir GLib-2.0
If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"
ninja: build stopped: subcommand failed.
make[1]: *** [package/pkg-generic.mk:293: /home/ymorin/dev/buildroot/O/master/build/granite-6.0.0/.stamp_built] Error 1

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw
Quoted 15 lines · Yann E. MORIN

James, All,

On 2023-04-16 10:25 +0200, Yann E. MORIN spake thusly:

Quoted 11 lines

On 2023-04-15 20:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 8 lines
Quoted 8 lines

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

From the looks of it most of our packages with a gobject-introspection dependency are meson based which use the native meson integration.

Ah, good point, that would explain.

Unfortuantely, that assumption is wrong: granite uses meson, but fails in the same way:

While it's true it does use meson...it does not in fact use the native meson integration but rather uses a project specific gobject-introspection generator:
https://github.com/elementary/granite/blob/6.0.0/lib/meson.build#L102-L121

Quoted 15 lines

[51/275] Generating lib/Granite-1.0.typelib with a custom command
FAILED: lib/Granite-1.0.typelibi
/home/ymorin/dev/buildroot/O/master/per-package/granite/host/riscv32-buildroot-linux-gnu/sysroot/usr/bin/g-ir-compiler --shared-library libgranite.so.6.0.0 --output lib/Granite-1.0.typelib /home/ymorin/dev/buildroot/O/master/build/granite-6.0.0/build/lib/Granite-1.0.gir Could not find GIR file 'GLib-2.0.gir'; check XDG_DATA_DIRS or use --includedir
error parsing file /home/ymorin/dev/buildroot/O/master/build/granite-6.0.0/build/lib/Granite-1.0.gir:
Failed to parse included gir GLib-2.0
If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"
ninja: build stopped: subcommand failed.
make[1]: *** [package/pkg-generic.mk:293: /home/ymorin/dev/buildroot/O/master/build/granite-6.0.0/.stamp_built] Error 1

Regards,
Yann E. MORIN.

Quoted 7 lines

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#11 lore raw

James, All,

On 2023-04-18 02:03 -0600, James Hilliard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 12 lines

On 2023-04-16 10:25 +0200, Yann E. MORIN spake thusly:

Quoted 11 lines

On 2023-04-15 20:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 8 lines
Quoted 8 lines

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

From the looks of it most of our packages with a gobject-introspection dependency are meson based which use the native meson integration.

Ah, good point, that would explain.

Unfortuantely, that assumption is wrong: granite uses meson, but fails in the same way:

While it's true it does use meson...it does not in fact use the native meson integration but rather uses a project specific gobject-introspection generator:
https://github.com/elementary/granite/blob/6.0.0/lib/meson.build#L102-L121

Sure, but then maybe it begs for a generic solution, that works for all packages?

Maybe something like we used GIR_EXTRA_LIBS_PATH from the environment, we could allow paclages to specify additional include directories with GIR_EXTRA_INCLUDE_PATH ?

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw
Quoted 20 lines · Yann E. MORIN

James, All,

On 2023-04-18 02:03 -0600, James Hilliard spake thusly:

Quoted 16 lines · Yann E. MORIN
Quoted 15 lines

On 2023-04-16 10:25 +0200, Yann E. MORIN spake thusly:

Quoted 14 lines

On 2023-04-15 20:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 10 lines
Quoted 8 lines

However, I would really like to understand why we don't have more packages that are broken. Is it because poppler is the only one with include directives in his gir file, which means it needs access to the installed gir files from other packages (those from goi)?

Or is it because it is the only one that already passes an explicit --includedir option to g-ir-compiler, and that disables searching the standard directory?

From the looks of it most of our packages with a gobject-introspection dependency are meson based which use the native meson integration.

Ah, good point, that would explain.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Unfortuantely, that assumption is wrong: granite uses meson, but fails in the same way:

While it's true it does use meson...it does not in fact use the native meson integration but rather uses a project specific gobject-introspection generator:
https://github.com/elementary/granite/blob/6.0.0/lib/meson.build#L102-L121

Sure, but then maybe it begs for a generic solution, that works for all packages?

I reported this issue upstream to granite:
https://github.com/elementary/granite/issues/645

Quoted 4 lines

Maybe something like we used GIR_EXTRA_LIBS_PATH from the environment, we could allow paclages to specify additional include directories with GIR_EXTRA_INCLUDE_PATH ?

I'm not really sure if this makes sense to do for all packages as it could have side
effects which may interfere with meson's native gobject-introspection integration.

Quoted 11 lines

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#13 lore raw

James, All,

On 2023-04-18 15:58 -0600, James Hilliard spake thusly:

Quoted 8 lines · Yann E. MORIN
Quoted 5 lines

On 2023-04-18 02:03 -0600, James Hilliard spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

On 2023-04-16 10:25 +0200, Yann E. MORIN spake thusly:

Sure, but then maybe it begs for a generic solution, that works for all packages?

I reported this issue upstream to granite:
https://github.com/elementary/granite/issues/645

Thanks for beinging this upstream; They have explained why they can't use the "standard meson way", and the solution does not seem to be straightforward, so we'll definitely will have to have a way to workaround that.

Also, nothing would prevent any other cmake-based package to use introspection, and that would be similarly broken...

Quoted 7 lines
Quoted 3 lines

Maybe something like we used GIR_EXTRA_LIBS_PATH from the environment, we could allow paclages to specify additional include directories with GIR_EXTRA_INCLUDE_PATH ?

I'm not really sure if this makes sense to do for all packages as it could have side
effects which may interfere with meson's native gobject-introspection integration.

As I said, it would not be for *all* packages, but only for those that actually set GIR_EXTRA_INCLUDE_PATH; it would be handled the same way we currently handle GIR_EXTRA_LIBS_PATH: if a package needs a special path to find libraries, it can set GIR_EXTRA_LIBS_PATH [0] in its environment, e.g.:

    FOO_ENV += GIR_EXTRA_LIBS_PATH=$(@D)/src/.libs

And that will be automatically added to the library search path in our g-ir-scanner wrappers:

package/gobject-introspection/g-ir-scanner-qemuwrapper.in package/gobject-introspection/g-ir-scanner.in

So, we could very well do something similar for GIR_EXTRA_INCLUDE_PATH:

    diff --git a/package/gobject-introspection/g-ir-compiler.in b/package/gobject-introspection/g-ir-compiler.in
    index 712753023a..97a6d7333e 100644
    --- a/package/gobject-introspection/g-ir-compiler.in
    +++ b/package/gobject-introspection/g-ir-compiler.in
    @@ -1,3 +1,5 @@
    -#!/usr/bin/env sh
    +#!/usr/bin/env bash
    +
    +set $(printf ' --includedir=%s' ${GIR_EXTRA_INCLUDE_PATH//:/ }) "${@}"
     
     "$(dirname "$0")"/g-ir-scanner-qemuwrapper "$(dirname "$0")"/g-ir-compiler.real "$@"
    diff --git a/package/granite/granite.mk b/package/granite/granite.mk
    index 71dfbf4c03..8309d21414 100644
    --- a/package/granite/granite.mk
    +++ b/package/granite/granite.mk
    @@ -20,6 +20,8 @@ GRANITE_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
    
     ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
     GRANITE_CONF_OPTS += -Dintrospection=true
    +GRANITE_CONF_ENV += GIR_EXTRA_INCLUDE_PATH=$(STAGING_DIR)/usr/share/gir-1.0
    +GRANITE_NINJA_ENV += GIR_EXTRA_INCLUDE_PATH=$(STAGING_DIR)/usr/share/gir-1.0
     GRANITE_DEPENDENCIES += gobject-introspection
     else
     GRANITE_CONF_OPTS += -Dintrospection=false

We could do the same for poppler, but it's better to use upstream's mechanism, as they now have one. But for granite, if upstream can't find a solution, and does not want to add a config option, we'll have to resort to that...

[0] We currently have no package that sets GIR_EXTRA_LIBS_PATH, and never had, but support is there...

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot