Repository navigation
[performance] Build Android on Linux and reduce native/package CI overhead - #4815
Conversation
The Android x86, x64, arm, and arm64 shipping artifacts are produced by the Windows native jobs and only those artifacts are consumed by the native merge. The duplicate macOS jobs publish artifacts that no downstream job downloads.\n\nRemoving them preserves the complete Android RID and architecture matrix while avoiding four hosted macOS agents per build.\n\nCo-authored-by: Copilot App <[email protected]>
📦 Try the packages from this PRWarning 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 -- 4815PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4815"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4815/packages --name skiasharp-pr-4815More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4815 |
Package special NuGets directly from the native and normal-package artifacts instead of rebuilding all managed libraries. Skip Node, Android tooling, and .NET workload provisioning for the special package job while retaining the .NET SDK and tool restore. Co-authored-by: Copilot App <[email protected]>
📊 SkiaSharp benchmarks — PR #4815⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 37 slower · 🟢 30 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
📦 Artifact size reportPackages from this PR (build Total Packages
+37 package(s) unchanged (< 50.0 KB). Per-file changes
|
| File | Size |
|---|---|
🧬 android-x86 (runtimes/android-x86/native/libSkiaSharp.so) |
11.8 MB → 11.0 MB (🟢 −802.2 KB) |
SkiaSharp.NativeAssets.WinUI
| File | Size |
|---|---|
runtimes/win-x86/native/libGLESv2.pdb |
67.2 MB → 67.2 MB (🟢 −80.0 KB) |
runtimes/win-x64/native/libGLESv2.pdb |
66.6 MB → 66.6 MB (🟢 −64.0 KB) |
runtimes/win-arm64/native/libGLESv2.pdb |
64.5 MB → 64.4 MB (🟢 −48.0 KB) |
runtimes/win-arm64/lib/net10.0-windows10.0.19041.0/SkiaSharp.Views.WinUI.Native.Projection.dll |
24.5 KB → 25.5 KB (🔴 +1.0 KB) |
runtimes/win-arm64/lib/net9.0-windows10.0.19041.0/SkiaSharp.Views.WinUI.Native.Projection.dll |
24.5 KB → 25.5 KB (🔴 +1.0 KB) |
runtimes/win-x64/lib/net10.0-windows10.0.19041.0/SkiaSharp.Views.WinUI.Native.Projection.dll |
24.5 KB → 25.5 KB (🔴 +1.0 KB) |
runtimes/win-x64/lib/net9.0-windows10.0.19041.0/SkiaSharp.Views.WinUI.Native.Projection.dll |
24.5 KB → 25.5 KB (🔴 +1.0 KB) |
runtimes/win-x86/lib/net10.0-windows10.0.19041.0/SkiaSharp.Views.WinUI.Native.Projection.dll |
24.5 KB → 25.5 KB (🔴 +1.0 KB) |
runtimes/win-x86/lib/net9.0-windows10.0.19041.0/SkiaSharp.Views.WinUI.Native.Projection.dll |
24.5 KB → 25.5 KB (🔴 +1.0 KB) |
Informational only — this never blocks the PR. Native binaries are labelled by os/arch.
Containerized native builds use the toolchain inside their Docker image, so installing Python, Ninja, and .NET on the host only adds setup work. Native source builds also only require the Skia and depot_tools submodules, while merge jobs require none.\n\nPreserve host tools for direct native builds and Python for cache-key computation. Managed checkout and provisioning behavior remains unchanged.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
Run normal and special NuGet packing on the same Windows agent so the special packages reuse the managed build and package outputs in place. Preserve the existing package artifacts while removing the second job's queue, checkout, cache, Python, SDK, tool restore, and artifact transfers. Limit the remaining checkout to the API docs submodule and skip unused Node provisioning. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 9a31f503-e746-4718-ab9a-06a3cee124c6
Normal packaging compiles TypeScript-backed managed projects, so keep Node in the consolidated package job while retaining the removal of the separate special-job provisioning. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 9a31f503-e746-4718-ab9a-06a3cee124c6
Keep cross-host Android coverage in the daily scheduled native pipeline while skipping the four unconsumed macOS artifacts in ordinary PR and CI builds. Windows remains the shipping Android producer until a Linux replacement is proven equivalent.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
Combine the validated native and package CI reductions in one pull request. Preserve native targeted submodule checkout while honoring package jobs that explicitly disable recursive submodules.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
Move all four Android ABI builds into a pinned Azure Linux Android container and make those artifacts the canonical native merge inputs. Remove the redundant Windows and macOS Android jobs while preserving the existing source build, symbol extraction, and alignment validation paths. Co-authored-by: Copilot App <[email protected]>
Build all four shipping Android ABIs in the pinned Linux container, remove the Windows and macOS duplicates, and consume the Linux artifacts in native merge.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
Track the moving Android prerequisite image for security updates and install the requested .NET SDK through the same dotnet-install script used by the other native Dockerfiles.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
Co-authored-by: Copilot App <[email protected]> Copilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
Retain the optimized special-package setup while restoring normal and special NuGet packing as distinct Azure jobs. Co-authored-by: Copilot App <[email protected]> Copilot-Session: aaededd0-4f67-43d2-9c48-94ae5d66f885
There was a problem hiding this comment.
Pull request overview
Reduces native and packaging CI work by consolidating Android builds on Linux containers and making bootstrap steps configurable.
Changes:
- Moves Android native builds to four parallel Linux Docker jobs.
- Avoids unnecessary tool installation and submodule checkout.
- Separates normal and special packaging without rebuilding managed libraries.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
scripts/infra/native/android/docker/startup.sh |
Adds Android container startup diagnostics. |
scripts/infra/native/android/docker/Dockerfile |
Defines the Android native build image. |
scripts/azure-templates-stages-package.yml |
Streamlines normal and special package jobs. |
scripts/azure-templates-stages-native-windows.yml |
Removes Windows Android builds. |
scripts/azure-templates-stages-native-merge.yml |
Uses Linux Android artifacts. |
scripts/azure-templates-stages-native-macos.yml |
Removes macOS Android builds. |
scripts/azure-templates-stages-native-linux.yml |
Adds parallel Linux Android jobs. |
scripts/azure-templates-jobs-bootstrapper.yml |
Adds selective setup and checkout controls. |
native/android/build.cake |
Enables Android native builds on Linux. |
build.cake |
Removes the special package target’s libs dependency. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Description
Reduce native and package CI wall time and agent consumption without changing package contents, shipped RID/architecture/feature coverage, ABI, signing preparation, security scanning, or deterministic-build behavior.
This PR has three related optimization areas:
Native orchestration
externals/skiaandexternals/depot_toolsfor native source jobs; merge-only jobs checkout no submodules.Android native builds
27.2.12479018) and install .NET SDK 10.0.108 through the same officialdotnet-install.shpattern used by the other native Dockerfiles.native/androidoutput cache. Its key hashesnative/android/**,scripts/infra/native/android/**(including the Dockerfile/startup script), shared native inputs, and Skia/depot_tools SHAs. A remote-only base-tag update is picked up on the next cache miss or cache-disabled run; it does not itself alter the artifact-cache key.Package build
package_normal_windowsandpackage_special_windowsas separate dependent jobs.nuget-special -> libsdependency; special packing only wraps existing native, normal NuGet, and symbol outputs.docssubmodule required by normal packaging; special packaging checks out no submodules.SignList.xml.Measured results
Every before/after performance table uses the same paired runs:
46ea7244b6ab, with 65 cache misses and zero hits.a5bfc32a32f, succeeded end to end.Intermediate runs are not used in the performance tables.
End-to-end
Main receives additional default-branch policy-injected work that a manual feature-branch run does not. Raw wall and agent-minute rows are therefore end-to-end operational comparisons, not wholly attributable to this PR. Direct task counts and job-topology changes below remain exact.
Native pipeline
Source-stage wall changes were Windows -67.2%, macOS -24.0%, Linux -9.7%, WASM -26.0%, and Tizen +25.3%. Tizen is reported rather than hidden; no Tizen code or matrix changed.
Host/setup task counts changed as intended: Python selection 88 -> 38, Ninja installation 61 -> 15, .NET installation 85 -> 39,
.NET --info125 -> 71, and build-variable configuration 155 -> 86. Full recursive submodule checkouts fell from 65 / 91.7 agent-minutes to zero, replaced by 56 targeted native checkouts / 73.5 minutes. Artifact-download count remained exactly 119, with transfer time falling from 27.9 to 24.3 minutes. Docker image builds increased from 43 to 47 because the four Android builds now run in Docker; image setup rose from 78.6 to 97.5 agent-minutes and is included in the totals above.Android migration
Final Linux jobs completed in 15m14s-15m34s. All four artifacts feed the canonical native merge.
Package pipeline
nuget-normalbootstrappernuget-specialbootstrapperAll six outputs published. Normal product artifact sizes differ from main by at most 0.12%; the normal build/log artifact differs by 0.35%.
nuget_specialdiffers by 0.07% and the special build/log artifact by 0.91%.Managed build and tests are validation, not optimization targets. Both succeeded: managed build in 40m50s and tests in 57m23s. All 33 published candidate test runs report zero failed tests. Samples also succeeded in 1h12m11s; cold main failed its sample stage after 1h44m28s.
Related issues
N/A.
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
None - CI-only; no public API, C API, ABI, package-content, shipped-asset, signing, scanning, or runtime behavior change.
Testing
native_android_*_linuxjobs, no Windows/macOS Android jobs, Linux canonical merge inputs, targeted native checkout, and separate normal/special package jobs.native/androidincludes both Android source directories and the Docker context.dotnet cake --target=nuget --dryrun --skipExternals=allscheduleslibs, thennuget-normal, thennuget-special; standalonenuget-specialdoes not schedulelibs.samples_windows, and the coverage artifact name contains the new build ID. Every other artifact name is preserved.nativesize differs from cold main by 0.04%;native_linuxandnative_wasmsizes are exact matches..so/.so.dbginventory, matching ELF class/machine, exported dynamic symbols,DT_NEEDED, GNU debug links, and 16 KiB LOAD alignment across every ABI. This supporting run is not used in the performance tables.tests-netcorejob canceled at the 180-minute timeout. That task emitted no test/product error, only existingCS0618warnings. Exact-main DevDiv run 15017102 and automatic public PR run 1559994 had the same macOS 180-minute timeout, while the cache-disabled final run 1560012 passed macOS tests and produced an unchanged macOS artifact. This is a pre-existing macOS hang, not a PR regression, and was accepted as non-blocking after cross-run correlation.Checklist
Changesabove lists all public API and behavioral changes (or "None.")mono/skiaPR required