* [Buildroot] [PATCH] package/harfbuzz: fix race during compilation
@ 2026-11-06 13:54 Michael Nosthoff via buildroot
0 siblings, 0 replies; only message in thread
From: Michael Nosthoff via buildroot @ 2026-11-06 13:54 UTC (permalink / raw)
To: buildroot; +Cc: Giulio Benetti
[0] changed the order of generating the shader headers. This introduced
a race condition during build. Sometimes the headers are not in place
when the gpu objects are compiled.
This patch introduces a dependency on the headers in the meson build.
The issue landed in buildroot when the bump to Harfbuzz 14.0.0 happened
Fixes:
https://autobuild.buildroot.org/results/c6d/c6d2cd8550a63efab728135f3d5d4c5b022ebf7d//
Fixes: 2fb10c689c ("package/harfbuzz: bump version to 14.0.0")
[0] https://github.com/harfbuzz/harfbuzz/commit/b1ad797e501310bf020bb419d8ce5c8e56a0c346
Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
---
| 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 package/harfbuzz/0002-meson-fix-GPU-shader-header-generation-race.patch
--git a/package/harfbuzz/0002-meson-fix-GPU-shader-header-generation-race.patch b/package/harfbuzz/0002-meson-fix-GPU-shader-header-generation-race.patch
new file mode 100644
index 0000000000..0ad26069dc
--- /dev/null
+++ b/package/harfbuzz/0002-meson-fix-GPU-shader-header-generation-race.patch
@@ -0,0 +1,53 @@
+From: Michael Nosthoff <buildroot@heine.tech>
+Subject: [PATCH] meson: order GPU compilation after shader header generation
+
+The shader header custom targets are built by default, but their outputs
+are not included in the sources of libharfbuzz-gpu. This allows Ninja to
+compile the GPU sources concurrently with shader header generation.
+
+The generator also copies each generated header into the source directory.
+The GPU sources use quoted includes, which find these source-tree copies
+first. Since the copy truncates its destination before writing, a compiler
+running concurrently can read an empty header and report undeclared shader
+symbols.
+
+Collect the shader header targets and add them to the GPU library sources.
+Meson then orders compilation after those targets have completed, including
+their copies back into the source tree.
+
+Keep the existing build-by-default behavior unchanged.
+
+Fixes: b1ad797 ("[gpu] Commit stringized shader headers; auto-regenerate like ragel")
+
+Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
+Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
+
+Upstream: https://github.com/harfbuzz/harfbuzz/pull/6590
+
+---
+ src/meson.build | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/meson.build b/src/meson.build
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -851,8 +851,9 @@ hb_gpu_shader_sources = [
+ ]
+
+ hb_gpu_shader_helper = find_program('gen-gpu-shader-artifacts.py')
++hb_gpu_shader_headers = []
+ foreach p: hb_gpu_shader_sources
+- custom_target('@0@'.format(p.get(1)),
++ hb_gpu_shader_headers += custom_target('@0@'.format(p.get(1)),
+ build_by_default: true,
+ input: p.get(0),
+ output: p.get(1),
+@@ -877,6 +878,7 @@ if not get_option('gpu').disabled()
+
+ libharfbuzz_gpu = library('harfbuzz-gpu',
+ hb_gpu_sources,
++ hb_gpu_shader_headers,
+ include_directories: incconfig,
+ dependencies: gpu_deps,
+ link_with: [libharfbuzz],
+
--
2.53.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-06 13:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 13:54 [Buildroot] [PATCH] package/harfbuzz: fix race during compilation Michael Nosthoff via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox