package/harfbuzz: fix race during compilation
PATCH 1/1 package/harfbuzz: fix race during compilation
[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 <[email protected]>
--- ...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
package/harfbuzz/0002-meson-fix-GPU-shader-header-generation-race.patch new file +53 -0
@@ -0,0 +1,53 @@ +From: Michael Nosthoff <[email protected]> +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 <[email protected]> +Assisted-by: Copilot <[email protected]> + +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], +
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot