From d9975020008e70da5e8be8b216a0e0dc2f058264 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 7 Oct 2026 12:55:53 -0600 Subject: [PATCH] [meson] Guard tests for disabled optional libraries (#6335) * [meson] Skip vector tests when vector is disabled The vector budget test was built unconditionally even when vector was explicitly disabled. Its empty dependency supplied neither include paths nor libraries, breaking otherwise valid reduced-feature builds. Skip the vector test directory when the library is disabled. Add a Linux CI build and test pass with vector disabled to cover this configuration. Reproduced the missing hb.h failure on Linux before the fix. The full suite with vector, raster, and GPU disabled passed 229 tests with one skip; all three vector tests passed with vector enabled. Fixes: https://github.com/harfbuzz/harfbuzz/issues/6277 Assisted-by: OpenAI Codex * [ci] Remove extra vector-disabled build pass Keep the fix focused on guarding the vector test directory without adding another build and test pass to the Linux workflow. CI-only change; the previously validated Meson guard is unchanged. Assisted-by: OpenAI Codex * [meson] Guard dependency fuzzers when subset is disabled With experimental APIs enabled, dependency fuzzers referenced libharfbuzz_subset even when the subset library was disabled, causing Meson setup to fail with an unknown-variable error. Require subset support when building the dependency fuzzers and when registering their tests. Full tests with experimental APIs enabled: 92 passed with subset disabled, and 247 passed with subset enabled. Both dependency fuzzers and their 13 tests remain registered in the enabled configuration. Assisted-by: OpenAI Codex --- test/fuzzing/meson.build | 6 +++--- test/vector/meson.build | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/fuzzing/meson.build b/test/fuzzing/meson.build index a84339df8..cab5b2aeb 100644 --- a/test/fuzzing/meson.build +++ b/test/fuzzing/meson.build @@ -73,8 +73,8 @@ foreach file_name : tests set_variable('@0@_exe'.format(test_name.underscorify()), exe) endforeach -# Build depend-related fuzzers only if depend_api is enabled -if conf.get('HB_EXPERIMENTAL_API', 0) == 1 +# Build depend-related fuzzers only if experimental and subset APIs are enabled +if conf.get('HB_EXPERIMENTAL_API', 0) == 1 and not get_option('subset').disabled() foreach file_name : depend_tests test_name = file_name.split('.')[0] @@ -238,7 +238,7 @@ if not get_option('subset').disabled() endforeach endif -if conf.get('HB_EXPERIMENTAL_API', 0) == 1 +if conf.get('HB_EXPERIMENTAL_API', 0) == 1 and not get_option('subset').disabled() if conf.get('HAVE_GLIB', 0) == 1 i = 0 foreach chunk : depend_closure_parity_fonts_glob_chunks diff --git a/test/vector/meson.build b/test/vector/meson.build index dcbf02003..d839f1ded 100644 --- a/test/vector/meson.build +++ b/test/vector/meson.build @@ -1,3 +1,7 @@ +if get_option('vector').disabled() + subdir_done() +endif + run_test = find_program('run-tests.py') test_vector_budget = executable('test-vector-budget', 'test-vector-budget.c',