Repository navigation
fix(sdk)!: Imply Skia only on app heads - #25614
Merged
Merged
Conversation
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25614/docs/index.html |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Xiaoy312
force-pushed
the
dev/xygu/20261020/dont-imply-skia-on-libs
branch
from
October 22, 2026 19:08
65a5f47 to
72185a0
Compare
Three tests each spawned dotnet msbuild with their own copy of the same code, with no time limit. The shared runner bounds the run, keeps the first-run banner off stdout, and doesn't let a locked scratch folder hide a test's own failure. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The renderer is the app's choice, but a library also got the implied 'skia' feature, or 'skia' through the legacy 'SkiaRenderer' token that the library template lists. Its package then depended on Uno.WinUI.Composition.Skia and Uno.WinUI.Graphics2DSK, and the generated GlobalStaticResources referenced Graphics2DSK, so every app using it got SkiaSharp, a WebGPU-only one included. Only heads (IsUnoHead) now imply 'skia' or map 'SkiaRenderer' to it. A library that draws with SkiaSharp (SKCanvasElement, Toolkit Skia controls) lists 'Skia'. Related to unoplatform/uno-private#2471 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A library now ignores the legacy SkiaRenderer feature, which the library template lists by default. A library that draws with SkiaSharp then fails to compile with no hint that the fix is to list Skia, so report UNOB0030 while a library lists SkiaRenderer. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The template app takes the same features as its library, so no case could give the head a renderer the library doesn't name. Add a head-only override and check that a WebGPU-only head over a library that names no renderer ships no Skia assembly, managed or native. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Uno.Features.targets tested IsWinAppSdk, which Uno.IsPlatform.props sets before the project body, so it was not set when TargetFramework came from the body. A single-targeted Windows head then got 'skia' implied, with Uno.WinUI.Graphics2DSK and SkiaSharp.Views.WinUI, and 'webgpucanvas' added 'webgpu'. Test the target framework directly. Reported in #25570. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Xiaoy312
force-pushed
the
dev/xygu/20261020/dont-imply-skia-on-libs
branch
from
October 22, 2026 19:19
72185a0 to
96f3902
Compare
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25614/docs/index.html |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
|
ramezgerges
approved these changes
Oct 26, 2026
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
3 of 5 tasks
2 of 5 tasks
This was referenced Nov 12, 2026
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 unoplatform/uno-private#2471
PR Type:
🐞 Bugfix
What changed? 🚀
The Uno.Sdk implied the
Skiafeature on libraries as well as on apps, and mapped the legacySkiaRendererfeature (which theunolibtemplate lists by default) toSkiathere too. So every packed library depended onUno.WinUI.Composition.SkiaandUno.WinUI.Graphics2DSK, and through them on SkiaSharp. The library's generatedGlobalStaticResourcesalso referencedUno.WinUI.Graphics2DSK. Every app using such a library got SkiaSharp, including a WebGPU-only app, which is meant to be SkiaSharp-free. Uno.WindowsCommunityToolkit#248, Uno.ColorCode-Universal#15 and Uno.XamlBehaviors#40 each worked around it by removing the packages in their own build.Uno.Features.targets). Only an app (IsUnoHead) impliesSkiaor mapsSkiaRendererto it. A library that draws with SkiaSharp (SKCanvasElement, theSkiaExtensionsconversions, the Uno Toolkit's Skia controls) listsSkia, and then gets the same packages as before.SkiaRenderer, since it no longer does anything there. The first sign would otherwise be a missing-type error onSKCanvasElement. It can be silenced withNoWarn.skiarendererpassages, the checklist, and which projects the SDK treats as apps), the Uno.Sdk features table, the Skia rendering page,SKCanvasElement, and UNOB0030 in the build error codes.dotnet msbuildlaunching inUno.UI.Tasks.Testsis now one shared helper with a time limit, instead of four copies.Scope. This fixes libraries that don't list
Skia. A library that does list it still depends on SkiaSharp, which is intended, and its DLL still referencesUno.WinUI.Graphics2DSKthrough the generatedGlobalStaticResourceschaining, whether or not it uses it. That part is in the XAML generator and is tracked in #25612.Overlap with #25571. It edits the same lines of
Uno.Features.targets. This PR already covers itsSkiaRenderercase for WinAppSDK-only libraries, and for every library target framework. Its fix for single-targeted WinAppSDK projects (IsWinAppSdk) is separate. Whichever PR lands second has to keep theIsUnoHeadguard. The WinAppSDK rows inGiven_UnoSdkRendererFeaturecatch it if it doesn't.Validation
Given_UnoSdkRendererFeature(Uno.UI.Tasks.Tests, 22 cases) evaluates the in-repo SDK targets for libraries and apps acrossnet10.0,-desktop,-androidand WinAppSDK, and checks the resolvedUnoFeatures, the finalPackageReferenceitems and UNOB0030. 7 cases fail against master's targets. The rest of the suite is unchanged.Uno.Features.targetsas master. I repacked it as-is and with this branch's file, then packed anet10.0;net10.0-desktoplibrary that listsSkiaRendererand has one XAML file:Uno.WinUI,Uno.WinUI.Composition.SkiaandUno.WinUI.Graphics2DSK, and the DLL referencesUno.WinUI.Graphics2DSKUno.WinUIonly, the DLL has no Skia reference, and UNOB0030 is reported-desktop, Release):Uno.UI.Composition.Skia.dll,Uno.WinUI.Graphics2DSK.dll,SkiaSharp.dllandlibSkiaSharp.dllwebgpu.dllstill shipsrun-netcore-mobile-template-tests.ps1,uno53AppWithLibwith a head-onlyUnoHeadFeaturesOverride=WebGpu) asserts that same absence on CI.Breaking change (7.0). A library that uses
SKCanvasElement, theSkiaExtensionsconversions or Toolkit's Skia controls through the impliedSkiafeature, or throughSkiaRenderer, has to listSkia. UNOB0030 and the migration guide say so. Apps on the Uno.Sdk are unchanged. Follow-ups outside this repo: theunolibtemplate can dropSkiaRenderer, and the three downstream workarounds can go once those repos build against an SDK with this change.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code