All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool
@ 2019-05-03 13:18 Norbert Lange
  2019-05-03 13:18 ` [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool Norbert Lange
  2019-05-03 16:57 ` [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Peter Seiderer
  0 siblings, 2 replies; 8+ messages in thread
From: Norbert Lange @ 2019-05-03 13:18 UTC (permalink / raw)
  To: buildroot

From: Norbert Lange <nolange79@gmail.com>

Automatically check for an available meson tool,
and use it aslond the version is fitting.

Some concerns are about being able to figure out the
correct version for all available packages in buildroot.
The min version could be set to version 1.0 to postpone the
problem, but still have the infrastructure in place
to allow users to override the version.

Currently host-ninja will still be always built.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
 package/meson/meson.mk                   |  1 -
 package/pkg-meson.mk                     |  4 +--
 support/dependencies/check-host-meson.mk | 16 +++++++++
 support/dependencies/check-host-meson.sh | 45 ++++++++++++++++++++++++
 4 files changed, 63 insertions(+), 3 deletions(-)
 create mode 100644 support/dependencies/check-host-meson.mk
 create mode 100755 support/dependencies/check-host-meson.sh

diff --git a/package/meson/meson.mk b/package/meson/meson.mk
index cf62b0ddde..2ce7a26ab5 100644
--- a/package/meson/meson.mk
+++ b/package/meson/meson.mk
@@ -10,7 +10,6 @@ MESON_LICENSE = Apache-2.0
 MESON_LICENSE_FILES = COPYING
 MESON_SETUP_TYPE = setuptools

-HOST_MESON_DEPENDENCIES = host-ninja
 HOST_MESON_NEEDS_HOST_PYTHON = python3

 HOST_MESON_TARGET_ENDIAN = $(call LOWERCASE,$(BR2_ENDIAN))
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 7f1838c09a..25e9bb814e 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -25,7 +25,7 @@
 # $(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
+MESON		= PYTHONNOUSERSITE=y $(BR2_MESON)
 NINJA		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/ninja
 NINJA_OPTS	= $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)

@@ -105,7 +105,7 @@ endef
 endif
 endif

-$(2)_DEPENDENCIES += host-meson
+$(2)_DEPENDENCIES += $(BR2_MESON_HOST_DEPENDENCY)

 #
 # Build step. Only define it if not already defined by the package .mk
diff --git a/support/dependencies/check-host-meson.mk b/support/dependencies/check-host-meson.mk
new file mode 100644
index 0000000000..6c779b3e6d
--- /dev/null
+++ b/support/dependencies/check-host-meson.mk
@@ -0,0 +1,16 @@
+# Set this to either 0.49 or higher, depending on the highest minimum
+# version required by any of the packages bundled in Buildroot. If a
+# package is bumped or a new one added, and it requires a higher
+# version, our meson infra will catch it and build its own.
+#
+BR2_MESON_VERSION_MIN = 0.49
+
+BR2_MESON_CANDIDATES ?= meson
+BR2_MESON ?= $(call suitable-host-package,meson,\
+	$(BR2_MESON_VERSION_MIN) $(BR2_MESON_CANDIDATES))
+ifeq ($(BR2_MESON),)
+BR2_MESON = $(HOST_DIR)/bin/meson
+BR2_MESON_HOST_DEPENDENCY = host-meson host-ninja
+else
+BR2_MESON_HOST_DEPENDENCY = host-ninja
+endif
diff --git a/support/dependencies/check-host-meson.sh b/support/dependencies/check-host-meson.sh
new file mode 100755
index 0000000000..805fac9349
--- /dev/null
+++ b/support/dependencies/check-host-meson.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# prevent shift error
+[ $# -lt 2 ] && exit 1
+
+split_version() {
+    local VARPREFIX
+    local NUMBERS
+    local major
+    local minor
+
+    VARPREFIX=$1
+    NUMBERS=$2
+
+    major=${NUMBERS%%\.*}
+    NUMBERS=${NUMBERS#$major}; NUMBERS=${NUMBERS#\.}
+    minor=${NUMBERS%%\.*}
+    NUMBERS=${NUMBERS#$minor}; NUMBERS=${NUMBERS#\.}
+
+    # ensure that missing values are 0
+    eval "${VARPREFIX}_major=\$major; ${VARPREFIX}_minor=\$((minor + 0)); ${VARPREFIX}_bugfix=\$((NUMBERS + 0));"
+}
+
+split_version req "$1"
+
+shift
+
+for candidate; do
+
+    # Try to locate the candidate. Discard it if not located.
+    meson=$(which "${candidate}" 2>/dev/null)
+    [ -n "${meson}" ] || continue
+
+    split_version cur "$("${meson}" --version)"
+
+    [ -n "${cur_major}" -a "${cur_major}" -ge "${req_major}" ] || continue
+    [ "${cur_major}" -gt "${req_major}" ] || [ "${cur_minor}" -ge "${req_minor}" ] || continue
+    [ "${cur_minor}" -gt "${req_minor}" ] || [ "${cur_bugfix}" -ge "${req_bugfix}" ] || continue
+
+    echo "${meson}"
+    exit
+done
+
+# echo nothing: no suitable meson found
+exit 1
--
2.20.1

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

* [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool
  2019-05-03 13:18 [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Norbert Lange
@ 2019-05-03 13:18 ` Norbert Lange
  2019-05-07 21:00   ` Thomas Petazzoni
  2019-05-03 16:57 ` [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Peter Seiderer
  1 sibling, 1 reply; 8+ messages in thread
From: Norbert Lange @ 2019-05-03 13:18 UTC (permalink / raw)
  To: buildroot

From: Norbert Lange <nolange79@gmail.com>

If a fitting ninja tool is detected it will be used,
otherwise the tool will be built from source.

Replace the fixed dependencies to host-ninja,
notably from the meson infrastructure.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
 package/pkg-meson.mk                     |  2 +-
 support/dependencies/check-host-meson.mk |  4 +--
 support/dependencies/check-host-ninja.mk | 14 ++++++++
 support/dependencies/check-host-ninja.sh | 45 ++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 3 deletions(-)
 create mode 100644 support/dependencies/check-host-ninja.mk
 create mode 100755 support/dependencies/check-host-ninja.sh

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 25e9bb814e..c4cf682ee8 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -26,7 +26,7 @@
 # $HOME/.local/lib/python3.x/site-packages
 #
 MESON		= PYTHONNOUSERSITE=y $(BR2_MESON)
-NINJA		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/ninja
+NINJA		= PYTHONNOUSERSITE=y $(BR2_NINJA)
 NINJA_OPTS	= $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)

 ################################################################################
diff --git a/support/dependencies/check-host-meson.mk b/support/dependencies/check-host-meson.mk
index 6c779b3e6d..36fc9129d1 100644
--- a/support/dependencies/check-host-meson.mk
+++ b/support/dependencies/check-host-meson.mk
@@ -10,7 +10,7 @@ BR2_MESON ?= $(call suitable-host-package,meson,\
 	$(BR2_MESON_VERSION_MIN) $(BR2_MESON_CANDIDATES))
 ifeq ($(BR2_MESON),)
 BR2_MESON = $(HOST_DIR)/bin/meson
-BR2_MESON_HOST_DEPENDENCY = host-meson host-ninja
+BR2_MESON_HOST_DEPENDENCY = host-meson $(BR2_NINJA_HOST_DEPENDENCY)
 else
-BR2_MESON_HOST_DEPENDENCY = host-ninja
+BR2_MESON_HOST_DEPENDENCY = $(BR2_NINJA_HOST_DEPENDENCY)
 endif
diff --git a/support/dependencies/check-host-ninja.mk b/support/dependencies/check-host-ninja.mk
new file mode 100644
index 0000000000..6d89255ee5
--- /dev/null
+++ b/support/dependencies/check-host-ninja.mk
@@ -0,0 +1,14 @@
+# Set this to either 1.8.2 or higher, depending on the highest minimum
+# version required by any of the packages bundled in Buildroot. If a
+# package is bumped or a new one added, and it requires a higher
+# version, our ninja infra will catch it and build its own.
+#
+BR2_NINJA_VERSION_MIN = 1.8.0
+
+BR2_NINJA_CANDIDATES ?= ninja
+BR2_NINJA ?= $(call suitable-host-package,ninja,\
+	$(BR2_NINJA_VERSION_MIN) $(BR2_NINJA_CANDIDATES))
+ifeq ($(BR2_NINJA),)
+BR2_NINJA = $(HOST_DIR)/bin/ninja
+BR2_NINJA_HOST_DEPENDENCY = host-ninja
+endif
diff --git a/support/dependencies/check-host-ninja.sh b/support/dependencies/check-host-ninja.sh
new file mode 100755
index 0000000000..7f531da98e
--- /dev/null
+++ b/support/dependencies/check-host-ninja.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# prevent shift error
+[ $# -lt 2 ] && exit 1
+
+split_version() {
+    local VARPREFIX
+    local NUMBERS
+    local major
+    local minor
+
+    VARPREFIX=$1
+    NUMBERS=$2
+
+    major=${NUMBERS%%\.*}
+    NUMBERS=${NUMBERS#$major}; NUMBERS=${NUMBERS#\.}
+    minor=${NUMBERS%%\.*}
+    NUMBERS=${NUMBERS#$minor}; NUMBERS=${NUMBERS#\.}
+
+    # ensure that missing values are 0
+    eval "${VARPREFIX}_major=\$major; ${VARPREFIX}_minor=\$((minor + 0)); ${VARPREFIX}_bugfix=\$((NUMBERS + 0));"
+}
+
+split_version req "$1"
+
+shift
+
+for candidate; do
+
+    # Try to locate the candidate. Discard it if not located.
+    ninja=$(which "${candidate}" 2>/dev/null)
+    [ -n "${ninja}" ] || continue
+
+    split_version cur "$("${ninja}" --version)"
+
+    [ -n "${cur_major}" -a "${cur_major}" -ge "${req_major}" ] || continue
+    [ "${cur_major}" -gt "${req_major}" ] || [ "${cur_minor}" -ge "${req_minor}" ] || continue
+    [ "${cur_minor}" -gt "${req_minor}" ] || [ "${cur_bugfix}" -ge "${req_bugfix}" ] || continue
+
+    echo "${ninja}"
+    exit
+done
+
+# echo nothing: no suitable ninja found
+exit 1
--
2.20.1

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

* [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool
  2019-05-03 13:18 [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Norbert Lange
  2019-05-03 13:18 ` [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool Norbert Lange
@ 2019-05-03 16:57 ` Peter Seiderer
  2019-05-03 19:21   ` Norbert Lange
  2019-05-07 20:56   ` Thomas Petazzoni
  1 sibling, 2 replies; 8+ messages in thread
From: Peter Seiderer @ 2019-05-03 16:57 UTC (permalink / raw)
  To: buildroot

Hello Norbert,

appreciating every patch which speeds up the buildroot build process ;-),
but some nits, one minor comments and one major concern, see below...

On Fri,  3 May 2019 15:18:50 +0200, Norbert Lange <nolange79@gmail.com> wrote:

> From: Norbert Lange <nolange79@gmail.com>
>
> Automatically check for an available meson tool,
> and use it aslond the version is fitting.

s/aslond/as long/

>
> Some concerns are about being able to figure out the
> correct version for all available packages in buildroot.
> The min version could be set to version 1.0 to postpone the

You mean 1.0 to disable host meson usage?

> problem, but still have the infrastructure in place
> to allow users to override the version.
>
> Currently host-ninja will still be always built.
>
> Signed-off-by: Norbert Lange <nolange79@gmail.com>
> ---
>  package/meson/meson.mk                   |  1 -
>  package/pkg-meson.mk                     |  4 +--
>  support/dependencies/check-host-meson.mk | 16 +++++++++
>  support/dependencies/check-host-meson.sh | 45 ++++++++++++++++++++++++
>  4 files changed, 63 insertions(+), 3 deletions(-)
>  create mode 100644 support/dependencies/check-host-meson.mk
>  create mode 100755 support/dependencies/check-host-meson.sh
>
> diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> index cf62b0ddde..2ce7a26ab5 100644
> --- a/package/meson/meson.mk
> +++ b/package/meson/meson.mk
> @@ -10,7 +10,6 @@ MESON_LICENSE = Apache-2.0
>  MESON_LICENSE_FILES = COPYING
>  MESON_SETUP_TYPE = setuptools
>
> -HOST_MESON_DEPENDENCIES = host-ninja
>  HOST_MESON_NEEDS_HOST_PYTHON = python3
>
>  HOST_MESON_TARGET_ENDIAN = $(call LOWERCASE,$(BR2_ENDIAN))
> diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> index 7f1838c09a..25e9bb814e 100644
> --- a/package/pkg-meson.mk
> +++ b/package/pkg-meson.mk
> @@ -25,7 +25,7 @@
>  # $(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
> +MESON		= PYTHONNOUSERSITE=y $(BR2_MESON)
>  NINJA		= PYTHONNOUSERSITE=y $(HOST_DIR)/bin/ninja
>  NINJA_OPTS	= $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
>
> @@ -105,7 +105,7 @@ endef
>  endif
>  endif
>
> -$(2)_DEPENDENCIES += host-meson
> +$(2)_DEPENDENCIES += $(BR2_MESON_HOST_DEPENDENCY)
>
>  #
>  # Build step. Only define it if not already defined by the package .mk
> diff --git a/support/dependencies/check-host-meson.mk b/support/dependencies/check-host-meson.mk
> new file mode 100644
> index 0000000000..6c779b3e6d
> --- /dev/null
> +++ b/support/dependencies/check-host-meson.mk
> @@ -0,0 +1,16 @@
> +# Set this to either 0.49 or higher, depending on the highest minimum
> +# version required by any of the packages bundled in Buildroot. If a
> +# package is bumped or a new one added, and it requires a higher
> +# version, our meson infra will catch it and build its own.
> +#
> +BR2_MESON_VERSION_MIN = 0.49

Needs support for third version number, see latest meson bump to 0.50 and revert, but
0.50.1 worked ([1], [2], [3])...

The major concern is no distribution will ship meson with the still needed
buildroot patch, see [4]...

Regards,
Peter

[1] https://git.buildroot.net/buildroot/commit/?id=114e9dcd28e1001b74689215ec669b8940dc3ea9
[2] https://git.buildroot.net/buildroot/commit/?id=c37b81af64dd8d6729325d8edbe633e6a186bb3d
[3] https://git.buildroot.net/buildroot/commit/?id=70fb5e610761dd6468a058c580acc3d4f81fe547
[4] https://git.buildroot.net/buildroot/tree/package/meson/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch

> +
> +BR2_MESON_CANDIDATES ?= meson
> +BR2_MESON ?= $(call suitable-host-package,meson,\
> +	$(BR2_MESON_VERSION_MIN) $(BR2_MESON_CANDIDATES))
> +ifeq ($(BR2_MESON),)
> +BR2_MESON = $(HOST_DIR)/bin/meson
> +BR2_MESON_HOST_DEPENDENCY = host-meson host-ninja
> +else
> +BR2_MESON_HOST_DEPENDENCY = host-ninja
> +endif
> diff --git a/support/dependencies/check-host-meson.sh b/support/dependencies/check-host-meson.sh
> new file mode 100755
> index 0000000000..805fac9349
> --- /dev/null
> +++ b/support/dependencies/check-host-meson.sh
> @@ -0,0 +1,45 @@
> +#!/bin/sh
> +
> +# prevent shift error
> +[ $# -lt 2 ] && exit 1
> +
> +split_version() {
> +    local VARPREFIX
> +    local NUMBERS
> +    local major
> +    local minor
> +
> +    VARPREFIX=$1
> +    NUMBERS=$2
> +
> +    major=${NUMBERS%%\.*}
> +    NUMBERS=${NUMBERS#$major}; NUMBERS=${NUMBERS#\.}
> +    minor=${NUMBERS%%\.*}
> +    NUMBERS=${NUMBERS#$minor}; NUMBERS=${NUMBERS#\.}
> +
> +    # ensure that missing values are 0
> +    eval "${VARPREFIX}_major=\$major; ${VARPREFIX}_minor=\$((minor + 0)); ${VARPREFIX}_bugfix=\$((NUMBERS + 0));"
> +}
> +
> +split_version req "$1"
> +
> +shift
> +
> +for candidate; do
> +
> +    # Try to locate the candidate. Discard it if not located.
> +    meson=$(which "${candidate}" 2>/dev/null)
> +    [ -n "${meson}" ] || continue
> +
> +    split_version cur "$("${meson}" --version)"
> +
> +    [ -n "${cur_major}" -a "${cur_major}" -ge "${req_major}" ] || continue
> +    [ "${cur_major}" -gt "${req_major}" ] || [ "${cur_minor}" -ge "${req_minor}" ] || continue
> +    [ "${cur_minor}" -gt "${req_minor}" ] || [ "${cur_bugfix}" -ge "${req_bugfix}" ] || continue
> +
> +    echo "${meson}"
> +    exit
> +done
> +
> +# echo nothing: no suitable meson found
> +exit 1
> --
> 2.20.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool
  2019-05-03 16:57 ` [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Peter Seiderer
@ 2019-05-03 19:21   ` Norbert Lange
  2019-05-07 20:56   ` Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Norbert Lange @ 2019-05-03 19:21 UTC (permalink / raw)
  To: buildroot

Am Fr., 3. Mai 2019 um 18:57 Uhr schrieb Peter Seiderer <ps.report@gmx.net>:
>
> Hello Norbert,
>
> appreciating every patch which speeds up the buildroot build process ;-),
> but some nits, one minor comments and one major concern, see below...
>
> On Fri,  3 May 2019 15:18:50 +0200, Norbert Lange <nolange79@gmail.com> wrote:
>
> > From: Norbert Lange <nolange79@gmail.com>
> >
> > Automatically check for an available meson tool,
> > and use it aslond the version is fitting.
>
> s/aslond/as long/

Ack

> >
> > Some concerns are about being able to figure out the
> > correct version for all available packages in buildroot.
> > The min version could be set to version 1.0 to postpone the
>
> You mean 1.0 to disable host meson usage?

Yes, so meson is always built like it is now,
if this is too critical to enable by default.

> > problem, but still have the infrastructure in place
> > to allow users to override the version.
> >
> > Currently host-ninja will still be always built.
> >
> > Signed-off-by: Norbert Lange <nolange79@gmail.com>
> > ---
> >  package/meson/meson.mk                   |  1 -
> >  package/pkg-meson.mk                     |  4 +--
> >  support/dependencies/check-host-meson.mk | 16 +++++++++
> >  support/dependencies/check-host-meson.sh | 45 ++++++++++++++++++++++++
> >  4 files changed, 63 insertions(+), 3 deletions(-)
> >  create mode 100644 support/dependencies/check-host-meson.mk
> >  create mode 100755 support/dependencies/check-host-meson.sh
> >
> > diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> > index cf62b0ddde..2ce7a26ab5 100644
> > --- a/package/meson/meson.mk
> > +++ b/package/meson/meson.mk
> > @@ -10,7 +10,6 @@ MESON_LICENSE = Apache-2.0
> >  MESON_LICENSE_FILES = COPYING
> >  MESON_SETUP_TYPE = setuptools
> >
> > -HOST_MESON_DEPENDENCIES = host-ninja
> >  HOST_MESON_NEEDS_HOST_PYTHON = python3
> >
> >  HOST_MESON_TARGET_ENDIAN = $(call LOWERCASE,$(BR2_ENDIAN))
> > diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> > index 7f1838c09a..25e9bb814e 100644
> > --- a/package/pkg-meson.mk
> > +++ b/package/pkg-meson.mk
> > @@ -25,7 +25,7 @@
> >  # $(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
> > +MESON                = PYTHONNOUSERSITE=y $(BR2_MESON)
> >  NINJA                = PYTHONNOUSERSITE=y $(HOST_DIR)/bin/ninja
> >  NINJA_OPTS   = $(if $(VERBOSE),-v) -j$(PARALLEL_JOBS)
> >
> > @@ -105,7 +105,7 @@ endef
> >  endif
> >  endif
> >
> > -$(2)_DEPENDENCIES += host-meson
> > +$(2)_DEPENDENCIES += $(BR2_MESON_HOST_DEPENDENCY)
> >
> >  #
> >  # Build step. Only define it if not already defined by the package .mk
> > diff --git a/support/dependencies/check-host-meson.mk b/support/dependencies/check-host-meson.mk
> > new file mode 100644
> > index 0000000000..6c779b3e6d
> > --- /dev/null
> > +++ b/support/dependencies/check-host-meson.mk
> > @@ -0,0 +1,16 @@
> > +# Set this to either 0.49 or higher, depending on the highest minimum
> > +# version required by any of the packages bundled in Buildroot. If a
> > +# package is bumped or a new one added, and it requires a higher
> > +# version, our meson infra will catch it and build its own.
> > +#
> > +BR2_MESON_VERSION_MIN = 0.49
>
> Needs support for third version number, see latest meson bump to 0.50 and revert, but
> 0.50.1 worked ([1], [2], [3])...

There is support for up to 3 version components in
support/dependencies/check-host-meson.sh

>
> The major concern is no distribution will ship meson with the still needed
> buildroot patch, see [4]...

Ok, news to me.
Whats the practical effect though, does rpath even work if you
relocated buildroot?
Is it necessary if you set LD_LIBRARY_PATH?
(From my personal experience I was never happy with RPATH).

>
> Regards,
> Peter

Regards, Norbert

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

* [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool
  2019-05-03 16:57 ` [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Peter Seiderer
  2019-05-03 19:21   ` Norbert Lange
@ 2019-05-07 20:56   ` Thomas Petazzoni
  2019-05-08  9:38     ` Norbert Lange
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2019-05-07 20:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 3 May 2019 18:57:21 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> The major concern is no distribution will ship meson with the still needed
> buildroot patch, see [4]...

Indeed, that makes it impractical/impossible to use a system-provided
meson. If we want to get there at some point, the
0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch patch needs to
be upstreamed in a form or another.

Best regards,

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

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

* [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool
  2019-05-03 13:18 ` [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool Norbert Lange
@ 2019-05-07 21:00   ` Thomas Petazzoni
  2019-05-08  9:49     ` Norbert Lange
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2019-05-07 21:00 UTC (permalink / raw)
  To: buildroot

Hello Norbert,

On Fri,  3 May 2019 15:18:51 +0200
Norbert Lange <nolange79@gmail.com> wrote:

> From: Norbert Lange <nolange79@gmail.com>
> 
> If a fitting ninja tool is detected it will be used,
> otherwise the tool will be built from source.
> 
> Replace the fixed dependencies to host-ninja,
> notably from the meson infrastructure.
> 
> Signed-off-by: Norbert Lange <nolange79@gmail.com>

Since host-meson cannot be changed to use the system-provided meson, as
discussed with Peter Seiderer on PATCH 1/2, I don't think it's really
worth doing the effort for host-ninja, which requires the same thing as
host-meson: a host Python interpreter.

I think the approaches to reduce the build time are:

 - Make sure we only need to build one of host-python or host-python3,
   and not both. This is what J?rg Krause is proposing in
   http://patchwork.ozlabs.org/patch/1047119/.

 - Or perhaps, try to go one step further, and see if we can use the
   system-provided Python instead of a Python built by Buildroot. But
   that would only work if the system provides Python 3, since Meson
   requires Python 3.

> diff --git a/support/dependencies/check-host-ninja.mk b/support/dependencies/check-host-ninja.mk
> new file mode 100644
> index 0000000000..6d89255ee5
> --- /dev/null
> +++ b/support/dependencies/check-host-ninja.mk
> @@ -0,0 +1,14 @@
> +# Set this to either 1.8.2 or higher, depending on the highest minimum
> +# version required by any of the packages bundled in Buildroot. If a
> +# package is bumped or a new one added, and it requires a higher
> +# version, our ninja infra will catch it and build its own.

I know this comment is in other .mk files in the same directory, but it
doesn't make any sense. There is no such thing as a "ninja infra" in
Buildroot, and there is nothing that will "catch it" and build its own.
If we forget to update BR2_NINJA_VERSION_MIN to the oldest Ninja
version that is acceptable by all packages using Ninja in Buildroot, we
will never notice until a user hits the problem.

Best regards,

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

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

* [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool
  2019-05-07 20:56   ` Thomas Petazzoni
@ 2019-05-08  9:38     ` Norbert Lange
  0 siblings, 0 replies; 8+ messages in thread
From: Norbert Lange @ 2019-05-08  9:38 UTC (permalink / raw)
  To: buildroot

Am Di., 7. Mai 2019 um 22:56 Uhr schrieb Thomas Petazzoni
<thomas.petazzoni@bootlin.com>:
>
> Hello,
>
> On Fri, 3 May 2019 18:57:21 +0200
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > The major concern is no distribution will ship meson with the still needed
> > buildroot patch, see [4]...
>
> Indeed, that makes it impractical/impossible to use a system-provided
> meson. If we want to get there at some point, the
> 0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch patch needs to
> be upstreamed in a form or another.

I see why you would not want to depend on a system provided meson,
but it does work for target libraries.
So my proposal would be to incorporate the changes now,
with min-version set to a value that always evaluates to false.

So a user like me can enable the system meson easily,
even if its not officially supported or tested.

Norbert

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

* [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool
  2019-05-07 21:00   ` Thomas Petazzoni
@ 2019-05-08  9:49     ` Norbert Lange
  0 siblings, 0 replies; 8+ messages in thread
From: Norbert Lange @ 2019-05-08  9:49 UTC (permalink / raw)
  To: buildroot

Am Di., 7. Mai 2019 um 23:00 Uhr schrieb Thomas Petazzoni
<thomas.petazzoni@bootlin.com>:
>
> Hello Norbert,
>
> On Fri,  3 May 2019 15:18:51 +0200
> Norbert Lange <nolange79@gmail.com> wrote:
>
> > From: Norbert Lange <nolange79@gmail.com>
> >
> > If a fitting ninja tool is detected it will be used,
> > otherwise the tool will be built from source.
> >
> > Replace the fixed dependencies to host-ninja,
> > notably from the meson infrastructure.
> >
> > Signed-off-by: Norbert Lange <nolange79@gmail.com>
>
> Since host-meson cannot be changed to use the system-provided meson, as
> discussed with Peter Seiderer on PATCH 1/2, I don't think it's really
> worth doing the effort for host-ninja, which requires the same thing as
> host-meson: a host Python interpreter.

The effort is already done in the patch and not really a big one. Is
there anything bad about
having some additional requirements matched?
But yes, most of the time is spent building python (twice).

> I think the approaches to reduce the build time are:
>
>  - Make sure we only need to build one of host-python or host-python3,
>    and not both. This is what J?rg Krause is proposing in
>    http://patchwork.ozlabs.org/patch/1047119/.
>
>  - Or perhaps, try to go one step further, and see if we can use the
>    system-provided Python instead of a Python built by Buildroot. But
>    that would only work if the system provides Python 3, since Meson
>    requires Python 3.

maybe add some python-any dependency (resolves to either 2 or 3),
which is enough for bootstrapping host-ninja?

>
> > diff --git a/support/dependencies/check-host-ninja.mk b/support/dependencies/check-host-ninja.mk
> > new file mode 100644
> > index 0000000000..6d89255ee5
> > --- /dev/null
> > +++ b/support/dependencies/check-host-ninja.mk
> > @@ -0,0 +1,14 @@
> > +# Set this to either 1.8.2 or higher, depending on the highest minimum
> > +# version required by any of the packages bundled in Buildroot. If a
> > +# package is bumped or a new one added, and it requires a higher
> > +# version, our ninja infra will catch it and build its own.
>
> I know this comment is in other .mk files in the same directory, but it
> doesn't make any sense. There is no such thing as a "ninja infra" in
> Buildroot, and there is nothing that will "catch it" and build its own.
> If we forget to update BR2_NINJA_VERSION_MIN to the oldest Ninja
> version that is acceptable by all packages using Ninja in Buildroot, we
> will never notice until a user hits the problem.

That's something what your CI builder could catch.
packages break all the time with new compilers and libc's and I think
ninja should be pretty much painless in comparison.
The meta-buildsystems like mesons should be able to check for a matching version
(which might depend on the build, like C++20 modules will need some
features in ninja)

Norbert.

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

end of thread, other threads:[~2019-05-08  9:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-03 13:18 [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Norbert Lange
2019-05-03 13:18 ` [Buildroot] [PATCH 2/2] allow build infrastructure to pick up installed ninja tool Norbert Lange
2019-05-07 21:00   ` Thomas Petazzoni
2019-05-08  9:49     ` Norbert Lange
2019-05-03 16:57 ` [Buildroot] [PATCH 1/2] allow build infrastructure to pick up installed meson tool Peter Seiderer
2019-05-03 19:21   ` Norbert Lange
2019-05-07 20:56   ` Thomas Petazzoni
2019-05-08  9:38     ` Norbert Lange

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.