Skip to contentSkip to conversation

package/pkg-meson.mk: set correct pkgconfig for native dependencies

PATCH New James Hilliard 4 participants 15 messages Apr 28, 2020 – Apr 30, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

This sets the correct build.pkg_config_path for all meson packages so that dependencies with native: true will properly use the the host pkgconfig instead of the target pkgconfig.

With this change we can now remove package specific workarounds.

---
 ...d-scanner-provided-by-wayland-scanne.patch | 52 -------------------
 package/mesa3d/mesa3d.mk                      |  1 -
 package/pkg-meson.mk                          |  1 +
 package/weston/weston.mk                      |  1 -
 ...onfig-to-find-wayland-scanner-when-c.patch | 45 ----------------
 5 files changed, 1 insertion(+), 99 deletions(-)
 delete mode 100644 package/mesa3d/0002-meson-use-wayland-scanner-provided-by-wayland-scanne.patch
 delete mode 100644 package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch
package/mesa3d/0002-meson-use-wayland-scanner-provided-by-wayland-scanne.patch deleted +0 -52
deleted file mode 100644
index 784b27c4a2..0000000000
@@ -1,52 +0,0 @@
-From 0e107f7bac8d84d8fb2bb5b83bfb4474348a82c1 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Wed, 17 Apr 2019 22:47:05 +0200
-Subject: [PATCH] meson: use wayland-scanner provided by wayland-scanner-path
-
-When cross-compiling the .pc file might point to the wrong
-wayland-scanner binary (target rather than host) resulting in a
-non-executable and wrong scanner.
-First try by using the path provided by wayland-scanner-path,
-and if that fails fall back into pkg-config.
-
-Based on the patch for autotools provided by Gustavo Zacarias.
-
-Signed-off-by: Romain Naour <[email protected]>
----
- meson.build       | 5 ++++-
- meson_options.txt | 6 ++++++
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 6c4f1508855..ef0532b2cfb 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1319,7 +1319,10 @@ endif
- 
- if with_platform_wayland
-   dep_wl_scanner = dependency('wayland-scanner', native: true)
--  prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
-+  prog_wl_scanner = get_option('wayland-scanner-path')
-+  if prog_wl_scanner == ''
-+    prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
-+  endif
-   if dep_wl_scanner.version().version_compare('>= 1.15')
-     wl_scanner_arg = 'private-code'
-   else
-diff --git a/meson_options.txt b/meson_options.txt
-index ccf70659ff7..59ff8df8337 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -324,3 +324,9 @@ option(
-   value : true,
-   description : 'Enable direct rendering in GLX and EGL for DRI',
- )
-+option(
-+  'wayland-scanner-path',
-+  type : 'string',
-+  value : '',
-+  description : 'Locations to wayland-scanner binary. Default: use path from pkg-config'
-+)
--- 
-2.20.1
-
package/mesa3d/mesa3d.mk +0 -1
index 22eff24c56..e06cfc4023 100644
@@ -193,7 +193,6 @@ endif
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland wayland-protocols
 MESA3D_PLATFORMS += wayland
-MESA3D_CONF_OPTS += -Dwayland-scanner-path=$(HOST_DIR)/bin/wayland-scanner
 endif
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_X11),y)
 MESA3D_DEPENDENCIES += \
package/pkg-meson.mk +1 -0
index 2ba10f30ed..0a4ab2194c 100644
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
 		--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \
 		$$($$(PKG)_CONF_OPTS) \
 		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
 endef
package/weston/weston.mk +0 -1
index b22e685948..541c6ba024 100644
@@ -14,7 +14,6 @@ WESTON_DEPENDENCIES = host-pkgconf wayland wayland-protocols \
 	libxkbcommon pixman libpng jpeg udev cairo libinput libdrm
 
 WESTON_CONF_OPTS = \
-	-Dbuild.pkg_config_path=$(HOST_DIR)/lib/pkgconfig \
 	-Dbackend-headless=false \
 	-Dcolor-management-colord=false \
 	-Dremoting=false
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch deleted +0 -45

