Skip to content

Align sample dependency and package prerequisites - #5297

Draft
mattleibow wants to merge 2 commits into
mainfrom
mattleibow-sample-dependency-cleanup
Draft

mattleibow wants to merge 2 commits into
mainfrom
mattleibow-sample-dependency-cleanup

Conversation

@mattleibow

@mattleibow mattleibow commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Give independently generated samples the correct native-asset package identities and exact SkiaSharp/HarfBuzzSharp package-family versions. Keep Uno source bindings in the source-only import without deleting unrelated project references, while each generated Uno app declares its own package prerequisites. Add a NuGet-only transport downloader that preserves other build output. The new Console/DockerConsole HarfBuzz demos and extra-SDK workload provisioning have been removed at the maintainer's request; existing Uno/Gallery HarfBuzz use remains unchanged. No test-runner, solution-format, SDK/workload provisioning, package-source, native, or production API change.

Related issues

None.

Required skia PR

None.

Areas affected

  • Managed API (binding/)
  • Native / C API (externals/skia/src/c, include/c)
  • Generated P/Invoke bindings
  • Native dependency or Skia update (libpng, HarfBuzz, FreeType, zlib, milestone bump, …)
  • Views & integrations (MAUI, Uno, WPF, WinUI, Blazor, …)
  • Rendering output / visual behavior
  • Performance
  • Tests
  • Build, packaging, or CI
  • Documentation or samples

Changes

Public API: None; no native ABI change.

Behavior: Generated native asset references retain their own package IDs rather than becoming the base managed package. Uno source imports preserve sibling project references, and generated Uno dependencies use matching package-family versions. Sample drawing output and TFMs remain unchanged.

Testing

Scope reduction at e43f07a9642d47119ccdee44df8f4ea5edd5ab1f:

  • git diff --check — passed.
  • git diff --exit-code a74f7f9492ddf8696486bffcc7a9f3020ebd7aa8 -- scripts/infra/managed/install-dotnet-workloads.ps1 scripts/azure-templates-jobs-bootstrapper.yml global.json nuget.config samples/Basic/Console/SkiaSharpSample/Program.cs samples/Basic/DockerConsole/SkiaSharpSample/Program.cs samples/Basic/DockerConsole/SkiaSharpSample/SkiaSharpSample.csproj — passed; these files exactly match the original main baseline.
  • dotnet msbuild samples/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj -getProperty:TargetFramework -getItem:ProjectReference — passed; unchanged net10.0, only SkiaSharp and SkiaSharp Linux.NoDependencies project references remain.
  • dotnet cake --target=externals-download --gitBranch=main --verbosity=quiet — passed; native bootstrap only, no package or source changes.
  • dotnet cake --target=samples-generate --previewLabel=pr.5291 --buildNumber=26505.69 --verbosity=quiet — passed against the previously validated matching 41-package cohort staged in this worktree's own output directory.
  • dotnet build samples/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj --nologo -v:q and dotnet run --project samples/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj --no-build -- --output /Users/matthew/.copilot/session-state/ecf3bcae-27d5-4a23-872e-dd6587e3f924/files/e43f07a-source-console.png — passed on macOS ARM64 using repository SDK 10.0.401; rendered an 800 x 600 PNG without HarfBuzz output.
  • dotnet build output/samples-preview/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj -p:RestoreAdditionalProjectSources="$PWD/output/nugets" --nologo -v:q and dotnet run --project output/samples-preview/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj --no-build -- --output /Users/matthew/.copilot/session-state/ecf3bcae-27d5-4a23-872e-dd6587e3f924/files/e43f07a-package-console.png — passed; rendered an 800 x 600 PNG byte-identical to the source-mode result. Resolved source/generated dependency graphs contain no HarfBuzz managed/native packages.
  • pwsh -NoLogo -NoProfile -File ./run.ps1 from output/samples-preview/Basic/DockerConsole with matching packages staged — passed on Linux ARM64; existing .NET 10 Docker launcher rendered an 800 x 600 PNG without HarfBuzz output. Only this sample's staged packages were cleaned; no Docker prune.
  • Latest-head CI is not claimed green. Shared-main failure repair remains deferred to the separate fix-owning session as directed by the maintainer; no shared tests or GPU policy were changed or repeatedly rerun.

