Skip to content

fix(text): improve app-local ICU loading on Linux - #23879

Draft
ajpinedam wants to merge 4 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/icu-linux-load
Draft

fix(text): improve app-local ICU loading on Linux#23879
ajpinedam wants to merge 4 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/icu-linux-load

Conversation

@ajpinedam

@ajpinedam ajpinedam commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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.Runtime package 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.cs now resolves ICU in this order:

  1. .NET's app-local ICU configuration — honors the System.Globalization.AppLocalIcu switch / DOTNET_SYSTEM_GLOBALIZATION_APPLOCALICU env var ([suffix:]version format, same precedence as CoreLib), loading libicudata before libicuuc (the MS binaries have no rpath and major-only sonames). Custom-suffixed builds are supported by wiring the suffix into native symbol lookup.
  2. icuuc — the existing unversioned attempt, unchanged.
  3. Directory scan — probes AppContext.BaseDirectory, runtimes/linux*/native, and the assembly directory for fully-versioned libicuuc.so.* files and loads the best candidate by absolute path (with its libicudata sibling first). This makes "copy the ICU package files next to the app" work even without the runtime switch.
  4. Versioned name probe libicuuc.so.[100..50] — the existing last resort, unchanged.

Additionally:

  • Version detection now accepts an unversioned u_getVersion export (ICU built with --disable-renaming) and reads the version from the library itself.
  • On failure, the exception now reports the AppLocalIcu state, each probed directory with the 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.
  • Docs: libicu added 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:

  • Runtime matrix on Linux containers: system ICU only / app-local with switch / app-local without switch / no ICU (diagnostics output)
  • Address remaining code-review follow-ups (guard the file-version parse against a bare libicuuc.so match; surface configured-AppLocalIcu load failures in the diagnostics)

PR Checklist ✅

🤖 Generated with Claude Code

@github-actions github-actions Bot added area/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation labels Jul 26, 2026
@unodevops

Copy link
Copy Markdown
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

@unodevops

Copy link
Copy Markdown
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

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224166 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_Enumeration.png
    • ImageIconPage.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Buttons.png
    • ClipboardTests.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
  • skia-windows-screenshots: 2348 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png
    • AppBarButtonWithIconTest.png
    • ApplicationViewSizing.png-dark
    • ArcSegment.png-dark
    • AppWindowPositionAndSize.png
    • AuthenticationBroker_Demo.png
    • Attributed_text_FontSize_Changing.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutomationPropertiesExtensions_Role.png
    • AutoSuggestBox_Icons.png
    • AutoSuggestBox_SoftKeboard.png
    • BasicAutoSuggestBox.png-dark
    • BasicThemeResources.png
    • Battery.png-dark
    • BitmapIcon_Sizing.png-dark
    • BenchmarkDotNet.png
    • Border_AntiAlias.png
    • BorderBottomwithmargins.png
    • Border_BorderThickness.png-dark
    • BorderCenteredwithmargins.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with loading icuuc

3 participants