45 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Hello Arnout,

Could you have a look at the patch below? My understanding is that your commit 4e0bc29993376613d200e892d491e31ea5a49622 should have made this unnecessary. Could you comment ?

Thanks,

Thomas

Quoted 162 lines · On Mon, 27 Apr 2020 22:06:38 -0600 James Hilliard <[email protected]>…

This sets the correct build.pkg_config_path for all meson packages so that dependencies with native: true will properly use the the host pkgconfig instead of the target pkgconfig.

With this change we can now remove package specific workarounds.

---
 ...d-scanner-provided-by-wayland-scanne.patch | 52 -------------------
 package/mesa3d/mesa3d.mk                      |  1 -
 package/pkg-meson.mk                          |  1 +
 package/weston/weston.mk                      |  1 -
 ...onfig-to-find-wayland-scanner-when-c.patch | 45 ----------------
 5 files changed, 1 insertion(+), 99 deletions(-)
 delete mode 100644 package/mesa3d/0002-meson-use-wayland-scanner-provided-by-wayland-scanne.patch
 delete mode 100644 package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch
package/mesa3d/0002-meson-use-wayland-scanner-provided-by-wayland-scanne.patch deleted +0 -52
deleted file mode 100644
index 784b27c4a2..0000000000
@@ -1,52 +0,0 @@
-From 0e107f7bac8d84d8fb2bb5b83bfb4474348a82c1 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Wed, 17 Apr 2019 22:47:05 +0200
-Subject: [PATCH] meson: use wayland-scanner provided by wayland-scanner-path
-
-When cross-compiling the .pc file might point to the wrong
-wayland-scanner binary (target rather than host) resulting in a
-non-executable and wrong scanner.
-First try by using the path provided by wayland-scanner-path,
-and if that fails fall back into pkg-config.
-
-Based on the patch for autotools provided by Gustavo Zacarias.
-
-Signed-off-by: Romain Naour <[email protected]>
----
- meson.build       | 5 ++++-
- meson_options.txt | 6 ++++++
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 6c4f1508855..ef0532b2cfb 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1319,7 +1319,10 @@ endif
- 
- if with_platform_wayland
-   dep_wl_scanner = dependency('wayland-scanner', native: true)
--  prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
-+  prog_wl_scanner = get_option('wayland-scanner-path')
-+  if prog_wl_scanner == ''
-+    prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
-+  endif
-   if dep_wl_scanner.version().version_compare('>= 1.15')
-     wl_scanner_arg = 'private-code'
-   else
-diff --git a/meson_options.txt b/meson_options.txt
-index ccf70659ff7..59ff8df8337 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -324,3 +324,9 @@ option(
-   value : true,
-   description : 'Enable direct rendering in GLX and EGL for DRI',
- )
-+option(
-+  'wayland-scanner-path',
-+  type : 'string',
-+  value : '',
-+  description : 'Locations to wayland-scanner binary. Default: use path from pkg-config'
-+)
--- 
-2.20.1
-
package/mesa3d/mesa3d.mk +0 -1
index 22eff24c56..e06cfc4023 100644
@@ -193,7 +193,6 @@ endif
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland wayland-protocols
 MESA3D_PLATFORMS += wayland
-MESA3D_CONF_OPTS += -Dwayland-scanner-path=$(HOST_DIR)/bin/wayland-scanner
 endif
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_X11),y)
 MESA3D_DEPENDENCIES += \
package/pkg-meson.mk +1 -0
index 2ba10f30ed..0a4ab2194c 100644
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
 		--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \
 		$$($$(PKG)_CONF_OPTS) \
 		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
 endef
package/weston/weston.mk +0 -1
index b22e685948..541c6ba024 100644
@@ -14,7 +14,6 @@ WESTON_DEPENDENCIES = host-pkgconf wayland wayland-protocols \
 	libxkbcommon pixman libpng jpeg udev cairo libinput libdrm
 
 WESTON_CONF_OPTS = \
-	-Dbuild.pkg_config_path=$(HOST_DIR)/lib/pkgconfig \
 	-Dbackend-headless=false \
 	-Dcolor-management-colord=false \
 	-Dremoting=false
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch deleted +0 -45
deleted file mode 100644
index 898506a0dc..0000000000
@@ -1,45 +0,0 @@
-From 72138a67c8e6b0154aadc1b5fcb3d661033fbcd3 Mon Sep 17 00:00:00 2001
-From: Adrian Perez de Castro <[email protected]>
-Date: Thu, 13 Jun 2019 02:13:47 +0300
-Subject: [PATCH] Do not use pkg-config to find wayland-scanner when cross
- building
-
-When cross-compiling it is still needed to run a native wayland-scanner,
-but many tools for the task will still have pkg-config return the
-location of wayland-scanner for the target in some location which may
-be the same as for some native installation of wayland-scanner; but
-which is not the copy of the program that the compilation system wants
-packages to use (which are typically in a "host tools" directory
-elsewhere).
-
-This disables usage of pkg-config to find wayland-scanner when
-cross-compiling because most tools for the job will set $PATH in a way
-that the correct installation of the tool will be found first.
-
-Signed-off-by: Adrian Perez de Castro <[email protected]>
-[Upstream status: https://github.com/swaywm/wlroots/pull/1722]
-
----
- protocol/meson.build | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/protocol/meson.build b/protocol/meson.build
-index 7cc10320..73c06b24 100644
---- a/protocol/meson.build
-+++ b/protocol/meson.build
-@@ -1,6 +1,11 @@
- wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
- 
--wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
-+if meson.is_cross_build()
-+	wayland_scanner_dep = disabler()
-+else
-+	wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
-+endif
-+
- if wayland_scanner_dep.found()
- 	wayland_scanner = find_program(
- 		wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'),
--- 
-2.22.0
-
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 6 lines · Thomas Petazzoni

Hello Arnout,

Could you have a look at the patch below? My understanding is that your commit 4e0bc29993376613d200e892d491e31ea5a49622 should have made this unnecessary. Could you comment ?

I've confirmed with upstream that this option can only be passed via command line
and not via cross-compilation.conf at the moment so I'm fairly confident that 4e0bc29993376613d200e892d491e31ea5a49622 would not fix this issue.

Quoted 177 lines

Thanks,

Thomas

Quoted 152 lines · On Mon, 27 Apr 2020 22:06:38 -0600 James Hilliard <[email protected]>…

This sets the correct build.pkg_config_path for all meson packages so that dependencies with native: true will properly use the the host pkgconfig instead of the target pkgconfig.

With this change we can now remove package specific workarounds.

---
 ...d-scanner-provided-by-wayland-scanne.patch | 52 -------------------
 package/mesa3d/mesa3d.mk                      |  1 -
 package/pkg-meson.mk                          |  1 +
 package/weston/weston.mk                      |  1 -
 ...onfig-to-find-wayland-scanner-when-c.patch | 45 ----------------
 5 files changed, 1 insertion(+), 99 deletions(-)
 delete mode 100644 package/mesa3d/0002-meson-use-wayland-scanner-provided-by-wayland-scanne.patch
 delete mode 100644 package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch
package/mesa3d/0002-meson-use-wayland-scanner-provided-by-wayland-scanne.patch deleted +0 -52
deleted file mode 100644
index 784b27c4a2..0000000000
@@ -1,52 +0,0 @@
-From 0e107f7bac8d84d8fb2bb5b83bfb4474348a82c1 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Wed, 17 Apr 2019 22:47:05 +0200
-Subject: [PATCH] meson: use wayland-scanner provided by wayland-scanner-path
-
-When cross-compiling the .pc file might point to the wrong
-wayland-scanner binary (target rather than host) resulting in a
-non-executable and wrong scanner.
-First try by using the path provided by wayland-scanner-path,
-and if that fails fall back into pkg-config.
-
-Based on the patch for autotools provided by Gustavo Zacarias.
-
-Signed-off-by: Romain Naour <[email protected]>
----
- meson.build       | 5 ++++-
- meson_options.txt | 6 ++++++
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 6c4f1508855..ef0532b2cfb 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1319,7 +1319,10 @@ endif
-
- if with_platform_wayland
-   dep_wl_scanner = dependency('wayland-scanner', native: true)
--  prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
-+  prog_wl_scanner = get_option('wayland-scanner-path')
-+  if prog_wl_scanner == ''
-+    prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
-+  endif
-   if dep_wl_scanner.version().version_compare('>= 1.15')
-     wl_scanner_arg = 'private-code'
-   else
-diff --git a/meson_options.txt b/meson_options.txt
-index ccf70659ff7..59ff8df8337 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -324,3 +324,9 @@ option(
-   value : true,
-   description : 'Enable direct rendering in GLX and EGL for DRI',
- )
-+option(
-+  'wayland-scanner-path',
-+  type : 'string',
-+  value : '',
-+  description : 'Locations to wayland-scanner binary. Default: use path from pkg-config'
-+)
---
-2.20.1
-
package/mesa3d/mesa3d.mk +0 -1
index 22eff24c56..e06cfc4023 100644
@@ -193,7 +193,6 @@ endif
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland wayland-protocols
 MESA3D_PLATFORMS += wayland
-MESA3D_CONF_OPTS += -Dwayland-scanner-path=$(HOST_DIR)/bin/wayland-scanner
 endif
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_X11),y)
 MESA3D_DEPENDENCIES += \
