classes/meson: use ninja explicitly when compiling
PATCH 1/3 classes/meson: use ninja explicitly when compiling
"meson compile" is essentially a glorified wrapper around calling ninja that doesn't support all of the options that ninja does, so calling it directly means builds are fractionally faster and we get direct control over the flags that ninja is passed.
A longer rationale can be found in the Gentoo change by Eli Schwartz that caused this patch, who is both a Gentoo and Meson developer:
https://github.com/gentoo/gentoo/commit/66011abd663671947fe07835f0d9cc360f5de317
The only change is that the compile target doesn't support the optional convenience target type, but this is rarely used.
--- meta/classes-recipe/meson.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/meson.bbclass +1 -1
@@ -180,7 +180,7 @@ meson_do_configure() { do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" meson_do_compile() { - meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET} + ninja --verbose ${PARALLEL_MAKE} ${MESON_TARGET} } meson_do_install() {
Signature · 1 line
2.43.0
PATCH 2/3 systemd-systemctl-native: update MESON_TARGET for direct ninja use
We can't specify the target type now that the Meson class calls ninja directly, so drop it. This doesn't change what is built.
--- meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb +1 -1
@@ -8,7 +8,7 @@ DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native" inherit pkgconfig meson native -MESON_TARGET = "systemctl:executable" +MESON_TARGET = "systemctl" MESON_INSTALL_TAGS = "systemctl" EXTRA_OEMESON += "-Dlink-systemctl-shared=false" EXTRA_OEMESON += "-Dsysvinit-path= -Dsysvrcnd-path="
Signature · 1 line
2.43.0
PATCH 3/3 systemd-systemctl-native: remove systemd-sysv-install logic
In reply to Ross BurtonThe use of systemd-sysv-install was removed before Wrynose[1], so we do not need to install it in systemd-systemctl-native.
[1] oe-core d9ec9e20eeb ("systemd: Stop supporting sysvinit compatibility")
--- .../systemd/systemd-systemctl-native_259.5.bb | 9 --------- 1 file changed, 9 deletions(-)
meta/recipes-core/systemd/systemd-systemctl-native_259.5.bb +0 -9
@@ -17,12 +17,3 @@ EXTRA_OEMESON += "-Dsysvinit-path= -Dsysvrcnd-path=" # determined at run-time, but rather set during configure # More details are here https://github.com/systemd/systemd/issues/35897#issuecomment-2665405887 EXTRA_OEMESON += "--sysconfdir ${sysconfdir_native}" - -do_install:append() { - # Install systemd-sysv-install in /usr/bin rather than /usr/lib/systemd - # (where it is normally installed) so systemctl can find it in $PATH. - # It is expected that the use of systemd-sysv-install will be removed - # with version 259 of systemd and then this, and everything that was - # added along with it, should be reverted. - install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${bindir}/systemd-sysv-install -}
Signature · 1 line
2.43.0
Quoted 25 lines · Ross Burton via lists.openembedded.org
"meson compile" is essentially a glorified wrapper around calling ninja that doesn't support all of the options that ninja does, so calling it directly means builds are fractionally faster and we get direct control over the flags that ninja is passed.
A longer rationale can be found in the Gentoo change by Eli Schwartz that caused this patch, who is both a Gentoo and Meson developer:
https://github.com/gentoo/gentoo/commit/66011abd663671947fe07835f0d9cc360f5de317
The only change is that the compile target doesn't support the optional convenience target type, but this is rarely used.
Signed-off-by Ross Burton <[email protected]>--- meta/classes-recipe/meson.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes-recipe/meson.bbclass +0
-0
meta/classes-recipe/meson.bbclass meson_do_configure() { · line 183
Quoted 5 lines
meta/classes-recipe/meson.bbclass +1
-1@@ -180,7 +180,7 @@ meson_do_configure() { do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" meson_do_compile() { - meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET} + ninja --verbose ${PARALLEL_MAKE}
Like cmake verbose could be a configurable knob since its being added by this patch
${MESON_TARGET}
Quoted 18 lines
meta/classes-recipe/meson.bbclass +0
-1} meson_do_install() { --2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#239785):
https://lists.openembedded.org/g/openembedded-core/message/239785
Mute This Topic: https://lists.openembedded.org/mt/120030899/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 1 line · Khem Raj
Like cmake verbose could be a configurable knob since its being added by this patch
-v was already an option, but I’m a bit meh on adding options to make the logs useful.
Ross
Sometimes they can make non trivial difference in compile time of they are large projects
Quoted 8 lines · Ross Burton
Quoted 1 line · Khem Raj
Like cmake verbose could be a configurable knob since its being added by
this patch
-v was already an option, but I’m a bit meh on adding options to make the logs useful.
Ross
Quoted 23 lines · Ross Burton via lists.openembedded.org
"meson compile" is essentially a glorified wrapper around calling ninja that doesn't support all of the options that ninja does, so calling it directly means builds are fractionally faster and we get direct control over the flags that ninja is passed.
A longer rationale can be found in the Gentoo change by Eli Schwartz that caused this patch, who is both a Gentoo and Meson developer:
https://github.com/gentoo/gentoo/commit/66011abd663671947fe07835f0d9cc360f5de317
The only change is that the compile target doesn't support the optional convenience target type, but this is rarely used.
Signed-off-by Ross Burton <[email protected]>--- meta/classes-recipe/meson.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes-recipe/meson.bbclass +0
-0
meta/classes-recipe/meson.bbclass meson_do_configure() { · line 186
Quoted 8 lines
meta/classes-recipe/meson.bbclass +1
-1@@ -180,7 +180,7 @@ meson_do_configure() { do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" meson_do_compile() { - meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET} + ninja --verbose ${PARALLEL_MAKE} ${MESON_TARGET} } meson_do_install() {
Hi Ross, Hi Daniel,
I just note this this patch is conflicting with the one from Daniel [1], as it does use 'MESON_TARGET = "systemd-hwdb:executable"'. Depending on which patch is merged first, the other might have to be rebased and fixed.
[1]: https://lore.kernel.org/all/[email protected]/
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 41 lines · Mathieu Dubois-Briand
Quoted 28 lines · Ross Burton via lists.openembedded.org
"meson compile" is essentially a glorified wrapper around calling ninja
that doesn't support all of the options that ninja does, so calling it
directly means builds are fractionally faster and we get direct control
over the flags that ninja is passed.A longer rationale can be found in the Gentoo change by Eli Schwartz
that caused this patch, who is both a Gentoo and Meson developer:The only change is that the compile target doesn't support the optional
convenience target type, but this is rarely used.Signed-off-by Ross Burton <[email protected]>---
meta/classes-recipe/meson.bbclass | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)meta/classes- renamed from meta/classes-recipe/meson.bbclass +0
-0recipe/meson.bbclass
index9bed293603c..a4643591103100644meta/classes-recipe/meson.bbclass +0
-0@@ -180,7 +180,7 @@ meson_do_configure() {Quoted 8 lines
do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"meson_do_compile(){
- meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET} + ninja --verbose ${PARALLEL_MAKE} ${MESON_TARGET} }
meson_do_install(){Hi Ross, Hi Daniel,
Quoted 7 lines
I just note this this patch is conflicting with the one from Daniel [1],
as it does use 'MESON_TARGET= "systemd-hwdb:executable"'. Depending on
which patch is merged first, the other might have to be rebased and fixed.
Do you know why is conflicting? the systemd patch doesn't touch meson.bbclass
Is is a different format expected for MESON_TARGET content?
Daniel
Quoted 8 lines
[1]:
Thanks,
Mathieu--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
Quoted 50 lines · Daniel Turull
Quoted 41 lines · Mathieu Dubois-Briand
Quoted 28 lines · Ross Burton via lists.openembedded.org
"meson compile" is essentially a glorified wrapper around calling ninja
that doesn't support all of the options that ninja does, so calling it
directly means builds are fractionally faster and we get direct control
over the flags that ninja is passed.A longer rationale can be found in the Gentoo change by Eli Schwartz
that caused this patch, who is both a Gentoo and Meson developer:The only change is that the compile target doesn't support the optional
convenience target type, but this is rarely used.Signed-off-by Ross Burton <[email protected]>---
meta/classes-recipe/meson.bbclass | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)meta/classes- renamed from meta/classes-recipe/meson.bbclass +0
-0recipe/meson.bbclass
index9bed293603c..a4643591103100644meta/classes-recipe/meson.bbclass +0
-0@@ -180,7 +180,7 @@ meson_do_configure() {Quoted 8 lines
do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"meson_do_compile(){
- meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET} + ninja --verbose ${PARALLEL_MAKE} ${MESON_TARGET} }
meson_do_install(){Hi Ross, Hi Daniel,
Quoted 7 lines
I just note this this patch is conflicting with the one from Daniel [1],
as it does use 'MESON_TARGET= "systemd-hwdb:executable"'. Depending on
which patch is merged first, the other might have to be rebased and fixed.
Quoted 5 lines
Do you know why is conflicting? the systemd patch doesn't touch meson.bbclass
Is is a different format expected for
MESON_TARGETcontent?
I do not have all the context, I bet Ross knows better. But you can have a look at patch 2 in this series (systemd-systemctl-native: update MESON_TARGET for direct ninja use) for part of the explanation.
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 4 lines · Daniel Turull
Do you know why is conflicting? the systemd patch doesn't touch meson.bbclass
Is is a different format expected for
MESON_TARGETcontent?
Yes, the :executable suffix is a meson-specific tag (for disambiguation) that isn’t needed when invoking ninja targets directly.
Ross
Quoted 5 lines · Ross Burton
Quoted 3 lines · Daniel Turull
Do you know why is conflicting? the systemd patch doesn't touch meson.bbclass
Quoted 7 lines
Quoted 1 line
Is is a different format expected for
MESON_TARGETcontent?Yes, the :executable suffix is a meson-specific tag (for disambiguation) that isn’t needed when invoking ninja targets directly.
Ross
Ok. I can rebase my patch on top of Ross with only of the change. Then you can pick any of version that applies.
Daniel
Quoted 13 lines · Daniel Turull
Quoted 12 lines · Ross Burton
Quoted 4 lines · Daniel Turull
Do you know why is conflicting? the systemd patch doesn't touch meson.bbclass
Is is a different format expected for
MESON_TARGETcontent?Yes, the :executable suffix is a meson-specific tag (for disambiguation) that isn’t needed when invoking ninja targets directly.
Quoted 6 lines
Quoted 1 line
Ross
Ok. I can rebase my patch on top of Ross with only of the change. Then you can pick any of version that applies.
Daniel
I see that my patches are already in master-next. should I resend them?
Daniel