Earlier validation of the unchanged prerequisite fixes before the scope reduction:

  • dotnet cake --target=nuget-download --gitBranch=main --verbosity=quiet — passed; 41 promoted packages, output/native/ and generated samples retained.
  • dotnet build output/samples-preview/Basic/Console/SkiaSharpSample/SkiaSharpSample.csproj -p:RestoreAdditionalProjectSources=<matching-pr-packages> --nologo -v:q — passed; generated Basic Web and BrowserWebAssembly also built successfully.
  • dotnet build <source-or-generated-Uno-project> -p:TargetFramework=net10.0-browserwasm --nologo -v:q — passed for Basic Uno, Gallery Uno, and SkiaFiddle in both source and exact-package modes (generated builds also supplied -p:RestoreAdditionalProjectSources=<matching-pr-packages>). Basic Uno and Gallery Uno also built for net10.0-desktop in both modes. Evaluated Android, iOS, Windows, desktop, and browser reference graphs for these apps, including Gallery Shared and platform-specific references; all resolved generated SkiaSharp/HarfBuzzSharp packages share the matching PR build suffix. Package generations did not change TFMs.
  • pwsh -NoLogo -NoProfile -File ./run.ps1 from each generated Docker app's directory with exact PR packages staged — passed independently on Linux ARM64; DockerConsole rendered an image and DockerWebApi served an image. No Docker prune.
  • dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 --nologo -v:q — failed on the existing macOS ARM64 ganesh-gl/DiagonalLines golden mismatch: 6,339 passed, 23 skipped, 1 failed. This PR does not change GPU policy, golden files, or rendering. No dedicated test suite added: existing console/Docker programs and source/generated builds exercise the changed prerequisites.

Checklist

  • Tests added or updated (if omitted, explain why above)
  • Changes above lists all public API and behavioral changes (or "None.")
  • New/changed public API? Added or updated accurate source /// documentation and regenerated bindings when applicable
  • Native change? Companion mono/skia PR linked above and bindings regenerated

Keep native asset package IDs intact when generating standalone samples, make Uno source references coexist with sibling projects, and pin generated HarfBuzz/SkiaSharp dependencies to the matching artifact families. Exercise HarfBuzz on both console hosts and provide a NuGet-only downloader plus side-by-side SDK workload provisioning without repinning the repository SDK.

Co-authored-by: Copilot App <[email protected]>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

Add the automation/staging label to build and publish a documentation preview for this PR.

Removing the label removes the preview. While the label is present, each new commit updates it.


This comment is automatically updated by the documentation staging workflow.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 5297

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5297"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5297/packages --name skiasharp-pr-5297
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-5297

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #5297

⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS

Informational only — this never blocks the PR. 🟢 faster / less allocation · 🔴 slower / more allocation; moves under 5% are hidden as noise.

⏱️ Times are raw BenchmarkDotNet means, and the ⭐ PR and baseline legs run on separate CI runners, so microbenchmarks can swing run-to-run — treat small time deltas as noise. Allocations are deterministic and the reliable signal. The interactive perf-dashboard (linked below) applies smoothing for the trend view.

Highlights

⏱️ Time — 🔴 25 slower · 🟢 36 faster

  • 🔴 BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) · macOS · 193.86 µs → 323.06 µs (+67%)
  • 🔴 BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) · macOS · 148.45 µs → 244.61 µs (+65%)
  • 🔴 BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) · macOS · 543.53 µs → 815.99 µs (+50%)
  • 🟢 PathBoundsBenchmark.TightBounds(Points: 1024) · Windows · 21.40 µs → 11.07 µs (-48%)
  • 🔴 BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) · macOS · 651.48 µs → 952.44 µs (+46%)
  • …and 56 more (see details below)
Full per-OS benchmark deltas

Linux

⏱️ Time (vs 🌙 nightly 4.155.0-nightly.26480.5)

Benchmark baseline this PR Δ
MatrixMapPointsBenchmark.MapVector(Points: 4096) 171.50 µs 229.76 µs 🔴 +34%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 246.23 µs 287.44 µs 🔴 +17%
ColorMathBenchmark.PreMultiply(Colors: 4096) 12.86 µs 14.09 µs 🔴 +10%
ColorMathBenchmark.ToColor(Colors: 4096) 15.40 µs 14.25 µs 🟢 -7%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 11.45 µs 12.09 µs 🔴 +6%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 98.54 µs 103.98 µs 🔴 +6%

