* [PATCH] gn: Add recipe
@ 2025-09-27 5:49 Khem Raj
2025-09-27 6:27 ` [OE-core] " Peter Kjellerstedt
2025-09-29 11:14 ` Mathieu Dubois-Briand
0 siblings, 2 replies; 4+ messages in thread
From: Khem Raj @ 2025-09-27 5:49 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
gn is a commonly used build tool to generate ninja files, used
in a lot of recipes e.g. chromium, qtwebengine, perfetto, hafnium etc.
these recipes come from different layers e.g. meta-qt6/meta-arm/meta-oe
since not all layers depend on meta-oe ( meta-arm does not ), its not
a possible option.
Given the usecases, putting it in core will benefit the ecosystem
and reduce some duplication. This recipe is taken from meta-arm
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/conf/distro/include/maintainers.inc | 1 +
meta/recipes-devtools/gn/gn_git.bb | 46 ++++++++++++++++++++++++
2 files changed, 47 insertions(+)
create mode 100644 meta/recipes-devtools/gn/gn_git.bb
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 0988bf50a72..85a9914469b 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -224,6 +224,7 @@ RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj <raj.khem@gmail.com>"
RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>"
RECIPE_MAINTAINER:pn-glslang = "Jose Quaresma <quaresma.jose@gmail.com>"
+RECIPE_MAINTAINER:pn-gn = "Khem Raj <raj.khem@gmail.com>"
RECIPE_MAINTAINER:pn-gnome-desktop-testing = "Ross Burton <ross.burton@arm.com>"
RECIPE_MAINTAINER:pn-gnu-config = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER:pn-gnu-efi = "Yi Zhao <yi.zhao@windriver.com>"
diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb
new file mode 100644
index 00000000000..abc81a9549f
--- /dev/null
+++ b/meta/recipes-devtools/gn/gn_git.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GN is a meta-build system that generates build files for Ninja"
+DEPENDS += "ninja-native"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
+
+UPSTREAM_CHECK_COMMITS = "1"
+
+SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
+SRCREV = "4ce861fc06ec87ff74eb6a17ebbd55e4755ebdeb"
+PV = "0+git"
+
+B = "${WORKDIR}/build"
+
+# Map from our _OS strings to the GN's platform values.
+def gn_platform(variable, d):
+ os = d.getVar(variable)
+ if "linux" in os:
+ return "linux"
+ elif "mingw" in os:
+ return "mingw"
+ else:
+ return os
+
+do_configure[cleandirs] += "${B}"
+do_configure() {
+ python3 ${S}/build/gen.py \
+ --platform=${@gn_platform("TARGET_OS", d)} \
+ --out-path=${B} \
+ --no-static-libstdc++ \
+ --no-strip
+}
+
+do_compile() {
+ ninja -C ${B} --verbose
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install ${B}/gn ${D}${bindir}
+}
+
+BBCLASSEXTEND = "native"
+
+COMPATIBLE_HOST = "^(?!riscv32).*"
+CFLAGS += "-Wno-error=maybe-uninitialized"
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [OE-core] [PATCH] gn: Add recipe
2025-09-27 5:49 [PATCH] gn: Add recipe Khem Raj
@ 2025-09-27 6:27 ` Peter Kjellerstedt
2025-09-29 11:14 ` Mathieu Dubois-Briand
1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2025-09-27 6:27 UTC (permalink / raw)
To: raj.khem@gmail.com, openembedded-core@lists.openembedded.org
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Khem Raj via lists.openembedded.org
> Sent: den 27 september 2025 07:49
> To: openembedded-core@lists.openembedded.org
> Cc: Khem Raj <raj.khem@gmail.com>
> Subject: [OE-core] [PATCH] gn: Add recipe
>
> gn is a commonly used build tool to generate ninja files, used
> in a lot of recipes e.g. chromium, qtwebengine, perfetto, hafnium etc.
> these recipes come from different layers e.g. meta-qt6/meta-arm/meta-oe
>
> since not all layers depend on meta-oe ( meta-arm does not ), its not
> a possible option.
>
> Given the usecases, putting it in core will benefit the ecosystem
> and reduce some duplication. This recipe is taken from meta-arm
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/conf/distro/include/maintainers.inc | 1 +
> meta/recipes-devtools/gn/gn_git.bb | 46 ++++++++++++++++++++++++
> 2 files changed, 47 insertions(+)
> create mode 100644 meta/recipes-devtools/gn/gn_git.bb
>
> diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> index 0988bf50a72..85a9914469b 100644
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -224,6 +224,7 @@ RECIPE_MAINTAINER:pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
> RECIPE_MAINTAINER:pn-glibc-testsuite = "Khem Raj <raj.khem@gmail.com>"
> RECIPE_MAINTAINER:pn-gmp = "Khem Raj <raj.khem@gmail.com>"
> RECIPE_MAINTAINER:pn-glslang = "Jose Quaresma <quaresma.jose@gmail.com>"
> +RECIPE_MAINTAINER:pn-gn = "Khem Raj <raj.khem@gmail.com>"
> RECIPE_MAINTAINER:pn-gnome-desktop-testing = "Ross Burton <ross.burton@arm.com>"
> RECIPE_MAINTAINER:pn-gnu-config = "Robert Yang <liezhi.yang@windriver.com>"
> RECIPE_MAINTAINER:pn-gnu-efi = "Yi Zhao <yi.zhao@windriver.com>"
> diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb
> new file mode 100644
> index 00000000000..abc81a9549f
> --- /dev/null
> +++ b/meta/recipes-devtools/gn/gn_git.bb
> @@ -0,0 +1,46 @@
> +SUMMARY = "GN is a meta-build system that generates build files for Ninja"
> +DEPENDS += "ninja-native"
> +
> +LICENSE = "BSD-3-Clause"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
> +
> +UPSTREAM_CHECK_COMMITS = "1"
> +
> +SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
> +SRCREV = "4ce861fc06ec87ff74eb6a17ebbd55e4755ebdeb"
> +PV = "0+git"
> +
> +B = "${WORKDIR}/build"
> +
> +# Map from our _OS strings to the GN's platform values.
> +def gn_platform(variable, d):
> + os = d.getVar(variable)
> + if "linux" in os:
> + return "linux"
> + elif "mingw" in os:
> + return "mingw"
> + else:
> + return os
> +
> +do_configure[cleandirs] += "${B}"
> +do_configure() {
> + python3 ${S}/build/gen.py \
> + --platform=${@gn_platform("TARGET_OS", d)} \
> + --out-path=${B} \
> + --no-static-libstdc++ \
> + --no-strip
> +}
> +
Add do_compile[progress] to catch the progress info from ninja:
do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
> +do_compile() {
> + ninja -C ${B} --verbose
> +}
> +
> +do_install() {
> + install -d ${D}${bindir}
> + install ${B}/gn ${D}${bindir}
> +}
> +
> +BBCLASSEXTEND = "native"
> +
> +COMPATIBLE_HOST = "^(?!riscv32).*"
> +CFLAGS += "-Wno-error=maybe-uninitialized"
//Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH] gn: Add recipe
2025-09-27 5:49 [PATCH] gn: Add recipe Khem Raj
2025-09-27 6:27 ` [OE-core] " Peter Kjellerstedt
@ 2025-09-29 11:14 ` Mathieu Dubois-Briand
2025-09-29 15:41 ` Khem Raj
1 sibling, 1 reply; 4+ messages in thread
From: Mathieu Dubois-Briand @ 2025-09-29 11:14 UTC (permalink / raw)
To: raj.khem, openembedded-core
On Sat Sep 27, 2025 at 7:49 AM CEST, Khem Raj via lists.openembedded.org wrote:
> gn is a commonly used build tool to generate ninja files, used
> in a lot of recipes e.g. chromium, qtwebengine, perfetto, hafnium etc.
> these recipes come from different layers e.g. meta-qt6/meta-arm/meta-oe
>
> since not all layers depend on meta-oe ( meta-arm does not ), its not
> a possible option.
>
> Given the usecases, putting it in core will benefit the ecosystem
> and reduce some duplication. This recipe is taken from meta-arm
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
Hi Khem,
It looks like the build is failing on some x86 builds:
ERROR: gn-0+git-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/x86-64-v3-poky-linux-musl/gn/0+git/temp/run.do_compile.3308486' failed with exit code 1
...
| cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]
https://autobuilder.yoctoproject.org/valkyrie/#/builders/3/builds/2524
https://autobuilder.yoctoproject.org/valkyrie/#/builders/6/builds/2489
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/2307
https://autobuilder.yoctoproject.org/valkyrie/#/builders/59/builds/2467
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH] gn: Add recipe
2025-09-29 11:14 ` Mathieu Dubois-Briand
@ 2025-09-29 15:41 ` Khem Raj
0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2025-09-29 15:41 UTC (permalink / raw)
To: Mathieu Dubois-Briand; +Cc: openembedded-core
On Mon, Sep 29, 2025 at 4:15 AM Mathieu Dubois-Briand
<mathieu.dubois-briand@bootlin.com> wrote:
>
> On Sat Sep 27, 2025 at 7:49 AM CEST, Khem Raj via lists.openembedded.org wrote:
> > gn is a commonly used build tool to generate ninja files, used
> > in a lot of recipes e.g. chromium, qtwebengine, perfetto, hafnium etc.
> > these recipes come from different layers e.g. meta-qt6/meta-arm/meta-oe
> >
> > since not all layers depend on meta-oe ( meta-arm does not ), its not
> > a possible option.
> >
> > Given the usecases, putting it in core will benefit the ecosystem
> > and reduce some duplication. This recipe is taken from meta-arm
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
>
> Hi Khem,
>
> It looks like the build is failing on some x86 builds:
>
> ERROR: gn-0+git-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/x86-64-v3-poky-linux-musl/gn/0+git/temp/run.do_compile.3308486' failed with exit code 1
> ...
> | cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/3/builds/2524
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/6/builds/2489
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/2307
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/59/builds/2467
>
yeah, please checkout v3, I sent earlier today
> Thanks,
> Mathieu
>
> --
> Mathieu Dubois-Briand, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-29 15:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-27 5:49 [PATCH] gn: Add recipe Khem Raj
2025-09-27 6:27 ` [OE-core] " Peter Kjellerstedt
2025-09-29 11:14 ` Mathieu Dubois-Briand
2025-09-29 15:41 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox