fix(text): improve app-local ICU loading on Linux - #23879
Draft
ajpinedam wants to merge 4 commits into
Draft
Conversation
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23879/wasm-skia-net9/index.html |
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23879/wasm-skia-net9/index.html |
Contributor
|
The build 224166 found UI Test snapshots differences: Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #23540
PR Type:
🐞 Bugfix
What changed? 🚀
Linux is the only Skia target without a bundled ICU package, so text rendering relies on a system-installed ICU. On minimal/embedded images (the scenario in #23540), no ICU is present and the app dies at startup with an error that doesn't say what was probed or how to fix it. Shipping ICU app-locally didn't help either: the
Microsoft.ICU.ICU4C.Runtimepackage ships only fully-versioned file names (e.g.libicuuc.so.72.1.0.3) that the existing major-only name probing can never find.The Linux loader in
UnicodeText.ICU.skia.csnow resolves ICU in this order:System.Globalization.AppLocalIcuswitch /DOTNET_SYSTEM_GLOBALIZATION_APPLOCALICUenv var ([suffix:]versionformat, same precedence as CoreLib), loadinglibicudatabeforelibicuuc(the MS binaries have no rpath and major-only sonames). Custom-suffixed builds are supported by wiring the suffix into native symbol lookup.icuuc— the existing unversioned attempt, unchanged.AppContext.BaseDirectory,runtimes/linux*/native, and the assembly directory for fully-versionedlibicuuc.so.*files and loads the best candidate by absolute path (with itslibicudatasibling first). This makes "copy the ICU package files next to the app" work even without the runtime switch.libicuuc.so.[100..50]— the existing last resort, unchanged.Additionally:
u_getVersionexport (ICU built with--disable-renaming) and reads the version from the library itself.libicu*files actually found there, the last dlopen error, and remediation guidance (distro package vs app-local ICU) — the previous message could not distinguish "no ICU installed" from "exotic version" from "stale binary", which cost a full round-trip on Issue with loading icuuc #23540.libicuadded to the Linux setup prerequisites and the FrameBuffer trimmed-device list; new Runtime Dependencies section in the Linux publishing doc (distro package names + app-local ICU recipe); new troubleshooting entry in the Skia common-issues page.Validation so far: compile (Uno.UI.Skia, net10.0). Draft until runtime validation on Linux is done:
libicuuc.somatch; surface configured-AppLocalIcu load failures in the diagnostics)PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code