Windows

⏱️ Time (vs 🌙 nightly 4.155.0-nightly.26480.5)

Benchmark baseline this PR Δ
PathBoundsBenchmark.TightBounds(Points: 1024) 21.40 µs 11.07 µs 🟢 -48%
ColorMathBenchmark.ToColor(Colors: 4096) 14.52 µs 7.84 µs 🟢 -46%
RuntimeEffectShaderBenchmark.DrawFrame 1.17 ms 640.14 µs 🟢 -45%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 330.55 µs 186.40 µs 🟢 -44%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.25 ms 714.98 µs 🟢 -43%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.12 µs 1.22 µs 🟢 -43%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 243.19 µs 139.76 µs 🟢 -43%
CanvasDrawBenchmark.Draw(Shapes: 64) 2.66 ms 1.54 ms 🟢 -42%
ColorMathBenchmark.PreMultiply(Colors: 4096) 13.03 µs 7.61 µs 🟢 -42%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 915.58 µs 545.07 µs 🟢 -40%
CanvasDrawBenchmark.Draw(Shapes: 512) 20.73 ms 12.47 ms 🟢 -40%
ColorParseBenchmark.Parse(Iterations: 1000) 77.61 µs 46.98 µs 🟢 -39%
ColorMathBenchmark.ToColorF(Colors: 4096) 13.32 µs 8.14 µs 🟢 -39%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 9.96 ms 6.09 ms 🟢 -39%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 161.2 ns 99.3 ns 🟢 -38%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 2.12 ms 1.31 ms 🟢 -38%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 11.32 µs 7.20 µs 🟢 -36%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 2.59 ms 1.65 ms 🟢 -36%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 10.15 ms 6.62 ms 🟢 -35%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 796.62 µs 527.36 µs 🟢 -34%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 77.18 µs 51.26 µs 🟢 -34%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 4.86 µs 3.33 µs 🟢 -32%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.93 ms 2.16 ms 🟢 -26%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 122.06 µs 90.19 µs 🟢 -26%
MatrixMapPointsBenchmark.MapVector(Points: 256) 7.60 µs 5.66 µs 🟢 -26%
…and 9 more

macOS

⏱️ Time (vs 🌙 nightly 4.155.0-nightly.26480.5)

Benchmark baseline this PR Δ
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 193.86 µs 323.06 µs 🔴 +67%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 148.45 µs 244.61 µs 🔴 +65%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 543.53 µs 815.99 µs 🔴 +50%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 651.48 µs 952.44 µs 🔴 +46%
CanvasDrawBenchmark.Draw(Shapes: 64) 1.36 ms 1.96 ms 🔴 +44%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.53 µs 2.18 µs 🔴 +42%
CanvasDrawBenchmark.Draw(Shapes: 512) 11.14 ms 15.75 ms 🔴 +41%
ColorMathBenchmark.ToColorF(Colors: 4096) 4.98 µs 6.55 µs 🔴 +31%
ColorMathBenchmark.ToColor(Colors: 4096) 19.65 µs 25.57 µs 🔴 +30%
ColorMathBenchmark.PreMultiply(Colors: 4096) 8.30 µs 10.70 µs 🔴 +29%
ColorParseBenchmark.Parse(Iterations: 1000) 66.63 µs 78.22 µs 🔴 +17%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 7.56 µs 8.84 µs 🔴 +17%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 6.23 µs 7.12 µs 🔴 +14%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 18.36 µs 20.83 µs 🔴 +13%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 36.54 µs 40.85 µs 🔴 +12%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 130.4 ns 144.6 ns 🔴 +11%
MatrixMapPointsBenchmark.MapVector(Points: 256) 2.65 µs 2.37 µs 🟢 -10%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 667.73 µs 730.56 µs 🔴 +9%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.44 ms 1.54 ms 🔴 +7%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 67.12 µs 71.01 µs 🔴 +6%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 1.14 µs 1.20 µs 🔴 +5%

📈 Full interactive perf-dashboard & run details →

Keep Console and DockerConsole focused on SkiaSharp and retain the existing repository-SDK workload installation path without extra feeds or SDK overrides.

Co-authored-by: Copilot App <[email protected]>

This branch has not been deployed

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant