All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Nosthoff via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
Subject: [Buildroot] [PATCH] package/harfbuzz: fix race during compilation
Date: Fri,  6 Nov 2026 14:54:15 +0100	[thread overview]
Message-ID: <20261106135416.1844554-2-buildroot@heine.tech> (raw)

[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>
---
 ...ix-GPU-shader-header-generation-race.patch | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 package/harfbuzz/0002-meson-fix-GPU-shader-header-generation-race.patch

diff --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

                 reply	other threads:[~2026-11-06 13:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261106135416.1844554-2-buildroot@heine.tech \
    --to=buildroot@buildroot.org \
    --cc=buildroot@heine.tech \
    --cc=giulio.benetti@benettiengineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.