Skip to content

fix(sdk): align Linux SkiaSharp native asset on desktop (backport #23659) - #23663

Merged
agneszitte merged 3 commits into
release/stable/6.6from
mergify/bp/release/stable/6.6/pr-23659
Jul 6, 2026
Merged

agneszitte merged 3 commits into
release/stable/6.6from
mergify/bp/release/stable/6.6/pr-23659

Conversation

@mergify

@mergify mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #23658

PR Type:

🐞 Bugfix

What changed? 🚀

On a Skia Desktop single-project head (net*-desktop), overriding <SkiaSharpVersion> above the version the Uno.Sdk ships did not retarget SkiaSharp.NativeAssets.Linux. Managed SkiaSharp and the Win32/macOS native assets moved to the requested version, but the Linux native libSkiaSharp.so stayed at the transitive floor referenced by the Uno.WinUI.Runtime.Skia.X11 / Uno.WinUI.Runtime.Skia.Linux.FrameBuffer runtime packs — a silent managed/native ABI mismatch that crashed Skia Desktop on Linux at startup (no build or restore diagnostic).

Root cause: the base SkiaSharp package auto-depends on SkiaSharp.NativeAssets.Win32 and .macOS (in every desktop/generic TFM group, at its own version), so those self-align on a managed bump — but it has no SkiaSharp.NativeAssets.Linux dependency in any group (Linux native is opt-in). Meanwhile the Uno.Sdk only injected the Linux native asset for the legacy *.Skia.Linux.FrameBuffer head, never for the modern single-project desktop head. With no top-level reference to bind to, SkiaSharpVersion (and the documented PackageReference Update fallback) had nothing to retarget, so the transitive floor won.

Fix: inject SkiaSharp.NativeAssets.Linux as an implicit package for executable desktop heads — in the same $(_IsExecutable) item group that already pulls the X11/FrameBuffer runtime packs. Because the package is already part of the Uno.Sdk SkiaSharp version group, SkiaSharpVersion now retargets it in one place, making the Using the Skia Desktop docs' promise actually hold, and mirroring both the legacy FrameBuffer head and SkiaSharp's own Win32/macOS behavior. This also aligns the default (non-overridden) case, where the Linux native previously resolved one patch below managed.

Validation:

  • NuGet-resolution repro (root cause + fix mechanism): a minimal Uno.WinUI.Runtime.Skia.X11 6.5.237 + SkiaSharp 4.148.0 project resolves managed + NativeAssets.Win32 + NativeAssets.macOS to 4.148.0 while NativeAssets.Linux stays at 3.119.0, with no restore warning/error. Adding a top-level SkiaSharp.NativeAssets.Linux 4.148.0 reference — exactly what this change injects — realigns it to 4.148.0.
  • Code review: the injection mirrors the existing Uno.Implicit.Packages.ProjectSystem.Legacy.targets pattern, and ImplicitPackagesResolver already routes SkiaSharpVersion into the SkiaSharp group so the injected reference is emitted at the overridden version.
  • The full Uno.Sdk-pack + consumer-restore end-to-end was not run in this environment (heavy Sdk packaging pipeline); happy to run it on request.

Related latent gaps tracked for follow-up (out of scope here to keep the backport minimal): HarfBuzzSharp.NativeAssets.Linux shares the same floor mechanism, and the WebAssembly native asset is structurally similar (managed SkiaSharp has no wasm dependency).

PR Checklist ✅

  • 🧪 Added Runtime/UI tests or a manual sample — build-system (MSBuild targets) change; there is no runtime-test harness for implicit-package resolution, so it is validated via the NuGet-resolution repro above.
  • 📚 Docs updated — the existing Using the Skia Desktop → "Upgrading to a later version of SkiaSharp" guidance becomes accurate with this fix; no doc change required.
  • ❗ Contains NO breaking changes.

This is an automatic backport of pull request #23659 done by [Mergify](https://mergify.com).

MartinZikmund and others added 2 commits July 6, 2026 19:43
The base SkiaSharp package auto-references its Win32/macOS native assets
but not the Linux one, so overriding SkiaSharpVersion on a Skia Desktop
head left SkiaSharp.NativeAssets.Linux at the transitive floor from the
X11/FrameBuffer runtime packs — a silent managed/native mismatch that
crashed Skia Desktop on Linux at startup. Inject it as an implicit
package for executable desktop heads so SkiaSharpVersion retargets it,
mirroring how the legacy FrameBuffer head and SkiaSharp's own Win32/macOS
dependencies already behave.

fixes #23658

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018xXm9Kn9hR9vXncVvjPQnT
(cherry picked from commit a973552)

# Conflicts:
#	src/Uno.Sdk/targets/Uno.Implicit.Packages.ProjectSystem.Desktop.targets
Add a regression check to the Linux template-app job: restore the
net10.0-desktop template head with an overridden SkiaSharpVersion and
assert SkiaSharp.NativeAssets.Linux resolves to the same version as
managed SkiaSharp. Fails before the SDK injection fix, passes after.

refs #23658

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018xXm9Kn9hR9vXncVvjPQnT
(cherry picked from commit 4b8328d)
@mergify mergify Bot added the conflicts Automated merge hit conflicts label Jul 6, 2026
@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of a973552 has failed:

On branch mergify/bp/release/stable/6.6/pr-23659
Your branch is up to date with 'origin/release/stable/6.6'.

You are currently cherry-picking commit a9735520de.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.Sdk/targets/Uno.Implicit.Packages.ProjectSystem.Desktop.targets

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Jul 6, 2026
Keep 6.6's WPF RDP hardware-acceleration RuntimeHostConfigurationOption
alongside the SkiaSharp.NativeAssets.Linux injection backported from #23659.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@agneszitte
agneszitte merged commit 813dd49 into release/stable/6.6 Jul 6, 2026
8 of 11 checks passed
@agneszitte
agneszitte deleted the mergify/bp/release/stable/6.6/pr-23659 branch July 6, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure conflicts Automated merge hit conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants