fix(libharfbuzz): forward hb_icu_get_unicode_funcs to the bundled hb-icu.cc #28781
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28781"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by NobleBrains on 2026-12-03T16:04:48Z.
What
hb_icu_get_unicode_funcsused a hand-copied version of HarfBuzz's ICU glue inBuffer.cpp.harfbuzz_backendnow builds the bundledhb-icu.ccwithHAVE_ICUand the project'sicu_common, and the export forwards to it. The copied code and its licence notice are removed.hb-icu.ccneedsuscript_getCode, socmake/Icu.cmakealso builds ICU'suscript.cpp. Every target that linksharfbuzz_backendnow linksicu_commontoo; besides libharfbuzz these are eight HarfBuzz test targets.GuestHarfBuzzBuffer.cppchecks more combining classes, scripts, mirrored characters, compositions and decompositions, including a singleton and a pair outside the BMP.Tested
The tests ran on
bc7ea0d802, before the latest merge ofmain.mainhas not changed libharfbuzz,cmake/Icu.cmakeorGuestHarfBuzzBuffer.cppsince then.ctest -R harfbuzzpasses 19/19.libcdid not compile without it:ctest -R harfbuzzpasses 19/19.4938328997merged intomain). Thewindowsjob links the HarfBuzz test executables and passes 6325/6325 tests, includingguest_harfbuzz_buffer_properties, which has the new checks. Not run locally.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01GtiotZ92uvDBp76KjCvueG
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T16:10:09Z.
Review: COMMENTED
Reviewed — no blocking findings
The five changed files show the intended ICU forwarding and coverage, but I could not verify the bundled HarfBuzz ICU implementation at this head.
What I ran
Reviewed head
4938328997017c905421c23cd468564f877cab4cusingrepo_read.pyand the prepared review materials. I inspected the changed files and relevant callers; no build or tests were run. The author reports 19/19 HarfBuzz tests passing on an earlier revision, before the latest merge ofmain.Results
Negative control
Not run; no test was run.
Findings
Blocking
None.
Non-blocking
None.
Sources
hb_icu_get_unicode_funcs()in Buffer.cpp.hb-icu.cc, enablesHAVE_ICU, and links ICU in CMakeLists.txt;uscript.cppis added in Icu.cmake.Not verified
The reader could not access
3rdparty/harfbuzz/src/hb-icu.ccbecause it is inside a submodule. Its implementation and linkage behavior were therefore not independently confirmed. Windows behavior and tests on this exact head were also not verified. All five changed files listed as reviewed infiles.jsonwere included in the review; no files were listed as excluded.To get this to a good state
Nothing is required. Optional: confirm the bundled HarfBuzz ICU implementation and run the relevant checks on this head, including Windows.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T16:15:15Z.
Review: COMMENTED
The updated HarfBuzz and ICU libraries built on Linux. All three HarfBuzz buffer CTests passed, including the expanded Unicode properties cases for script, mirroring, composition, and decomposition.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T16:16:13Z.
Review: COMMENTED
Actionable comments
core/libs/prx/libharfbuzz/Buffer.cpp, lines68· 🩺 Stability & Availability · 💤 Low valuehb_icu_get_unicode_funcs()builds its tables on first use. Its lazy loader storesunorm2_getNFCInstance(&icu_err)and then runsassert(user_data)without checkingicu_err. If ICU returns no NFC instance, the pointer is null and the assertion fires. In a build where assertions are active, the process aborts.CreateIcuFunctionspath reported the same failure by callingNotImplemented_nid_no_patch, which throwsstd::runtime_error. The delegated path changes that failure from a catchable exception to an abort.NDEBUGforharfbuzz_backend. Assertions therefore stay active unless the build type definesNDEBUG, as CMake's default Release flags do.core/libs/prx/libharfbuzz/Buffer.cpp:68: callunorm2_getNFCInstancewith a localUErrorCode, and ifU_FAILUREholds, callNotImplemented_nid_no_patchwith the same message as before. Do this before callinghb_icu_get_unicode_funcs(). Re-add any includes this check needs.46c43c27-5da1-475e-874c-a921b6c83f7eReviewing files that changed from the base of the PR and between
9d362fb088and4938328997.cmake/Icu.cmakecore/libs/prx/libharfbuzz/Buffer.cppcore/libs/prx/libharfbuzz/CMakeLists.txtcore/libs/tests/GuestHarfBuzzBuffer.cppdocs/dev/debt/changes/fix-harfbuzz-icu-unicode-funcs.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T12:50:43Z.
Review: APPROVED
Verified on Windows 11 with WinLibs GCC 15.2.0 r7 (Release). I used a tree at
main63b98e5bf8(plus two unrelated commits of mine in libc and a LibreSSL test), with this PR applied together with #28881, #28810, #28806, #28776 and #28781, which touch separate files. I ran everystrict_nid_filter,guest_audiodec*,guest_np_manager*,guest_np_reachabilityand HarfBuzz test (31): all pass before the change, and all pass in 3 of 3 runs with it.That fills the "Windows: not run locally" gap. The reconfigure and the build of
harfbuzz_backendwithhb-icu.ccand ICU'suscript.cppsucceed with WinLibs GCC 15.2, andguest_harfbuzz_buffer_propertieswith the new checks passes in 3 of 3 runs.As a control, I reverted
cmake/Icu.cmake,Buffer.cppandlibharfbuzz/CMakeLists.txttomainand kept the new test checks.guest_harfbuzz_buffer_propertiespasses there too. So the hand-copied glue already gave the same answers for these inputs, and the change is a move to the upstream code rather than a behaviour fix the tests can detect.Not run: a title.
AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.