package/pkg-meson.mk +1 -0
index 2ba10f30ed..0a4ab2194c 100644
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
              --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
              --buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
              --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+             -Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \
              $$($$(PKG)_CONF_OPTS) \
              $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
 endef
package/weston/weston.mk +0 -1
index b22e685948..541c6ba024 100644
@@ -14,7 +14,6 @@ WESTON_DEPENDENCIES = host-pkgconf wayland wayland-protocols \
      libxkbcommon pixman libpng jpeg udev cairo libinput libdrm
 
 WESTON_CONF_OPTS = \
-     -Dbuild.pkg_config_path=$(HOST_DIR)/lib/pkgconfig \
      -Dbackend-headless=false \
      -Dcolor-management-colord=false \
      -Dremoting=false
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch deleted +0 -35
deleted file mode 100644
index 898506a0dc..0000000000
@@ -1,45 +0,0 @@
-From 72138a67c8e6b0154aadc1b5fcb3d661033fbcd3 Mon Sep 17 00:00:00 2001
-From: Adrian Perez de Castro <[email protected]>
-Date: Thu, 13 Jun 2019 02:13:47 +0300
-Subject: [PATCH] Do not use pkg-config to find wayland-scanner when cross
- building
-
-When cross-compiling it is still needed to run a native wayland-scanner,
-but many tools for the task will still have pkg-config return the
-location of wayland-scanner for the target in some location which may
-be the same as for some native installation of wayland-scanner; but
-which is not the copy of the program that the compilation system wants
-packages to use (which are typically in a "host tools" directory
-elsewhere).
-
-This disables usage of pkg-config to find wayland-scanner when
-cross-compiling because most tools for the job will set $PATH in a way
-that the correct installation of the tool will be found first.
-
-Signed-off-by: Adrian Perez de Castro <[email protected]>
-[Upstream status: https://github.com/swaywm/wlroots/pull/1722]
-
----
- protocol/meson.build | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/protocol/meson.build b/protocol/meson.build
-index 7cc10320..73c06b24 100644
---- a/protocol/meson.build
-+++ b/protocol/meson.build
-@@ -1,6 +1,11 @@
- wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
-
--wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
-+if meson.is_cross_build()
-+    wayland_scanner_dep = disabler()

package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch line 45

Quoted 10 lines
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch deleted +0 -10
-+else
-+    wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
-+endif
-+
- if wayland_scanner_dep.found()
-     wayland_scanner = find_program(
-             wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'),
---
-2.22.0
-

--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#3 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 7 lines · On Mon, 27 Apr 2020 23:28:05 -0600 James Hilliard <[email protected]>…
Quoted 3 lines

Could you have a look at the patch below? My understanding is that your commit 4e0bc29993376613d200e892d491e31ea5a49622 should have made this unnecessary. Could you comment ?

I've confirmed with upstream that this option can only be passed via command line
and not via cross-compilation.conf at the moment so I'm fairly confident that 4e0bc29993376613d200e892d491e31ea5a49622 would not fix this issue.

But then I wonder what is the point of 4e0bc29993376613d200e892d491e31ea5a49622 and how it can have worked ?

Or is it necessary *in* addition to passing -Dbuild.pkg_config_path ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 12 lines · Thomas Petazzoni
Quoted 7 lines · On Mon, 27 Apr 2020 23:28:05 -0600 James Hilliard <[email protected]>…
Quoted 3 lines

Could you have a look at the patch below? My understanding is that your commit 4e0bc29993376613d200e892d491e31ea5a49622 should have made this unnecessary. Could you comment ?

I've confirmed with upstream that this option can only be passed via command line
and not via cross-compilation.conf at the moment so I'm fairly confident that 4e0bc29993376613d200e892d491e31ea5a49622 would not fix this issue.

Quoted 4 lines

But then I wonder what is the point of 4e0bc29993376613d200e892d491e31ea5a49622 and how it can have worked ?

Or is it necessary *in* addition to passing -Dbuild.pkg_config_path ?

Well I'm fairly confident -Dbuild.pkg_config_path is necessary, best I can tell 4e0bc29993376613d200e892d491e31ea5a49622 is fixing an unrelated issue.

Quoted 8 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#5 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

In reply to Thomas Petazzoni
Quoted 6 lines · Thomas Petazzoni
Quoted 3 lines · On Mon, 27 Apr 2020 23:28:05 -0600 James Hilliard <[email protected]>…
Quoted 3 lines

Could you have a look at the patch below? My understanding is that your commit 4e0bc29993376613d200e892d491e31ea5a49622 should have made this unnecessary. Could you comment ?

Quoted 7 lines
Quoted 4 lines

I've confirmed with upstream that this option can only be passed via command line
and not via cross-compilation.conf at the moment so I'm fairly confident that 4e0bc29993376613d200e892d491e31ea5a49622 would not fix this issue.

But then I wonder what is the point of 4e0bc29993376613d200e892d491e31ea5a49622 and how it can have worked ?

That commit also added sys_root to cross-compilation.conf. It's very well
possible that for the single thing that was tested with it (goi), the sys_root change was sufficient to make it pass. I don't remember if I double-checked if the pkg_config_libdir was taken into account. It was purely based on reading the meson source code.

Regards,
Arnout

Quoted 7 lines

Or is it necessary *in* addition to passing -Dbuild.pkg_config_path ?

Thanks,

Thomas

#6 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

In reply to Thomas Petazzoni

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 90

Quoted 6 lines · Thomas Petazzoni

+++ b/package/pkg-meson.mk

package/pkg-meson.mk +1 -0
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
 		--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \

This can't be right. Here you're setting the pkg_config_path to the one for
native build. It may work in the specific case of wayland-scanner where you actually want the native one, but it will break anything that requires the cross package config.

(Of course, this statement is just from reading the code, I could be wrong.)

Regards,
Arnout

Quoted 2 lines
package/pkg-meson.mk +0 -0
 		$$($$(PKG)_CONF_OPTS) \
 		$$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
#7 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 4 lines · Arnout Vandecappelle

On 28/04/2020 07:22, Thomas Petazzoni wrote:

Quoted 11 lines

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 90

Quoted 6 lines

+++ b/package/pkg-meson.mk

package/pkg-meson.mk +1 -0
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
              --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
              --buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
              --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+             -Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \

This can't be right. Here you're setting the pkg_config_path to the one for
native build. It may work in the specific case of wayland-scanner where you actually want the native one, but it will break anything that requires the cross package config.

We've essentially already been using this exact option for weston so I'm pretty sure it's correct. This option should only override pkgconfig for native: true dependencies.

Quoted 8 lines

(Of course, this statement is just from reading the code, I could be wrong.)

Regards,
Arnout

Quoted 2 lines
package/pkg-meson.mk +0 -0
              $$($$(PKG)_CONF_OPTS) \
              $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
#8 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 17 lines · James Hilliard
Quoted 4 lines · Arnout Vandecappelle

On 28/04/2020 07:22, Thomas Petazzoni wrote:

Quoted 11 lines

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 90

Quoted 6 lines

+++ b/package/pkg-meson.mk

package/pkg-meson.mk +1 -0
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
              --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
              --buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
              --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+             -Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \

This can't be right. Here you're setting the pkg_config_path to the one for
native build. It may work in the specific case of wayland-scanner where you actually want the native one, but it will break anything that requires the cross package config.

Quoted 3 lines

We've essentially already been using this exact option for weston so I'm pretty sure it's correct. This option should only override pkgconfig for native: true dependencies.

See documentation here: https://mesonbuild.com/Builtin-options.html#core-options

Quoted 8 lines
Quoted 8 lines

(Of course, this statement is just from reading the code, I could be wrong.)

Regards,
Arnout

Quoted 2 lines
package/pkg-meson.mk +0 -0
              $$($$(PKG)_CONF_OPTS) \
              $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
#9 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

In reply to Arnout Vandecappelle
Quoted 12 lines · On Tue, 28 Apr 2020 08:50:43 +0200 Arnout Vandecappelle <[email protected]> wrote:

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 90

Quoted 6 lines · Thomas Petazzoni

+++ b/package/pkg-meson.mk

package/pkg-meson.mk +1 -0
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
 		--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \  

This can't be right. Here you're setting the pkg_config_path to the one for
native build. It may work in the specific case of wayland-scanner where you actually want the native one, but it will break anything that requires the cross package config.

Isn't the "build." scoping of that property going to make it apply only for the native parts of the build ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#10 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 16 lines · Thomas Petazzoni
Quoted 12 lines · On Tue, 28 Apr 2020 08:50:43 +0200 Arnout Vandecappelle <[email protected]> wrote:

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 90

Quoted 6 lines · Thomas Petazzoni

+++ b/package/pkg-meson.mk

package/pkg-meson.mk +1 -0
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
 		--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+		-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \  

This can't be right. Here you're setting the pkg_config_path to the one for
native build. It may work in the specific case of wayland-scanner where you actually want the native one, but it will break anything that requires the cross package config.

Quoted 2 lines

Isn't the "build." scoping of that property going to make it apply only for the native parts of the build ?

Ah, silly me, of course!

Thanks James and Thomas for correcting me.

So in that case, this patch looks good. But the meson.mk change should be a
separate patch, of course.

I also wonder: is the pkg_config_path in cross-compilation.conf that I added in
4e0bc29993376613d200e892d491e31ea5a49622 completely disfunctional? In that case, it should be replaced with a -Dtarget.pkg_config_path instead.

If it does function, how is it possible that it works with
cross-compilation.conf but not with native-compilation.conf?

Regards,
Arnout

#11 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 23 lines · Arnout Vandecappelle
Quoted 16 lines · Thomas Petazzoni
Quoted 12 lines · On Tue, 28 Apr 2020 08:50:43 +0200 Arnout Vandecappelle <[email protected]> wrote:

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 90

Quoted 6 lines · Thomas Petazzoni

+++ b/package/pkg-meson.mk

package/pkg-meson.mk +1 -0
@@ -87,6 +87,7 @@ define $(2)_CONFIGURE_CMDS
            --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
            --buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
            --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+           -Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \

This can't be right. Here you're setting the pkg_config_path to the one for
native build. It may work in the specific case of wayland-scanner where you actually want the native one, but it will break anything that requires the cross package config.

Quoted 2 lines

Isn't the "build." scoping of that property going to make it apply only for the native parts of the build ?

Quoted 6 lines

Ah, silly me, of course!

Thanks James and Thomas for correcting me.

So in that case, this patch looks good. But the meson.mk change should be a
separate patch, of course.

That would overlap with the weston -Dbuild.pkg_config_path removal.

Quoted 4 lines

I also wonder: is the pkg_config_path in cross-compilation.conf that I added in
4e0bc29993376613d200e892d491e31ea5a49622 completely disfunctional? In that case, it should be replaced with a -Dtarget.pkg_config_path instead.

I think it's still being set for dependencies without native: true.

Quoted 3 lines

If it does function, how is it possible that it works with
cross-compilation.conf but not with native-compilation.conf?

I thought we don't use a conf file for building host packages only target.

Quoted 3 lines

Regards,
Arnout

#12 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 5 lines · On Tue, 28 Apr 2020 02:05:13 -0600 James Hilliard <[email protected]>…
Quoted 4 lines

Thanks James and Thomas for correcting me.

So in that case, this patch looks good. But the meson.mk change should be a
separate patch, of course.

That would overlap with the weston -Dbuild.pkg_config_path removal.

You add -Dbuild.pkg_config_path in pkg-meson.mk in a first patch.

Then in a second patch, you remove it from weston.mk.

Yes, in between it means it is passed twice, but this is OK, as it doesn't break.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#13 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

Quoted 11 lines · Thomas Petazzoni
Quoted 5 lines · On Tue, 28 Apr 2020 02:05:13 -0600 James Hilliard <[email protected]>…
Quoted 4 lines

Thanks James and Thomas for correcting me.

So in that case, this patch looks good. But the meson.mk change should be a
separate patch, of course.

That would overlap with the weston -Dbuild.pkg_config_path removal.

You add -Dbuild.pkg_config_path in pkg-meson.mk in a first patch.

https://patchwork.ozlabs.org/project/buildroot/patch/20200428122213.63826-1-james.hilliard1 at gmail.com/

Quoted 2 lines

Then in a second patch, you remove it from weston.mk.

https://patchwork.ozlabs.org/project/buildroot/patch/20200428122213.63826-2-james.hilliard1 at gmail.com/

Quoted 3 lines

Yes, in between it means it is passed twice, but this is OK, as it doesn't break.

Ok, I've sent the moving of -Dbuild.pkg_config_path from weston.mk to pkg-meson.mk as a 2 patch series, I'll follow up with the removal of the other workarounds after those are merged.

Quoted 6 lines

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#14 lore raw

PATCH 1/1 package/pkg-meson.mk: set correct pkgconfig for native dependencies

James, All,

On 2020-04-30 14:06 -0600, James Hilliard spake thusly:

Quoted 15 lines
Quoted 11 lines · Thomas Petazzoni
Quoted 5 lines · On Tue, 28 Apr 2020 02:05:13 -0600 James Hilliard <[email protected]>…
Quoted 4 lines

Thanks James and Thomas for correcting me.

So in that case, this patch looks good. But the meson.mk change should be a
separate patch, of course.

That would overlap with the weston -Dbuild.pkg_config_path removal.

You add -Dbuild.pkg_config_path in pkg-meson.mk in a first patch.

https://patchwork.ozlabs.org/project/buildroot/patch/20200428122213.63826-1-james.hilliard1 at gmail.com/

Quoted 1 line
Quoted 8 lines
Quoted 1 line

Then in a second patch, you remove it from weston.mk.

https://patchwork.ozlabs.org/project/buildroot/patch/20200428122213.63826-2-james.hilliard1 at gmail.com/

Quoted 3 lines

Yes, in between it means it is passed twice, but this is OK, as it doesn't break.

Ok, I've sent the moving of -Dbuild.pkg_config_path from weston.mk to pkg-meson.mk as a 2 patch series, I'll follow up with the removal of the other workarounds after those are merged.

Have seen them, thanks.

However, I am not sure I followed what is still needed about this meson
stuff: care to heck the status of each patch and seris on patchwork, nad mark as rejected or not-applicable those that no longer make sense, please?

Regards,
Yann E. MORIN.

Quoted 5 lines
Quoted 5 lines

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Signature · 6 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.  |
'------------------------------^-------^------------------^--------------------'