Repository navigation
[performance] Consolidate package build setup - #4816
mattleibow wants to merge 3 commits into
Conversation
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]>
📦 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 -- 4816PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4816"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4816/packages --name skiasharp-pr-4816More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4816 |
📊 SkiaSharp benchmarks — PR #4816⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 66 slower · 🟢 14 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
+38 package(s) unchanged (< 50.0 KB). Per-file changes
|
| File | Size |
|---|---|
runtimes/win-x64/native/libGLESv2.pdb |
66.6 MB → 66.5 MB (🟢 −80.0 KB) |
runtimes/win-arm64/native/libGLESv2.pdb |
64.5 MB → 64.4 MB (🟢 −64.0 KB) |
runtimes/win-x86/native/libGLESv2.pdb |
67.2 MB → 67.2 MB (🟢 −32.0 KB) |
Informational only — this never blocks the PR. Native binaries are labelled by os/arch.
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
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
|
Combined into #4815 so the validated native and package CI performance improvements can be reviewed and merged as one change. |
[performance] Build Android on Linux and reduce CI overhead (#4815) Context: #4816 Context: #4818 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1557164 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1559377 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1559994 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1560012 Context: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=15017102 Context: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=15030082 Context: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=15032120 Context: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=15032942 Move Android native production to four Linux-container jobs, make native bootstrap setup match the work each job performs, and stop special-package creation from rebuilding managed outputs. The final cache-disabled public run completed in 3h30m15s instead of 6h17m44s for cold main; raw agent usage fell from 3,087.2 to 1,562.4 minutes. Main receives additional policy-injected work, so those are end-to-end operational figures; the direct task and topology measurements below are the causal evidence. The final public run succeeded end to end. DevDiv native and package/signing runs also succeeded. Its test run passed managed builds, samples, and every test job except a macOS tests-netcore job canceled at 180 minutes without a product or test error. Exact-main DevDiv and the automatic public PR run reproduced the same timeout, while the cache-disabled final run passed macOS tests, so the hang was accepted as pre-existing and non-blocking. ~~ Native bootstrap and checkout ~~ Container-native jobs installed Python, Ninja, and .NET on the host even though the toolchain and Cake invocation run inside the image. Native source jobs also initialized every submodule, while merge-only jobs fetched source they never used and configured build variables a second time on cache misses. Skip host Ninja and .NET for Docker-native jobs, retain Python whenever direct execution or cache-key computation needs it, and preserve every direct Windows/macOS prerequisite. Source jobs now initialize only Skia and depot_tools; merge jobs initialize no submodules; build variables are configured once. The new controls default to the old managed-job behavior. Across the paired runs, full recursive submodule checkouts fell from 65 to zero, replaced by 56 targeted native checkouts. Python selection fell from 88 to 38, Ninja installation from 61 to 15, and .NET installation from 85 to 39, while the 119 required artifact downloads were preserved. ~~ Android native production ~~ The four Android ABIs were built on Windows and duplicated on macOS even though native merge consumed only the Windows artifacts. Enable the existing Android Cake targets on Linux, build x86, x64, arm, and arm64 in four parallel Docker jobs, remove both host matrices, and make the Linux artifacts canonical merge inputs. The image tracks Microsoft's Azure Linux Android prerequisite tag, verifies NDK r27c (27.2.12479018) and Ninja, and installs .NET SDK 10.0.108 with the repository's standard dotnet-install script because the prerequisite image does not contain the SDK. Startup diagnostics record the NDK path, CPU count, and Ninja version. The moving base tag is not part of the output-cache key, so a remote tag update is consumed only after a cache miss, cache-disabled run, or tracked input change; it is deliberately not pinned by digest. This replaces eight host jobs with four Linux jobs. In the paired cold runs, Android agent usage fell from 429.9 to 61.6 minutes and the critical job from 1h14m10s to 15m34s. Across all four ABIs, both native libraries retained the four-file .so/.dbg inventory, matching ELF machines, exported dynamic symbols, DT_NEEDED sets, GNU debug links, and 0x4000 LOAD alignment. ~~ Special-package work ~~ nuget-special creates internal wrapper packages from existing native, normal NuGet, and symbol outputs, but its root target depended on libs and rebuilt the managed graph. Its separate job also installed Node, Android SDK/JDK, workloads, and every submodule even though none participates in wrapper creation. Remove the libs dependency while keeping normal and special packaging as separate, ordered jobs. Normal packaging keeps Node for TypeScript-backed projects and checks out only the API-docs submodule. Special packaging consumes the published normal/native artifacts, checks out no submodules, and skips Node, Android, and workload provisioning while retaining the .NET SDK, tool restore, and Visual Studio selection. Output rearrangement runs only on cache misses so restored artifacts keep their published layout. The package stage fell from 2h21m00s to 43m36s, with the special job falling from 1h08m07s to 12m51s. All six package artifacts remained, their sizes matched cold main within 1%, package scanning passed, and DevDiv signing completed. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot App <[email protected]>
Description
Reduce package CI wall time and agent consumption without changing package contents, shipping assets, signing preparation, scanning, determinism, or public behavior:
libsdependency; it now only repackages existing native, normal NuGet, and symbol outputs.docssubmodule required for shipped XML API documentation instead of all recursive submodules.SignList.xml.Public definition 345 run 1558996 succeeded end to end. The combined package job, scan job, component detection, tests, samples, and all six package artifact publications passed.
The package stage fell 103.0 minutes / 73.1%, while package-job agent use fell 106.7 minutes / 80.3%. The final 37:59 consists of the 26:04 combined package job, an 8:13 hosted-agent wait for scanning, and 3:43 of NuGet scanning. That remaining queue is outside package generation and would require changing the scan-job boundary.
Measured redundant work removed with the second package job:
Related issues
N/A.
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
None — packaging/CI-only; no public API, package content, shipping asset, signing, scanning, deterministic-build requirement, or runtime behavior changes.
Testing
dotnet cake --target=nuget-special --dryrun --skipExternals=allschedules onlynuget-special, notlibs.nuget-specialsuccessfully without managed library outputs.dotnet cake --target=nuget --skipExternals=all;libs,nuget-normal, and ordered special packing completed successfully.nightlyjobs, all failing before benchmarks because unpublished package4.152.0-nightly.17was absent (NU1102). Other benchmark variants and source benchmarks passed, confirming the known external nightly-feed baseline issue is unrelated to this package YAML.Checklist
Changesabove lists all public API and behavioral changes (or "None.")mono/skiaPR or regenerated bindings required