All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR
@ 2022-07-27  7:15 James Hilliard
  2022-07-27  7:15 ` [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages James Hilliard
  2022-08-07 13:54 ` [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 11+ messages in thread
From: James Hilliard @ 2022-07-27  7:15 UTC (permalink / raw)
  To: buildroot
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, James Hilliard,
	Norbert Lange, Yann E . MORIN, Thomas De Schampheleire

This doesn't appear to be required and seems to break for packages
using meson's pkgconfig.relocatable format.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 support/misc/toolchainfile.cmake.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index 5d2b8695b4..24d2b401f0 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -91,7 +91,6 @@ endif()
 if(NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 endif()
-set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 
 # This toolchain file can be used both inside and outside Buildroot.
 if(NOT DEFINED CMAKE_C_COMPILER)
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27  7:15 [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR James Hilliard
@ 2022-07-27  7:15 ` James Hilliard
  2022-07-27  9:00   ` Arnout Vandecappelle
  2022-07-27 11:25   ` Yann E. MORIN
  2022-08-07 13:54 ` [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR Thomas Petazzoni via buildroot
  1 sibling, 2 replies; 11+ messages in thread
From: James Hilliard @ 2022-07-27  7:15 UTC (permalink / raw)
  To: buildroot
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, James Hilliard,
	Norbert Lange, Yann E . MORIN, Thomas De Schampheleire

As of version 0.54.0 meson has had the ability to build and install
packages rather than having to run ninja directly as before.

This will allow us to use features such as meson install tags in
the future which require meson to be used for the installation.

Note that we've removed FOO_NINJA_ENV which may cause issues
in the unlikely event an external package uses it.

We need to set --pkgconfig.relocatable so that pkg-config files are
not generated with absolute paths which cause issues with per-package
directories.

Remove conflicting host-systemd paths.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v4 -> v5:
  - don't set destdir for host install
Changes v3 -> v4:
  - split out cmake fix
  - cleanup config vars
  - clearify commit message
Changes v2 -> v3:
  - set pkgconfig to relocatable
  - set cmake pkg-config prefix path
Changes v1 -> v2:
  - update docs
---
 docs/manual/adding-packages-meson.txt         |  4 +-
 .../gobject-introspection.mk                  |  4 +-
 package/pkg-meson.mk                          | 67 ++++++++++++++-----
 package/systemd/systemd.mk                    |  9 +--
 4 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
index 029c8c2488..c8aed65c2f 100644
--- a/docs/manual/adding-packages-meson.txt
+++ b/docs/manual/adding-packages-meson.txt
@@ -125,8 +125,8 @@ will therefore only use a few of them.
   +c_link_args+, +cpp_args+, +cpp_link_args+, +sys_root+, and
   +pkg_config_libdir+.
 
-* +FOO_NINJA_ENV+, to specify additional environment variables to pass to
-  +ninja+, meson companion tool in charge of the build operations. By default,
+* +FOO_MESON_ENV+, to specify additional environment variables to pass to
+  +meson+, meson tool in charge of the build/install operations. By default,
   empty.
 
 * +FOO_NINJA_OPTS+, to specify a space-separated list of targets to build. By
diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk
index 41d64171a7..ea5100247d 100644
--- a/package/gobject-introspection/gobject-introspection.mk
+++ b/package/gobject-introspection/gobject-introspection.mk
@@ -30,14 +30,14 @@ HOST_GOBJECT_INTROSPECTION_DEPENDENCIES = \
 	host-python3
 
 # g-ir-scanner will default to /usr/bin/ld for linking if this is not set.
-GOBJECT_INTROSPECTION_NINJA_ENV += \
+GOBJECT_INTROSPECTION_MESON_ENV += \
 	CC="$(TARGET_CC)"
 
 # When building, gobject-introspection uses tools/g-ir-scanner to build several
 # .gir and .typelib files. g-ir-scanner does not use LDFLAGS, and by default,
 # links to the system-installed libglib2 path. To remedy this issue, defining
 # LD_LIBRARY_PATH forces g-ir-scanner to use our host installed libglib2 files.
-HOST_GOBJECT_INTROSPECTION_NINJA_ENV += \
+HOST_GOBJECT_INTROSPECTION_MESON_ENV += \
 	LD_LIBRARY_PATH="$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(HOST_DIR)/lib"
 
 # Use the host gi-scanner to prevent the scanner from generating incorrect
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 0835e08e3a..ffa1f662a9 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -21,13 +21,13 @@
 ################################################################################
 
 #
-# Pass PYTHONNOUSERSITE environment variable when invoking Meson or Ninja, so
+# Pass PYTHONNOUSERSITE environment variable when invoking Meson, so
 # $(HOST_DIR)/bin/python3 will not look for Meson modules in
 # $HOME/.local/lib/python3.x/site-packages
 #
-MESON		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/meson
-NINJA		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/ninja
-NINJA_OPTS	= $(if $(VERBOSE),-v)
+MESON              = PYTHONNOUSERSITE=y $(HOST_DIR)/bin/meson
+MESON_BUILD_OPTS   = $(if $(VERBOSE),-v)
+MESON_INSTALL_OPTS = --no-rebuild
 
 # https://mesonbuild.com/Reference-tables.html#cpu-families
 ifeq ($(BR2_arcle)$(BR2_arceb),y)
@@ -136,6 +136,7 @@ define $(2)_CONFIGURE_CMDS
 	CXX_FOR_BUILD="$$(HOSTCXX)" \
 	$$($$(PKG)_CONF_ENV) \
 	$$(MESON) \
+		--pkgconfig.relocatable \
 		--prefix=/usr \
 		--libdir=lib \
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
@@ -156,10 +157,20 @@ define $(2)_CONFIGURE_CMDS
 	mkdir -p $$($$(PKG)_SRCDIR)/build
 	$$(HOST_CONFIGURE_OPTS) \
 	$$($$(PKG)_CONF_ENV) $$(MESON) \
+		--pkgconfig.relocatable \
 		--prefix=$$(HOST_DIR) \
-		--libdir=lib \
-		--sysconfdir=$$(HOST_DIR)/etc \
+		--bindir=$$(HOST_DIR)/bin \
+		--datadir=$$(HOST_DIR)/share \
+		--includedir=$$(HOST_DIR)/include \
+		--infodir=$$(HOST_DIR)/share/info \
+		--libdir=$$(HOST_DIR)/lib \
+		--libexecdir=$$(HOST_DIR)/libexec \
+		--localedir=$$(HOST_DIR)/share/locale \
 		--localstatedir=$$(HOST_DIR)/var \
+		--mandir=$$(HOST_DIR)/share/man \
+		--sbindir=$$(HOST_DIR)/sbin \
+		--sharedstatedir=$$(HOST_DIR)/com \
+		--sysconfdir=$$(HOST_DIR)/etc \
 		--default-library=shared \
 		--buildtype=release \
 		--wrap-mode=nodownload \
@@ -179,13 +190,23 @@ $(2)_DEPENDENCIES += host-meson
 ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-		$$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+	$$(TARGET_MAKE_ENV) \
+	$$($$(PKG)_MESON_ENV) \
+	$$(MESON) \
+		compile \
+		$$(MESON_BUILD_OPTS) \
+		$$(if $$($$(PKG)_NINJA_OPTS),--ninja-args $$($$(PKG)_NINJA_OPTS)) \
+		-C $$($$(PKG)_SRCDIR)/build
 endef
 else
 define $(2)_BUILD_CMDS
-	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-		$$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+	$$(HOST_MAKE_ENV) \
+	$$($$(PKG)_MESON_ENV) \
+	$$(MESON) \
+		compile \
+		$$(MESON_BUILD_OPTS) \
+		$$(if $$($$(PKG)_NINJA_OPTS),--ninja-args $$($$(PKG)_NINJA_OPTS)) \
+		-C $$($$(PKG)_SRCDIR)/build
 endef
 endif
 endif
@@ -196,8 +217,12 @@ endif
 #
 ifndef $(2)_INSTALL_CMDS
 define $(2)_INSTALL_CMDS
-	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+	$$(HOST_MAKE_ENV) \
+	$$($$(PKG)_MESON_ENV) \
+	$$(MESON) \
+		install \
+		$$(MESON_INSTALL_OPTS) \
+		-C $$($$(PKG)_SRCDIR)/build
 endef
 endif
 
@@ -207,8 +232,13 @@ endif
 #
 ifndef $(2)_INSTALL_STAGING_CMDS
 define $(2)_INSTALL_STAGING_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+	$$(TARGET_MAKE_ENV) \
+	$$($$(PKG)_MESON_ENV) \
+	$$(MESON) \
+		install \
+		$$(MESON_INSTALL_OPTS) \
+		--destdir $$(STAGING_DIR) \
+		-C $$($$(PKG)_SRCDIR)/build
 endef
 endif
 
@@ -218,8 +248,13 @@ endif
 #
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+	$$(TARGET_MAKE_ENV) \
+	$$($$(PKG)_MESON_ENV) \
+	$$(MESON) \
+		install \
+		$$(MESON_INSTALL_OPTS) \
+		--destdir $$(TARGET_DIR) \
+		-C $$($$(PKG)_SRCDIR)/build
 endef
 endif
 
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 47aaddf849..6efc8d636f 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -749,7 +749,7 @@ endef
 SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_PRESET_ALL
 
 SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
-SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
+SYSTEMD_MESON_ENV = $(HOST_UTF8_LOCALE_ENV)
 
 define SYSTEMD_LINUX_CONFIG_FIXUPS
 	$(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS)
@@ -777,10 +777,7 @@ endef
 HOST_SYSTEMD_CONF_OPTS = \
 	-Dsplit-bin=true \
 	-Dsplit-usr=false \
-	--prefix=/usr \
-	--libdir=lib \
-	--sysconfdir=/etc \
-	--localstatedir=/var \
+	-Drootprefix=$(HOST_DIR) \
 	-Dmode=release \
 	-Dutmp=false \
 	-Dhibernate=false \
@@ -852,8 +849,6 @@ HOST_SYSTEMD_DEPENDENCIES = \
 	host-gperf \
 	host-python-jinja2
 
-HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
-
 # Fix RPATH After installation
 # * systemd provides a install_rpath instruction to meson because the binaries
 #   need to link with libsystemd which is not in a standard path
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27  7:15 ` [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages James Hilliard
@ 2022-07-27  9:00   ` Arnout Vandecappelle
  2022-07-27 18:33     ` James Hilliard
  2022-07-27 11:25   ` Yann E. MORIN
  1 sibling, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2022-07-27  9:00 UTC (permalink / raw)
  To: James Hilliard, buildroot
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, Norbert Lange,
	Yann E . MORIN, Thomas De Schampheleire



On 27/07/2022 09:15, James Hilliard wrote:
> As of version 0.54.0 meson has had the ability to build and install
> packages rather than having to run ninja directly as before.
> 
> This will allow us to use features such as meson install tags in
> the future which require meson to be used for the installation.
> 
> Note that we've removed FOO_NINJA_ENV which may cause issues
> in the unlikely event an external package uses it.
> 
> We need to set --pkgconfig.relocatable so that pkg-config files are
> not generated with absolute paths which cause issues with per-package
> directories.

  This still doesn't explain how it is related to using meson rather than ninja. 
Are you saying that when calling ninja directly, PPD work perfectly fine, but if 
it's installed with meson, it doesn't? Then I'd really like to have a little 
more insight into what meson does to break it.

  I suspect that the two are actually unrelated, and thus the patches should be 
split.

> 
> Remove conflicting host-systemd paths.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

[snip]
> @@ -156,10 +157,20 @@ define $(2)_CONFIGURE_CMDS
>   	mkdir -p $$($$(PKG)_SRCDIR)/build
>   	$$(HOST_CONFIGURE_OPTS) \
>   	$$($$(PKG)_CONF_ENV) $$(MESON) \
> +		--pkgconfig.relocatable \
>   		--prefix=$$(HOST_DIR) \
> -		--libdir=lib \
> -		--sysconfdir=$$(HOST_DIR)/etc \
> +		--bindir=$$(HOST_DIR)/bin \

  bindir defaults to "bin", which means things will be installed in <prefix>/bin 
and references to bindir in pkgconfig will use <prefix>/bin absolute paths as 
well (actually, as ${prefix}/bin). How does pkgconfig.relocatable change things 
that we suddenly need to override the default with an absolute path?

> +		--datadir=$$(HOST_DIR)/share \
> +		--includedir=$$(HOST_DIR)/include \
> +		--infodir=$$(HOST_DIR)/share/info \
> +		--libdir=$$(HOST_DIR)/lib \
> +		--libexecdir=$$(HOST_DIR)/libexec \
> +		--localedir=$$(HOST_DIR)/share/locale \
>   		--localstatedir=$$(HOST_DIR)/var \
> +		--mandir=$$(HOST_DIR)/share/man \
> +		--sbindir=$$(HOST_DIR)/sbin \
> +		--sharedstatedir=$$(HOST_DIR)/com \
> +		--sysconfdir=$$(HOST_DIR)/etc \
>   		--default-library=shared \
>   		--buildtype=release \
>   		--wrap-mode=nodownload \
> @@ -179,13 +190,23 @@ $(2)_DEPENDENCIES += host-meson
>   ifndef $(2)_BUILD_CMDS
>   ifeq ($(4),target)
>   define $(2)_BUILD_CMDS
> -	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> -		$$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> +	$$(TARGET_MAKE_ENV) \
> +	$$($$(PKG)_MESON_ENV) \
> +	$$(MESON) \
> +		compile \
> +		$$(MESON_BUILD_OPTS) \
> +		$$(if $$($$(PKG)_NINJA_OPTS),--ninja-args $$($$(PKG)_NINJA_OPTS)) \
> +		-C $$($$(PKG)_SRCDIR)/build
>   endef
>   else
>   define $(2)_BUILD_CMDS
> -	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> -		$$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> +	$$(HOST_MAKE_ENV) \
> +	$$($$(PKG)_MESON_ENV) \
> +	$$(MESON) \
> +		compile \
> +		$$(MESON_BUILD_OPTS) \
> +		$$(if $$($$(PKG)_NINJA_OPTS),--ninja-args $$($$(PKG)_NINJA_OPTS)) \
> +		-C $$($$(PKG)_SRCDIR)/build
>   endef
>   endif
>   endif
> @@ -196,8 +217,12 @@ endif
>   #
>   ifndef $(2)_INSTALL_CMDS
>   define $(2)_INSTALL_CMDS
> -	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> -		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> +	$$(HOST_MAKE_ENV) \
> +	$$($$(PKG)_MESON_ENV) \
> +	$$(MESON) \
> +		install \
> +		$$(MESON_INSTALL_OPTS) \
> +		-C $$($$(PKG)_SRCDIR)/build

  Why is there a --ninja-args in the build but not in the install?

>   endef
>   endif
>   
> @@ -207,8 +232,13 @@ endif
>   #
>   ifndef $(2)_INSTALL_STAGING_CMDS
>   define $(2)_INSTALL_STAGING_CMDS
> -	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
> -		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> +	$$(TARGET_MAKE_ENV) \
> +	$$($$(PKG)_MESON_ENV) \
> +	$$(MESON) \
> +		install \
> +		$$(MESON_INSTALL_OPTS) \
> +		--destdir $$(STAGING_DIR) \
> +		-C $$($$(PKG)_SRCDIR)/build
>   endef
>   endif
>   
> @@ -218,8 +248,13 @@ endif
>   #
>   ifndef $(2)_INSTALL_TARGET_CMDS
>   define $(2)_INSTALL_TARGET_CMDS
> -	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
> -		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> +	$$(TARGET_MAKE_ENV) \
> +	$$($$(PKG)_MESON_ENV) \
> +	$$(MESON) \
> +		install \
> +		$$(MESON_INSTALL_OPTS) \
> +		--destdir $$(TARGET_DIR) \
> +		-C $$($$(PKG)_SRCDIR)/build
>   endef
>   endif
>   
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 47aaddf849..6efc8d636f 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -749,7 +749,7 @@ endef
>   SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_PRESET_ALL
>   
>   SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
> -SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
> +SYSTEMD_MESON_ENV = $(HOST_UTF8_LOCALE_ENV)
>   
>   define SYSTEMD_LINUX_CONFIG_FIXUPS
>   	$(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS)
> @@ -777,10 +777,7 @@ endef
>   HOST_SYSTEMD_CONF_OPTS = \
>   	-Dsplit-bin=true \
>   	-Dsplit-usr=false \
> -	--prefix=/usr \
> -	--libdir=lib \
> -	--sysconfdir=/etc \
> -	--localstatedir=/var \
> +	-Drootprefix=$(HOST_DIR) \

  This change looks like something we can apply independently of the rest of the 
seris as well. It looks like a much better way of handling the special case of 
systemd. However, I'd like a much more detailed explanation about why this works 
now but didn't work in commit 35c11a027c88a3c943554eefbbed051fd2d98a50. That 
commit has an extensive explanation of the reasoning.

  Regards,
  Arnout

>   	-Dmode=release \
>   	-Dutmp=false \
>   	-Dhibernate=false \
> @@ -852,8 +849,6 @@ HOST_SYSTEMD_DEPENDENCIES = \
>   	host-gperf \
>   	host-python-jinja2
>   
> -HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> -
>   # Fix RPATH After installation
>   # * systemd provides a install_rpath instruction to meson because the binaries
>   #   need to link with libsystemd which is not in a standard path
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27  7:15 ` [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages James Hilliard
  2022-07-27  9:00   ` Arnout Vandecappelle
@ 2022-07-27 11:25   ` Yann E. MORIN
  2022-07-27 22:13     ` James Hilliard
  1 sibling, 1 reply; 11+ messages in thread
From: Yann E. MORIN @ 2022-07-27 11:25 UTC (permalink / raw)
  To: James Hilliard
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Thomas De Schampheleire

James, All,

On 2022-07-27 01:15 -0600, James Hilliard spake thusly:
> As of version 0.54.0 meson has had the ability to build and install
> packages rather than having to run ninja directly as before.
[--SNIP--]
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 47aaddf849..6efc8d636f 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
[--SNIP--]
> @@ -777,10 +777,7 @@ endef
>  HOST_SYSTEMD_CONF_OPTS = \
>  	-Dsplit-bin=true \
>  	-Dsplit-usr=false \
> -	--prefix=/usr \
> -	--libdir=lib \
> -	--sysconfdir=/etc \
> -	--localstatedir=/var \
> +	-Drootprefix=$(HOST_DIR) \

Have you read the explanations in 35c11a027c8 (package/systemd: add host
variant)? This change must expand on how it does not break things, with
a very good and detailed commit log, and as a separate patch.

Also, if the HOST_SYSTEMD_FIX_RPATH hook still needed, then?

Regards,
Yann E. MORIN.

>  	-Dutmp=false \
>  	-Dhibernate=false \
> @@ -852,8 +849,6 @@ HOST_SYSTEMD_DEPENDENCIES = \
>  	host-gperf \
>  	host-python-jinja2
>  
> -HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> -
>  # Fix RPATH After installation
>  # * systemd provides a install_rpath instruction to meson because the binaries
>  #   need to link with libsystemd which is not in a standard path
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> 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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27  9:00   ` Arnout Vandecappelle
@ 2022-07-27 18:33     ` James Hilliard
  2022-07-27 19:18       ` Yann E. MORIN
  0 siblings, 1 reply; 11+ messages in thread
From: James Hilliard @ 2022-07-27 18:33 UTC (permalink / raw)
  To: Arnout Vandecappelle
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Yann E . MORIN, Thomas De Schampheleire

On Wed, Jul 27, 2022 at 5:08 AM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 27/07/2022 09:15, James Hilliard wrote:
> > As of version 0.54.0 meson has had the ability to build and install
> > packages rather than having to run ninja directly as before.
> >
> > This will allow us to use features such as meson install tags in
> > the future which require meson to be used for the installation.
> >
> > Note that we've removed FOO_NINJA_ENV which may cause issues
> > in the unlikely event an external package uses it.
> >
> > We need to set --pkgconfig.relocatable so that pkg-config files are
> > not generated with absolute paths which cause issues with per-package
> > directories.
>
>   This still doesn't explain how it is related to using meson rather than ninja.
> Are you saying that when calling ninja directly, PPD work perfectly fine, but if
> it's installed with meson, it doesn't? Then I'd really like to have a little
> more insight into what meson does to break it.

Well, the issue seems to be that without --pkgconfig.relocatable meson install
messes up the paths during install due to generating absolute pkgconfig paths
while ninja doesn't.

>
>   I suspect that the two are actually unrelated, and thus the patches should be
> split.
>
> >
> > Remove conflicting host-systemd paths.
> >
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
>
> [snip]
> > @@ -156,10 +157,20 @@ define $(2)_CONFIGURE_CMDS
> >       mkdir -p $$($$(PKG)_SRCDIR)/build
> >       $$(HOST_CONFIGURE_OPTS) \
> >       $$($$(PKG)_CONF_ENV) $$(MESON) \
> > +             --pkgconfig.relocatable \
> >               --prefix=$$(HOST_DIR) \
> > -             --libdir=lib \
> > -             --sysconfdir=$$(HOST_DIR)/etc \
> > +             --bindir=$$(HOST_DIR)/bin \
>
>   bindir defaults to "bin", which means things will be installed in <prefix>/bin
> and references to bindir in pkgconfig will use <prefix>/bin absolute paths as
> well (actually, as ${prefix}/bin). How does pkgconfig.relocatable change things
> that we suddenly need to override the default with an absolute path?

From my understanding pkgconfig.relocatable tells meson to calculate pkgconf
paths relative to the prefix, so things work when both the prefix and bindir are
set to absolute paths that produce the right relative paths when meson resolves
the paths against each other during pkgconfig generation.

>
> > +             --datadir=$$(HOST_DIR)/share \
> > +             --includedir=$$(HOST_DIR)/include \
> > +             --infodir=$$(HOST_DIR)/share/info \
> > +             --libdir=$$(HOST_DIR)/lib \
> > +             --libexecdir=$$(HOST_DIR)/libexec \
> > +             --localedir=$$(HOST_DIR)/share/locale \
> >               --localstatedir=$$(HOST_DIR)/var \
> > +             --mandir=$$(HOST_DIR)/share/man \
> > +             --sbindir=$$(HOST_DIR)/sbin \
> > +             --sharedstatedir=$$(HOST_DIR)/com \
> > +             --sysconfdir=$$(HOST_DIR)/etc \
> >               --default-library=shared \
> >               --buildtype=release \
> >               --wrap-mode=nodownload \
> > @@ -179,13 +190,23 @@ $(2)_DEPENDENCIES += host-meson
> >   ifndef $(2)_BUILD_CMDS
> >   ifeq ($(4),target)
> >   define $(2)_BUILD_CMDS
> > -     $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> > -             $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> > +     $$(TARGET_MAKE_ENV) \
> > +     $$($$(PKG)_MESON_ENV) \
> > +     $$(MESON) \
> > +             compile \
> > +             $$(MESON_BUILD_OPTS) \
> > +             $$(if $$($$(PKG)_NINJA_OPTS),--ninja-args $$($$(PKG)_NINJA_OPTS)) \
> > +             -C $$($$(PKG)_SRCDIR)/build
> >   endef
> >   else
> >   define $(2)_BUILD_CMDS
> > -     $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> > -             $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> > +     $$(HOST_MAKE_ENV) \
> > +     $$($$(PKG)_MESON_ENV) \
> > +     $$(MESON) \
> > +             compile \
> > +             $$(MESON_BUILD_OPTS) \
> > +             $$(if $$($$(PKG)_NINJA_OPTS),--ninja-args $$($$(PKG)_NINJA_OPTS)) \
> > +             -C $$($$(PKG)_SRCDIR)/build
> >   endef
> >   endif
> >   endif
> > @@ -196,8 +217,12 @@ endif
> >   #
> >   ifndef $(2)_INSTALL_CMDS
> >   define $(2)_INSTALL_CMDS
> > -     $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> > -             $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> > +     $$(HOST_MAKE_ENV) \
> > +     $$($$(PKG)_MESON_ENV) \
> > +     $$(MESON) \
> > +             install \
> > +             $$(MESON_INSTALL_OPTS) \
> > +             -C $$($$(PKG)_SRCDIR)/build
>
>   Why is there a --ninja-args in the build but not in the install?
>
> >   endef
> >   endif
> >
> > @@ -207,8 +232,13 @@ endif
> >   #
> >   ifndef $(2)_INSTALL_STAGING_CMDS
> >   define $(2)_INSTALL_STAGING_CMDS
> > -     $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
> > -             $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> > +     $$(TARGET_MAKE_ENV) \
> > +     $$($$(PKG)_MESON_ENV) \
> > +     $$(MESON) \
> > +             install \
> > +             $$(MESON_INSTALL_OPTS) \
> > +             --destdir $$(STAGING_DIR) \
> > +             -C $$($$(PKG)_SRCDIR)/build
> >   endef
> >   endif
> >
> > @@ -218,8 +248,13 @@ endif
> >   #
> >   ifndef $(2)_INSTALL_TARGET_CMDS
> >   define $(2)_INSTALL_TARGET_CMDS
> > -     $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
> > -             $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> > +     $$(TARGET_MAKE_ENV) \
> > +     $$($$(PKG)_MESON_ENV) \
> > +     $$(MESON) \
> > +             install \
> > +             $$(MESON_INSTALL_OPTS) \
> > +             --destdir $$(TARGET_DIR) \
> > +             -C $$($$(PKG)_SRCDIR)/build
> >   endef
> >   endif
> >
> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index 47aaddf849..6efc8d636f 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> > @@ -749,7 +749,7 @@ endef
> >   SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_PRESET_ALL
> >
> >   SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
> > -SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
> > +SYSTEMD_MESON_ENV = $(HOST_UTF8_LOCALE_ENV)
> >
> >   define SYSTEMD_LINUX_CONFIG_FIXUPS
> >       $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS)
> > @@ -777,10 +777,7 @@ endef
> >   HOST_SYSTEMD_CONF_OPTS = \
> >       -Dsplit-bin=true \
> >       -Dsplit-usr=false \
> > -     --prefix=/usr \
> > -     --libdir=lib \
> > -     --sysconfdir=/etc \
> > -     --localstatedir=/var \
> > +     -Drootprefix=$(HOST_DIR) \
>
>   This change looks like something we can apply independently of the rest of the
> seris as well. It looks like a much better way of handling the special case of
> systemd. However, I'd like a much more detailed explanation about why this works
> now but didn't work in commit 35c11a027c88a3c943554eefbbed051fd2d98a50. That
> commit has an extensive explanation of the reasoning.

Hmm, I'll look into this more.

>
>   Regards,
>   Arnout
>
> >       -Dmode=release \
> >       -Dutmp=false \
> >       -Dhibernate=false \
> > @@ -852,8 +849,6 @@ HOST_SYSTEMD_DEPENDENCIES = \
> >       host-gperf \
> >       host-python-jinja2
> >
> > -HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> > -
> >   # Fix RPATH After installation
> >   # * systemd provides a install_rpath instruction to meson because the binaries
> >   #   need to link with libsystemd which is not in a standard path
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27 18:33     ` James Hilliard
@ 2022-07-27 19:18       ` Yann E. MORIN
  2022-07-28  1:48         ` James Hilliard
  0 siblings, 1 reply; 11+ messages in thread
From: Yann E. MORIN @ 2022-07-27 19:18 UTC (permalink / raw)
  To: James Hilliard
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Thomas De Schampheleire

James, All,

On 2022-07-27 12:33 -0600, James Hilliard spake thusly:
> On Wed, Jul 27, 2022 at 5:08 AM Arnout Vandecappelle <arnout@mind.be> wrote:
> > On 27/07/2022 09:15, James Hilliard wrote:
[--SNIP--]
> > > We need to set --pkgconfig.relocatable so that pkg-config files are
> > > not generated with absolute paths which cause issues with per-package
> > > directories.
> >   This still doesn't explain how it is related to using meson rather than ninja.
> > Are you saying that when calling ninja directly, PPD work perfectly fine, but if
> > it's installed with meson, it doesn't? Then I'd really like to have a little
> > more insight into what meson does to break it.
> Well, the issue seems to be that without --pkgconfig.relocatable meson install
> messes up the paths during install due to generating absolute pkgconfig paths
> while ninja doesn't.

But does that actually causes any real issue and build breakage?

For the non-PPD case, that should not be an issue, as the HOST_DIR (and
STAGING_DIR, below it) are constant throughout the build.

For the PPD case, we have a prepare hook that fixes the paths in all
text files, see b06294e9897e (core/pkg-generic: fixup all PPD paths in a
generic fashion). So this should be covered.

For the SDK, there is a script that does something very similar to the
PPD case, so again there should be no issue.

What is it that you actually want to achieve with relative paths, that
is currently broken with absolute paths?

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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27 11:25   ` Yann E. MORIN
@ 2022-07-27 22:13     ` James Hilliard
  0 siblings, 0 replies; 11+ messages in thread
From: James Hilliard @ 2022-07-27 22:13 UTC (permalink / raw)
  To: Yann E. MORIN
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Thomas De Schampheleire

On Wed, Jul 27, 2022 at 5:25 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2022-07-27 01:15 -0600, James Hilliard spake thusly:
> > As of version 0.54.0 meson has had the ability to build and install
> > packages rather than having to run ninja directly as before.
> [--SNIP--]
> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index 47aaddf849..6efc8d636f 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> [--SNIP--]
> > @@ -777,10 +777,7 @@ endef
> >  HOST_SYSTEMD_CONF_OPTS = \
> >       -Dsplit-bin=true \
> >       -Dsplit-usr=false \
> > -     --prefix=/usr \
> > -     --libdir=lib \
> > -     --sysconfdir=/etc \
> > -     --localstatedir=/var \
> > +     -Drootprefix=$(HOST_DIR) \
>
> Have you read the explanations in 35c11a027c8 (package/systemd: add host
> variant)? This change must expand on how it does not break things, with
> a very good and detailed commit log, and as a separate patch.
>
> Also, if the HOST_SYSTEMD_FIX_RPATH hook still needed, then?

Well I think I did find a way to remove that:
https://patchwork.ozlabs.org/project/buildroot/patch/20220727221055.1838031-1-james.hilliard1@gmail.com/

>
> Regards,
> Yann E. MORIN.
>
> >       -Dutmp=false \
> >       -Dhibernate=false \
> > @@ -852,8 +849,6 @@ HOST_SYSTEMD_DEPENDENCIES = \
> >       host-gperf \
> >       host-python-jinja2
> >
> > -HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
> > -
> >  # Fix RPATH After installation
> >  # * systemd provides a install_rpath instruction to meson because the binaries
> >  #   need to link with libsystemd which is not in a standard path
> > --
> > 2.34.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > 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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages
  2022-07-27 19:18       ` Yann E. MORIN
@ 2022-07-28  1:48         ` James Hilliard
  0 siblings, 0 replies; 11+ messages in thread
From: James Hilliard @ 2022-07-28  1:48 UTC (permalink / raw)
  To: Yann E. MORIN
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Thomas De Schampheleire

On Wed, Jul 27, 2022 at 1:19 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2022-07-27 12:33 -0600, James Hilliard spake thusly:
> > On Wed, Jul 27, 2022 at 5:08 AM Arnout Vandecappelle <arnout@mind.be> wrote:
> > > On 27/07/2022 09:15, James Hilliard wrote:
> [--SNIP--]
> > > > We need to set --pkgconfig.relocatable so that pkg-config files are
> > > > not generated with absolute paths which cause issues with per-package
> > > > directories.
> > >   This still doesn't explain how it is related to using meson rather than ninja.
> > > Are you saying that when calling ninja directly, PPD work perfectly fine, but if
> > > it's installed with meson, it doesn't? Then I'd really like to have a little
> > > more insight into what meson does to break it.
> > Well, the issue seems to be that without --pkgconfig.relocatable meson install
> > messes up the paths during install due to generating absolute pkgconfig paths
> > while ninja doesn't.
>
> But does that actually causes any real issue and build breakage?

Appears to break when using meson's install.

>
> For the non-PPD case, that should not be an issue, as the HOST_DIR (and
> STAGING_DIR, below it) are constant throughout the build.
>
> For the PPD case, we have a prepare hook that fixes the paths in all
> text files, see b06294e9897e (core/pkg-generic: fixup all PPD paths in a
> generic fashion). So this should be covered.
>
> For the SDK, there is a script that does something very similar to the
> PPD case, so again there should be no issue.
>
> What is it that you actually want to achieve with relative paths, that
> is currently broken with absolute paths?

Looks like the relocatable format works fine without meson's install:
https://patchwork.ozlabs.org/project/buildroot/patch/20220728014402.142320-2-james.hilliard1@gmail.com/

Although the cmake prefix fix is also needed:
https://patchwork.ozlabs.org/project/buildroot/patch/20220728014402.142320-1-james.hilliard1@gmail.com/

>
> 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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR
  2022-07-27  7:15 [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR James Hilliard
  2022-07-27  7:15 ` [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages James Hilliard
@ 2022-08-07 13:54 ` Thomas Petazzoni via buildroot
  2022-08-08  7:15   ` James Hilliard
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-07 13:54 UTC (permalink / raw)
  To: James Hilliard
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Yann E . MORIN, Thomas De Schampheleire

Hello James,

On Wed, 27 Jul 2022 01:15:56 -0600
James Hilliard <james.hilliard1@gmail.com> wrote:

> This doesn't appear to be required and seems to break for packages
> using meson's pkgconfig.relocatable format.

Thanks for your contribution. However, if you want us to merge this can
of contribution needs much, much, much better commit logs and
explanations.

An explanation that starts with "this doesn't appear to be required"
and continues with "seems to break" is the opposite of a convincing
explanation.

Here is the sort of commit log that we need:

"""
Defining PKG_CONFIG_SYSROOT_DIR in the CMake toolchain file is not
needed because it is already passed...

In addition, passing this in the CMake toolchain file causes breakage
of the following defconfig, once meson's pkgconfig.relocatable is
enabled, with the following failure:

[...]

This failure occurs because ...
"""

Note: I agree that passing PKG_CONFIG_SYSROOT_DIR in the CMake
toolchain file is probably not needed because our pkg-config wrapper
already passes the right value. However, I fail to see how that can
make a difference. How something in the CMake toolchain file can affect
the build of Meson based packages?

We very much appreciate all the improvements you are submitting, many
of them are very relevant and very useful. However, to have them
merged, we need detailed and convincing argumentation, no vague commit
logs that seem to indicate the change is actually papering over a
problem rather than addressing it for real.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR
  2022-08-07 13:54 ` [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR Thomas Petazzoni via buildroot
@ 2022-08-08  7:15   ` James Hilliard
  2022-08-12  5:08     ` James Hilliard
  0 siblings, 1 reply; 11+ messages in thread
From: James Hilliard @ 2022-08-08  7:15 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Yann E . MORIN, Thomas De Schampheleire

On Sun, Aug 7, 2022 at 7:54 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello James,
>
> On Wed, 27 Jul 2022 01:15:56 -0600
> James Hilliard <james.hilliard1@gmail.com> wrote:
>
> > This doesn't appear to be required and seems to break for packages
> > using meson's pkgconfig.relocatable format.
>
> Thanks for your contribution. However, if you want us to merge this can
> of contribution needs much, much, much better commit logs and
> explanations.
>
> An explanation that starts with "this doesn't appear to be required"
> and continues with "seems to break" is the opposite of a convincing
> explanation.
>
> Here is the sort of commit log that we need:
>
> """
> Defining PKG_CONFIG_SYSROOT_DIR in the CMake toolchain file is not
> needed because it is already passed...
>
> In addition, passing this in the CMake toolchain file causes breakage
> of the following defconfig, once meson's pkgconfig.relocatable is
> enabled, with the following failure:
>
> [...]
>
> This failure occurs because ...
> """
>
> Note: I agree that passing PKG_CONFIG_SYSROOT_DIR in the CMake
> toolchain file is probably not needed because our pkg-config wrapper
> already passes the right value. However, I fail to see how that can
> make a difference. How something in the CMake toolchain file can affect
> the build of Meson based packages?

I think it's an issue with how it interacts with meson's pkg-config prefix in
relocatable mode AFAIU, seems cmake wasn't setting the prefix correctly,
which generally only seemed to cause issues with PKG_CONFIG_SYSROOT_DIR
from what I could tell.

I recall someone mentioned PKG_CONFIG_SYSROOT_DIR was needed for
external toolchains or something along those lines so I came up with
an alternative
approach to avoid removing PKG_CONFIG_SYSROOT_DIR.

>
> We very much appreciate all the improvements you are submitting, many
> of them are very relevant and very useful. However, to have them
> merged, we need detailed and convincing argumentation, no vague commit
> logs that seem to indicate the change is actually papering over a
> problem rather than addressing it for real.

This was superseded by:
https://patchwork.ozlabs.org/project/buildroot/patch/20220728014402.142320-1-james.hilliard1@gmail.com/
https://patchwork.ozlabs.org/project/buildroot/patch/20220728014402.142320-2-james.hilliard1@gmail.com/

I separated the pkg-config and relocatable format change out from the ninja
to meson build/install migration.

>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR
  2022-08-08  7:15   ` James Hilliard
@ 2022-08-12  5:08     ` James Hilliard
  0 siblings, 0 replies; 11+ messages in thread
From: James Hilliard @ 2022-08-12  5:08 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Eric Le Bihan, Samuel Martin, Sen Hastings, buildroot,
	Norbert Lange, Yann E . MORIN, Thomas De Schampheleire

On Mon, Aug 8, 2022 at 1:15 AM James Hilliard <james.hilliard1@gmail.com> wrote:
>
> On Sun, Aug 7, 2022 at 7:54 AM Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> >
> > Hello James,
> >
> > On Wed, 27 Jul 2022 01:15:56 -0600
> > James Hilliard <james.hilliard1@gmail.com> wrote:
> >
> > > This doesn't appear to be required and seems to break for packages
> > > using meson's pkgconfig.relocatable format.
> >
> > Thanks for your contribution. However, if you want us to merge this can
> > of contribution needs much, much, much better commit logs and
> > explanations.
> >
> > An explanation that starts with "this doesn't appear to be required"
> > and continues with "seems to break" is the opposite of a convincing
> > explanation.
> >
> > Here is the sort of commit log that we need:
> >
> > """
> > Defining PKG_CONFIG_SYSROOT_DIR in the CMake toolchain file is not
> > needed because it is already passed...
> >
> > In addition, passing this in the CMake toolchain file causes breakage
> > of the following defconfig, once meson's pkgconfig.relocatable is
> > enabled, with the following failure:
> >
> > [...]
> >
> > This failure occurs because ...
> > """
> >
> > Note: I agree that passing PKG_CONFIG_SYSROOT_DIR in the CMake
> > toolchain file is probably not needed because our pkg-config wrapper
> > already passes the right value. However, I fail to see how that can
> > make a difference. How something in the CMake toolchain file can affect
> > the build of Meson based packages?
>
> I think it's an issue with how it interacts with meson's pkg-config prefix in
> relocatable mode AFAIU, seems cmake wasn't setting the prefix correctly,
> which generally only seemed to cause issues with PKG_CONFIG_SYSROOT_DIR
> from what I could tell.
>
> I recall someone mentioned PKG_CONFIG_SYSROOT_DIR was needed for
> external toolchains or something along those lines so I came up with
> an alternative
> approach to avoid removing PKG_CONFIG_SYSROOT_DIR.

Oh, it was apparently needed by external builds using the SDK, see:
https://lore.kernel.org/buildroot/23a6eba2-06fd-8579-9815-214b3656daf7@mind.be/

>
> >
> > We very much appreciate all the improvements you are submitting, many
> > of them are very relevant and very useful. However, to have them
> > merged, we need detailed and convincing argumentation, no vague commit
> > logs that seem to indicate the change is actually papering over a
> > problem rather than addressing it for real.
>
> This was superseded by:
> https://patchwork.ozlabs.org/project/buildroot/patch/20220728014402.142320-1-james.hilliard1@gmail.com/

I avoided removing PKG_CONFIG_SYSROOT_DIR due to the SDK issue.

> https://patchwork.ozlabs.org/project/buildroot/patch/20220728014402.142320-2-james.hilliard1@gmail.com/
>
> I separated the pkg-config and relocatable format change out from the ninja
> to meson build/install migration.
>
> >
> > Thanks!
> >
> > Thomas
> > --
> > Thomas Petazzoni, co-owner and CEO, Bootlin
> > Embedded Linux and Kernel engineering and training
> > https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-12  5:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27  7:15 [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR James Hilliard
2022-07-27  7:15 ` [Buildroot] [PATCH v5 2/2] package/pkg-meson: use meson to build/install packages James Hilliard
2022-07-27  9:00   ` Arnout Vandecappelle
2022-07-27 18:33     ` James Hilliard
2022-07-27 19:18       ` Yann E. MORIN
2022-07-28  1:48         ` James Hilliard
2022-07-27 11:25   ` Yann E. MORIN
2022-07-27 22:13     ` James Hilliard
2022-08-07 13:54 ` [Buildroot] [PATCH v5 1/2] support/misc/toolchainfile.cmake.in: don't set PKG_CONFIG_SYSROOT_DIR Thomas Petazzoni via buildroot
2022-08-08  7:15   ` James Hilliard
2022-08-12  5:08     ` James Hilliard

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.