Repository navigation
Consolidate sample builds and host execution into tests - #5291
mattleibow wants to merge 23 commits into
Conversation
Replace Cake's sample build loops and the standalone package-output lane with one Samples test project. Drive one SDK/workload and previous/current consumer framework pair per invocation from the six-job CI matrix.\n\nUse SLNX-only sample solutions and Dockerfile-based discovery. Build and run console/Docker samples directly, capture rendered PNGs, and retain the former browser/device goldens as local-only platform tests. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a6c3f418-4439-4a62-9bbb-5efaaafef142
📦 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 -- 5291PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5291"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-5291/packages --name skiasharp-pr-5291More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-5291 |
|
📖 Documentation Preview Add the 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. |
📊 SkiaSharp benchmarks — PR #5291⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 62 slower · 🟢 30 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
Pin Uno's implicit native dependencies to the package artifact and include the console sample's Linux native asset. Preserve the repository Xcode pin and add the public feed needed by preview workload tooling in the isolated install configuration. Restore explicit mobile-device selection, avoid shared Appium resources, and defer generated MAUI probe restore until its selected framework is configured. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a6c3f418-4439-4a62-9bbb-5efaaafef142
Use native-asset project names for package IDs while retaining their shared version family. Actual Linux console and standalone browser execution exposed the missing native references that build-only validation did not catch. Add explicit runtime assets and regression assertions for the generated package references. Handle numeric runtime configuration values for Android API and Appium port selection. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a6c3f418-4439-4a62-9bbb-5efaaafef142
Run only the Samples macOS jobs on the hosted Tahoe image that provides both the repository Xcode and Xcode 26.6 required by preview SDK backward-targeting Apple packs. Keep native and source-test agents unchanged. Use Windows-compatible NAT port publication and canonicalize expected artifact paths in isolation regressions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a6c3f418-4439-4a62-9bbb-5efaaafef142
Remove the nuget.org source rejected by the internal Secure Supply Chain Analysis task (CFS0013). Keep the existing dotnet-public and dotnet-eng feeds and leave the supply-chain policy enabled. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 545b3a8e-8a03-49a5-9f83-ee4f979f532c
Keep the GTK4-native suite on Linux as requested, without installing libepoxy on Windows or macOS or changing core GPU coverage. Serialize GTK access and assert the properties set by SKGLArea instead of calling an API absent from Ubuntu 22.04 GTK 4.6. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 545b3a8e-8a03-49a5-9f83-ee4f979f532c
Preserve the consolidated runner while incorporating the merged skill retirement, SLNX cleanup, and current main changes. Co-authored-by: Copilot App <[email protected]>
Internal Linux x64 validation failed when the pinned fontconfig download was reset by its peer. Retry transfer errors up to three times with bounded connection and transfer deadlines, and explicitly abort on exhausted downloads before misleading missing-file checksum failures. Keep package versions, hashes, extraction, and security policy unchanged in both matching glibc image definitions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 545b3a8e-8a03-49a5-9f83-ee4f979f532c
Co-authored-by: Copilot App <[email protected]>
Prepare and clean a scoped consumer workspace for each test case, declare exact device prerequisites in theories, and keep CI exclusions explicit. Use standard SDK installation tasks with one pinned workload helper while keeping runner SDK, consumer SDK, and declared sample frameworks independent. Verify artifact bytes when NuGet legitimately reuses an identical package restored from another folder. Co-authored-by: Copilot App <[email protected]>
The original macOS SDK11 run passed every test, then the MTP1.9.1 HangDump controller crashed during dump-file enumeration after incorrectly detecting inactivity. The sample harness already bounds and terminates each owned child command. Omit HangDump only for sample orchestration, retaining all test cases, core runner diagnostics, and the existing CI job timeout. Co-authored-by: Copilot App <[email protected]>
Resolve the first executable selected by PATH instead of assuming DOTNET_ROOT identifies the SDK being provisioned. A real isolated repro with differing roots reproduced the hosted macOS Tizen-not-recognized failure before the change and installed both pinned workloads afterward. Log the manifest destination so future provisioning failures expose the actual installation. Co-authored-by: Copilot App <[email protected]>
Use the user-requested RC1 SDK and workload set without adding feeds or changing sample TFMs. RC1 uses Emscripten6.0.2 for net11 while backward-targeting net10 remains3.1.56, so build all4 new native variants, merge their artifacts, and align both families source/package native references. Preserve older archive builds and validate every framework/threading/SIMD selection with real MSBuild evaluation. Co-authored-by: Copilot App <[email protected]>
Directory teardown can race WasmAppHost descendant shutdown because waiting for dotnet run only observes its parent process. Retry only Windows sharing/access-denied errors in owned directory cleanup for a bounded interval, log retries, and preserve permanent failures. Add a temporary-file lock lifecycle regression and document the cleanup behavior. Co-authored-by: Copilot App <[email protected]>
Integrate main at 0342cd6, including the landed #5302 recovery. Preserve the unified Samples documentation and existing GTK4 policy without restoring the retired MSBuild runner. Co-authored-by: Copilot App <[email protected]>
Pin the preview SDK and workload set to the reviewed RC1 versions. Replace obsolete preview Emscripten 5.0.6 jobs and merger inputs with all four 6.0.2 variants, preserving stable toolchains and the existing installer contract. Align source and packaged native references, including the missing packaged Skia net11 boundary. Port the 80 item-selection evaluations into the existing MSBuild suite without replacing its package tests or CI stage. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Keep RC1 terminology on the SDK/workload pins only; the WASM mapping applies to all net11.0+ targets. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Restore the side-build's original unpinned wasm-tools install under the SDK selected by global.json. Avoid coupling website provisioning to the shared Azure CI workload helper and pins. Co-authored-by: Copilot App <[email protected]>
Extract generic provisioning from #5291 without changing its sample runner or preview pins. Preserve main's Samples and MSBuild stages, make SDK selection explicit, and register pinned Tizen manifests against the first resolved PATH dotnet installation. Co-authored-by: Copilot App <[email protected]> Copilot-Session: d16e5c4d-1352-4f2f-952a-c9f2a5c1667f
Synchronize PR #5306 at 7acc328. Replace obsolete Emscripten 5.0.6 build and merger inputs with the .NET 11 6.0.2 variants. Retain the equivalent 80 native-reference evaluations in the consolidated Samples suite rather than resurrecting its retired MSBuild host. Co-authored-by: Copilot App <[email protected]>
Synchronize PR #5307 at e54a67c. Preserve its full Linux/Tizen workload declarations and exact-SDK helper while retaining the consolidated sample lanes, RC1 pins, and equivalent tests in this branch. Co-authored-by: Copilot App <[email protected]>
Simplify SDK and workload provisioning with explicit descriptors (#5307) Context: #5291 Separate SDK acquisition, workload installation and build SDK selection. Make job requirements declarative while retaining standard UseDotNet@2 acquisition, existing build/test orchestration and repository version pins. ~~ Make host provisioning requirements explicit ~~ The bootstrapper combined install switches, additional SDKs, workload strings and preview-specific setup. Replace that interface with dotnetSdks descriptors containing sdkVersion, optional workloadSetVersion, optional workload IDs and optional Samsung manifest metadata. The generic default now installs the repository SDK without workloads. Omitting workloadSetVersion makes an entry SDK-only; an empty dotnetSdks list opts out of host provisioning. Managed, package, core/device test and existing Samples jobs explicitly retain their workload requirements. Container and merger callers explicitly opt out rather than depending on job-name or Docker conditions inside the SDK installer. Keep the existing host workload lists, including Linux's android, macos, wasm-tools and maui-android requirements and the managed jobs' Tizen setup. Preserve the Android-only override. WinUI/ANGLE entries are SDK-only, and WinUI's side-by-side SDK declaration replaces its redundant prebuild UseDotNet tasks. Retain the Samples and MSBuild stages, Cake entry points, 180-minute job limit, cache-skip conditions and three-retry task policy. Remove the unused install-dotnet.ps1 custom downloader/PATH setup and install-maui.ps1 global maui-check --fix flow. SDK acquisition remains with UseDotNet@2; requested workloads go through install-dotnet-workloads.ps1. Document the descriptor contract and its separate selection rules. Keep the website side build independent of this provisioning contract. Its existing setup-dotnet/global.json acquisition and standalone, unpinned 'dotnet workload install wasm-tools' command remain unchanged. Parsed 53 Azure/GitHub YAML files and checked the supported interface on 47 bootstrapper callers. The existing cache coverage audit reports no uncovered tracked files, including the new shared steps template. ~~ Select the SDK explicitly without replacing repository configuration ~~ Installing an SDK does not select it. WinUI demonstrates why selecting the last installed SDK would be wrong: repository tooling uses 10.0.401 while native/winui/global.json selects its side-by-side 10.0.111 SDK. Ordinary jobs keep their global.json selection. Preview WASM and MSBuild package-test jobs use jobSdkVersion explicitly. Unlike the old preview step, which replaced global.json with an SDK-only object, activation edits its SDK fields, disables roll-forward and verifies dotnet --version while preserving tools and MSBuild configuration. It does not repin Arcade's tools.dotnet acquisition setting. Workload installation also receives an exact SDK instead of inheriting the repository's current selection. Run it from a GUID-owned temporary context with an exact-sdk global.json, disabled roll-forward and a version check. Restore the working directory and remove that context in finally blocks; installed workloads remain available to subsequent job steps. Missing SDKs and nonzero workload-install exits fail explicitly. Install the Microsoft workload IDs once with --version and the repository nuget.config. Keep SDK 10.0.401 and workload set 10.0.202 separate: the existing cross-feature-band pin avoids the newer set's Xcode requirement. The existing preview SDK/workload pins are unchanged. Do not add a root global.json workloadVersion that SDK-only native jobs would also consume. PowerShell syntax and exact job activation checks passed, including preservation of non-SDK configuration and missing-SDK failure cleanup. A fresh 10.0.401 SDK installed wasm-tools with set 10.0.202 without changing repository global.json. The unfiltered net10.0 console solution was not green: 6,396 tests passed, 47 declared skips remained and the known macOS-arm64 ganesh-gl/DiagonalLines golden mismatch still failed. No golden or skip-policy changes are included. ~~ Register Samsung manifests beside the executable actually being used ~~ Tizen is not part of Microsoft's workload set. Separate Samsung's publication band 10.0.100 from manifest version 10.0.123 and from the consuming SDK's feature band. Require both Samsung pins when Tizen is requested; the helper also requires at least one Microsoft workload ID. Download the pinned manifest from dotnet-public and register it under both the publication and consuming SDK bands, preserving preview/RC band suffixes. Replace the old Get-Command/readlink path handling with the first PATH application and .NET symlink resolution. Select-Object -First 1 is necessary because Get-Command -CommandType Application can return several matches. An inherited DOTNET_ROOT is not authority for that destination. Log the resolved installation root to expose misplaced-manifest failures. Install Tizen separately after the pinned Microsoft workloads, using the same repository feeds and --skip-manifest-update so it does not refresh the Microsoft manifests. Keep downloaded/extracted temporary files inside the helper-owned context instead of the former shared output/tmp paths. The real provisioning exercise covered a symlink, multiple PATH matches and a deliberately divergent DOTNET_ROOT. Tizen 10.0.123 was registered in the selected SDK's 10.0.400 band and installed alongside wasm-tools; the inherited root and repository global.json remained unchanged. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: d16e5c4d-1352-4f2f-952a-c9f2a5c1667f
Integrate the landed SDK/workload provisioning refactor. Keep this branch's RC1 preview SDK and workload pins alongside main's split Tizen manifest band/version interface. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Merge PR #5306 head 7dd7eb0, including main a38df39 and landed #5307. Preserve the equivalent consolidated sample lanes and tests without restoring retired MSBuild orchestration. The resulting tree is unchanged. Co-authored-by: Copilot App <[email protected]>
Align .NET 11 preview pins and WASM native assets (#5306) Context: #5291 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628616 Keep the preview SDK, native archive builds and consumer target selection aligned without changing stable framework mappings or replacing the existing SDK provisioning and MSBuild test infrastructure. Carry forward the SDK/WASM work from #5291 as an independently mergeable change. ~~ Provision the preview toolchain from approved feeds ~~ Approved mirrors lacked Preview 6's Emscripten 5.0.6 host packs. Advance the preview lane to SDK 11.0.100-rc.1.26425.128 and workload set 11.0.100-rc.1.26460.1 without adding feeds. Leave stable and WinUI SDK pins, Tizen's existing variable/interface, and declared project frameworks unchanged. Replace the four Emscripten 5.0.6 native build variants with 6.0.2, retaining single-threaded, multithreaded, SIMD and SIMD+threading combinations and their _wasmeh/_newexc flags. Replace their artifact names in both the aggregate native merger and the WASM-specific merger so package production consumes the new toolchain. Do not retain obsolete preview-only 5.0.6 production jobs. Build 1628616 tested PR merge d261c6e, which includes head 7acc328. Its four 6.0.2 native jobs, WASM artifact merger, and stable and preview WASM test jobs passed. These job results do not establish success of the entire multi-platform build. ~~ Select matching archives across the .NET 11 boundary ~~ The source targets and packaged HarfBuzz targets selected 5.0.6 for net11+, while packaged Skia still selected 3.1.56 for every framework at or above net9. Updating the compiler alone would leave consumers selecting archives from the wrong toolchain. Align the source and buildTransitive targets for SkiaSharp and HarfBuzzSharp: net8 selects 3.1.34, net9/net10 select 3.1.56, and net11+ selects 6.0.2. Cap packaged Skia's 3.1.56 predicate below 11.0 and add its missing net11+ entry. Keep the newest predicate open-ended; the mapping applies to .NET 11 targets, not a separate RC1-only target category. Update package and upgrade guidance to describe the same framework boundaries. ~~ Verify evaluated native references without claiming linkage ~~ The existing package-output tests inspect desktop native binaries, not WASM static archive selection. Add WasmTargetsSelectTheDeclaredFrameworkToolchain to that existing MSBuild host rather than importing the Samples runner. Copy the four repository targets into per-test workspaces and evaluate NativeFileReference with real MSBuild. Five framework rows, net8 through net12, exercise both families, source/package imports, and threading/SIMD combinations: 80 evaluations assert one item and its exact FullPath. Include an obsolete 5.0.6 fixture to detect accidental old-toolchain selection. Pass the repository directory through runtime configuration and share the existing command execution, environment filtering and diagnostic capture. Evaluation has a one-minute timeout; build/publish retain five minutes. Preserve the existing 48 package-output cases and their MSBuild CI stage. The five regression rows passed locally with SDK 10.0.401 and the pinned SDK 11, with no skipped cases. Dummy archives prove item selection only; they cannot prove native linking or execution. Those require producing CI and the WASM runtime tests, rather than old downloaded native binaries. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cbe348b8-ee2b-40c5-b889-86aaead009c0
Build and validate generated samples in isolated test workspaces (#5308) Context: #5291 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1630344 Validate the package-consuming applications distributed in sample archives through an ordinary .NET test suite. Keep repository build settings out of consumer workspaces, retain evidence after cleanup, and exercise real sample builds and host/container execution rather than synthetic substitutes. Carry forward the sample foundation from #5291 without replacing the existing Integration or MSBuild suites, package-output cases, device tests, or goldens. This change does not alter shipped managed APIs or the native ABI. ~~ Make generated sample validation discoverable ~~ Replace samples.cake's imperative solution and Docker run.ps1 loops with the net10.0 SkiaSharp.Tests.Samples runner. Remove samples-prepare and samples-run; samples now generates the inputs and invokes the test project. Direct dotnet test and IDE execution consume those prepared inputs without invoking Cake or acquiring packages. SampleLookup selects host-specific SLNX variants and Dockerfiles. Basic and Gallery theories build the eligible generated solutions with their declared TFMs unchanged; Gallery, WASM, and Blazor coverage is build-only. Discovery tests assert the expected host case sets independently of build execution and Docker availability. Include SkiaSharp and the runner's macOS/Win32 native-assets dependencies in the Samples solution. Document net10.0 global properties for solution runs so those dependency projects do not build their entire shipping TFM matrix. Keep the existing three CI host jobs, acquire native artifacts for the repository-based runner alongside the consumer NuGet packages, and publish TRX results and diagnostic artifacts even when tests fail. Samples disable MTP's activity-based hang monitor because it misdetects child build process trees; the child commands retain their own bounded lifetimes. Build 1630344 passed its stages at source 7ea57f4, tested through merge 23e5017: Windows 112 passed, Linux 105 passed, and macOS 107 passed with four Docker-availability skips. Linux's first attempt failed before tests on a truncated Emscripten archive; the authorized Linux-only retry preserved the successful Windows/macOS attempts. This full result predates the later shared-runner changes and is not exact-head proof for 2180818. ~~ Require generated dependencies to match the producing packages ~~ Generated samples must restore the supplied product packages rather than silently selecting public releases or a different producing build. Preserve explicit generation versions from VERSIONS.txt and the supplied suffix. Before runner restore/build, require one non-symbol core package for each of SkiaSharp and HarfBuzzSharp and matching producing suffixes. Generated project contracts check that declared product versions exist in the cohort. Native-assets project references need their concrete project name as the package ID, not the broader PackagingGroup used to obtain the family version. Add Linux.NoDependencies references to Console and Web: their generated Linux runtime checks previously failed before rendering because libSkiaSharp.so was absent. Expose Views, Skottie, and Linux native dependencies before the source-only Uno import in Basic and Gallery. The in-tree helper replaces earlier project references with platform-selected references; generation instead converts the declarations into versioned packages. Keep Gallery Shared after that import so the helper does not remove it. Stamp SkiaSharpVersion in Basic Uno, Gallery Uno, and SkiaFiddle to align Uno's implicit product references. Package-contract tests exercise missing, duplicate, and mismatched core inputs, explicit generated dependencies, and Uno version overrides. Basic and Gallery Uno desktop/browser source builds also passed, preserving the in-tree path alongside the generated consumer path. ~~ Separate consumer SDK and cache state from the repository runner ~~ A consumer build below the repository would otherwise inherit global.json, Directory.Build imports, and ambient restore/build environment variables. Prepare a per-test workspace containing the selected sample, required ancestor configuration, and Gallery's shared sibling projects rather than copying unrelated samples. Place empty Directory.Build fences and a host-selecting SDK section at the workspace root, not around the repository test runner. Reject sample-local global.json files that would override that boundary. Preserve the host PATH while clearing inherited DOTNET, MSBuild, restore, and NuGet settings; place CLI home and package/HTTP/scratch caches inside the disposable workspace. Map SkiaSharp* and HarfBuzzSharp* restores to the supplied artifact source, with public feeds available for other dependencies. Remove the old samples-prepare package-cache clearing: consumer isolation must not require deleting another build's cached packages. Infrastructure tests verify scoped copying, ancestor configuration, SDK selection despite a deliberately invalid repository pin, private cache paths, artifact-source mappings, and preservation of neighboring workspaces. ~~ Bound owned-directory cleanup without hiding permanent failures ~~ Terminated Windows descendants can briefly retain DLL handles. Retry owned directory deletion for sharing, lock, and access-denied error codes, bounded to 20 attempts with 250 ms waits; unrelated errors and exhausted retries remain failures. macOS recursive deletion can encounter ENOTEMPTY after metadata appears in an enumerated directory. Permit one immediate, logged retry for HResult 66 when the remaining tree contains directories and .DS_Store files. Reject symlinks, unrelated residue, other errors, and persistent writers rather than treating deletion failure as successful cleanup. Regression tests exercise metadata-only recovery, unrelated errors and files, persistent writers, Windows handle release, and preservation of diagnostics and neighboring resources. Diagnostics live outside disposable consumer roots. ~~ Exercise real applications while owning their process and Docker lifetime ~~ Run the host Console/Web applications and the existing Docker Console/Web samples through shared application callbacks. Check Console exit codes and output, HTTP status/content types, readiness endpoints, and rendered PNGs. Host HTTP binds to an ephemeral loopback port; request construction rejects origin changes, fragments, and malformed paths. Bound tool and application execution, terminate owned process trees, and retain separate stdout/stderr plus available build binlogs. Attach files up to 8 MiB to test results; larger diagnostics remain in pipeline artifacts. Docker fixtures use unique tags, contexts, and container names, reuse their own built images, and remove their own resources. Replace the old global docker system prune --all --force cleanup; aggregate owned cleanup failures instead of silently swallowing them. Keep the existing .NET 10 Dockerfiles. Probe Docker availability with a bounded docker info request. Missing CLI, an unavailable daemon, or a probe timeout produces a visible skip; incorrect container mode and actual build/runtime failures remain failures. Apply availability checks on macOS too, rather than excluding the platform, while leaving macOS CI daemon provisioning absent. Local macOS validation passed 94 checks with usable Docker. Missing-daemon and missing-CLI runs each passed 90 checks and visibly skipped four Docker cases, demonstrating availability behavior without changing shared resources. ~~ Render container text without relying on installed system fonts ~~ Minimal containers did not provide a usable default typeface, leaving the sample text absent despite successful image creation. Bundle the existing Noto Sans font with Docker Console and Docker WebApi, copy it to build and publish output, and load it explicitly through SKTypeface.FromFile. Retain font attribution and the SIL Open Font License link in the sample READMEs, including the Android/Blazor samples already using Noto Sans. Real container executions and reviewed before/after images establish the rendering correction rather than a font-load-only assertion. ~~ Compare decoded sample pixels with a narrowly bounded allowance ~~ Add reviewed host and container PNG references under the Samples suite. Compare decoded pixels rather than encoded file bytes, require matching dimensions, and retain zero per-channel tolerance. Permit at most 0.075% of pixels to differ, using decimal arithmetic so fractional thresholds do not round upward. Keep this policy local to sample output; core image comparisons and GPU policies are unchanged. Missing references fail, mismatches retain actual and difference images, and tests do not accept replacement goldens. Boundary tests accept 360 changed pixels at 800x600 but reject 361, and accept 196 at 512x512 but reject 197. Fractional-size cases and one-level color/alpha changes verify that the allowance counts differing pixels, not a relaxed channel threshold. ~~ Expose live test progress while preserving caller configuration ~~ Long CI runs appeared stalled at InvokeTestingPlatform because MTP captured runner output. Default TestingPlatformCaptureOutput to false in the cloned RunDotNetTest property dictionary and pass --show-live-output on --no-ansi. Keep the device runner unchanged and do not force the SDK terminal logger off or claim that buffered child-build output now streams line by line. Use TryAdd for Platform and optional coverage properties, emitting each quoted property through the shared loop. Preserve explicit caller values and the caller's original dictionary. Allow the Samples caller to build the runner and opt out of activity-based hang detection while retaining the default TRX and 15-minute Mini hang-dump behavior for other callers. Actual Cake helper probes passed with default capture=false and explicit capture=true, confirming live default heartbeats and retained TRX/hang arguments. Further probes passed for coverage defaults, explicit overrides including a spaced output path, and coverage disabled. These checks prove argument handling, not coverage instrumentation or another full-suite run. ~~ Write exported quick starts for generated-copy consumers ~~ Use sample-local run/publish commands and concise application guidance in Gallery, MAUI, Uno, and SkiaFiddle READMEs. Remove repository implementation inventories and source-checkout bootstrap instructions from these exported consumer entry points; generation removes repository-native imports and converts product references to packages. Keep repository setup, explicit producing-version arguments, IDE/direct test commands, and failure diagnostics in building-samples.md and central maintainer guidance. Bootstrap must precede staging packages because it resets output; native changes require source builds rather than downloaded binaries. Review raised the omitted in-tree bootstrap in four quick starts. The maintainer confirmed their generated-consumer audience, so those findings were resolved without adding repository setup to package-based instructions. Also remove obsolete cross-sample links and repository-location claims from the portable README/media guidance. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac8c4892-07f6-42af-bc04-ef56eec95b1b
Run generated browser samples with Playwright (#5312) Context: #5308 Context: #5291 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1633875 Validate package-consuming sample applications through their actual browser UIs while keeping the test runner backed by repository source. Extend the generated-sample foundation with browser interactions, reviewed screenshots and explicit execution lifetimes rather than synthetic rendering apps. Carry forward the browser slice of #5291 above the merged #5308 foundation. Keep HTTP image checks independent of browser page checks, and retain the separate Integration/MSBuild suites and their existing references. ~~ Exercise the generated applications, not substitute scenes ~~ Add named runtime facts for Basic Web, BrowserWebAssembly, Blazor CPU/GPU and Drawing, and Uno CPU/Drawing. Build and launch generated copies against the staged producing package cohort; the runner retains its SkiaSharp ProjectReference and native import. Add BrowserWebAssembly's native-assets project reference so generation also supplies its SkiaSharp.NativeAssets.WebAssembly package dependency. Extend the artifact-contract theory to check that generated reference. Blazor Drawing selects colors and brush size, creates pointer strokes, checks their pixels and clears them. Uno selects its declared net10.0-browserwasm project target, waits beyond the splash screen, exercises Drawing navigation and strokes, clears the canvas and returns to CPU rendering. Its readiness check requires the rendered blue/purple scene, not merely an existing canvas. ~~ Own browser lifetime and retain errors across operations ~~ BrowserRunningApp wraps the existing RunningApp rather than introducing another server lifecycle. Callback completion disposes the browser context and Chromium; the enclosing host callback retains process cleanup and logs. Reuse the host's cached address and same-origin request validation for browser navigation. Recognize BrowserWASM's "App url:" output alongside "Now listening on:", accepting HTTP on 127.0.0.1 with a nonzero port. Collect console errors and page exceptions across the callback. Assert after navigation, element waits, screenshots and callback completion so errors between operations or direct Page interactions cannot disappear. Sentinel regressions verify multiple console errors and asynchronous page exceptions. Retain a failure screenshot when execution fails before its first normal capture. ~~ Distinguish stable pixel goldens from animated GPU smoke checks ~~ Capture full pages with a 1280x900 viewport, device scale 1 and light color scheme. Add nine reviewed page references for each of Linux, macOS and Windows, including drawn and cleared states. Consolidate ValidateFile, SaveAndValidate and CompareGolden into file and byte-array SampleImage.Validate overloads with SampleImageOptions. Save supplied bytes before checking the PNG signature, then compare dimensions and pixels. ExpectedSize preserves fixed-size HTTP and Console assertions; omitted options retain the 0.075% differing-pixel budget with zero channel tolerance. Missing references fail without creating replacements. The animated Blazor GPU page instead uses a 6% mean absolute RGBA error, normalized by pixel count, four channels and 255. This replaces, rather than supplements, the differing-pixel criterion. It is a coarse smoke check: uniform dark output can pass, and arbitrary animation frames are not strict rendering goldens. Do not freeze the sample clock or infer deterministic frame equivalence from this result. Regression tests cover explicit pixel budgets, alpha-inclusive mean error, the exact 6% boundary and rejection one channel step beyond the boundary. ~~ Preserve diagnostic snapshots instead of masking image failures ~~ Actual and expected captures can share a basename, and a capture may be attached more than once. Duplicate xUnit attachment names could obscure the real pixel mismatch with an attachment exception. Give expected images an expected- prefix and assign repeated names numeric suffixes in SampleArtifacts. Keep actual, expected and diff evidence distinct while retaining the existing 8 MiB embedding limit and on-disk artifacts. Regressions exercise same-basename mismatches and repeated diagnostic snapshots. ~~ Select declared frameworks without retargeting dependencies ~~ Use one optional DotNetOptions record across BuildSample, DotNet.Build and callback-based DotNet.Run; name raw command execution Execute. Options cover configuration, framework, additional properties, working directory and timeout, with Release remaining the sample default. Pass framework selection through --framework rather than overriding TargetFramework or TargetFrameworks. Protect configuration and helper-owned restore properties from additional-property overrides. A compiling regression selects net10.0-windows while referenced projects retain their netstandard2.1 and net10.0 targets. Keep inherited PATH selection and private consumer caches. Preserve 30-minute build and one-minute raw-command defaults. A run timeout controls address and exit waits, not callback duration or browser-operation waits; cleanup and output reads retain their one-minute bounds. Tests cover property forwarding, working directories, argument boundaries, invalid options and cleanup after timed-out waits. ~~ Make build coverage and runtime coverage independently visible ~~ Combine the former BasicSampleTests and GallerySampleTests compilation theories in SampleBuildTests. Retain Console and HTTP execution in BasicSampleRunTests, put ordinary browser execution in BrowserSampleRunTests and isolate Uno's framework-specific startup in UnoBrowserSampleRunTests. Split DockerSampleTests into DockerSampleBuildTests and DockerSampleRunTests. Both retain the Docker execution group: an image build requires a daemon even though it is compilation coverage. Browser facts and browser-error regressions use Host; infrastructure and generated compilation remain Build. Discovery regressions check eligible Basic/Gallery cases and the shared Docker fixture. ~~ Separate sample preparation from Docker resource ownership ~~ Replace Utils/SampleTestBase with root-level DotNetSampleTestBase and add DockerSampleTestBase beside the test classes. The .NET base owns its prepared workspace; the Docker base stages a flat selected-sample context, local packages and relative NuGet feed, then deletes that context after building. Do not impose common inheritance on these different workspace lifetimes. Reuse SampleWorkspace.CopyTree instead. Context tests check selected inputs, excluded bin/obj directories, package staging and an empty-cohort failure. DockerSampleFixture retains daemon policy, cached images, registered tags, container callbacks and resource cleanup. Register a tag before its build and cache it after success. Share the fixture across Docker build/run classes so the split does not create independent image caches. Put CLI syntax and command bounds behind named Docker operations such as Ps, Build, Run, Port, Wait and Logs. Fixture and running-app code call those operations rather than constructing argument arrays. ~~ Serialize shared resources without blocking unrelated collections ~~ Remove AssemblyInfo.cs's assembly-wide DisableTestParallelization setting. BrowserSampleRunTests and UnoBrowserSampleRunTests share one serial browser collection; Docker build/run classes share another for their mutable image cache and resource registry. Neither collection sets DisableParallelization=true, so unrelated collections can run concurrently. Normal xUnit serialization within a class or collection still applies, including SampleBuildTests theory rows. A reflection regression checks the assembly policy, browser assignments and nonexclusive collection definitions. ~~ Install the matching browser at the CI execution boundary ~~ Add Microsoft.Playwright 1.55.0 and a CI-only pre-test Chromium installation target. Pass SampleRunGroup from Cake so Host and unfiltered runs install Chromium, while Build and Docker groups do not. Keep local installation an explicit documented prerequisite rather than a fixture or discovery download. Preserve the canonical eight Samples jobs and existing provisioning. Build 1633875 succeeded for source ffb7ec0 through merge 97bfa39. Samples results were Linux Build 134, Host 14 and Docker 4; macOS Build 140 and Host 14; Windows Build 141, Host 14 and Docker 4. Those completed groups reported zero failures and skips. Windows Host passed on its second attempt without a source change after WebSampleReturnsImage exceeded the existing four-second HTTP timeout. This records a successful retry, not a timeout fix or proof that the failure cannot recur. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot App <[email protected]>
Description
Replace Cake's sample build loops and the standalone MSBuild and Integration runners with one ordinary repository test project,
SkiaSharp.Tests.Samples. Generate package-referenced inputs first, then run the project fromdotnet test, Visual Studio, or VS Code. Each test prepares only its selected sample and ancestor configuration in an owned working directory, executes real child commands, retains diagnostics, and cleans its own resources. The runner imports normal repository test settings; consumer workspaces—not the runner—fence repository build imports.The runner SDK, consumer SDK, and declared project TFMs remain independent. Local consumer commands inherit the repository's SDK section; CI supplies an exact override and runs six Windows/macOS/Linux × SDK10/SDK11 profiles without retargeting samples. Standard
UseDotNet@2tasks acquire SDKs; one pinned workload helper installs Microsoft workloads and handles Samsung/Tizen separately. Samsung manifests are registered beside the PATH-selected executable, including when inheritedDOTNET_ROOTpoints elsewhere. SDK-only jobs do not install workloads. CI excludesDevice,Desktop,Golden; local runs include those cases by default, with exact device/OS prerequisites declared in theories instead of MSBuild properties or automatic fallback. The website side-build retains its original unpinneddotnet workload install wasm-toolstask.Actual console, Docker, Web, BrowserWebAssembly, and BlazorWebAssembly samples execute rather than merely compile. Preserve all 48 native package-output cases, existing generated MAUI/Blazor view probes, and five reference PNGs with the unchanged 95% comparator. Gallery remains build-only. Remove unused signing assets and retired release-test orchestration.
The branch includes the landed recovery from #5302: approved Gallery MAUI feeds, Linux/serialized GTK4 tests, and bounded fontconfig retries. It also includes normal merges of the independently extracted provisioning #5307, now landed on main, and WASM alignment #5306. Latest peer head
7dd7eb08d4c6539000523d3946a83f73773beff8and maina38df398fbe8f2fa97d07f81fa50403e9fd37b50are ancestors of current headf7640ff545bf366881a61f276920e6409fd543e0. That last merge changed ancestry only: its tree exactly matches the previously validated combined implementation.The SDK11 lane pins SDK
11.0.100-rc.1.26425.128and workload set11.0.100-rc.1.26460.1, as directed after the approved mirror lacked required Preview 6 host packs. No feed was added. .NET11+ WASM references select Emscripten 6.0.2; the source-build matrix, both artifact mergers and all four source/package targets agree. Obsolete 5.0.6 preview build/merger inputs are removed. Net8 retains 3.1.34 and net9/net10 retain 3.1.56. SDK11 builds unchanged net10 samples with backward-targeting workloads, includingwasm-tools-net10; its macOS sample profile uses exact Xcode 26.6.Sample orchestration no longer uses MTP 1.9.1's HangDump controller, which falsely reported inactivity and crashed after a previous macOS SDK11 run passed its tests. Existing child-command deadlines and the 180-minute CI job limit remain; core HangDump defaults are unchanged. Windows owned-directory cleanup briefly retries logged sharing/access-denied errors while terminated descendants release DLL handles; persistent failures still fail. This fixes the observed
BrowserDebugProxy.dllteardown failure without changing rendering or suppressing a failing assertion.A separate Samples foundation #5308 is being developed below the eventual consolidation. Its later user-directed helper/runtime refinements are not yet integrated here. The green evidence below applies only to this PR's exact current head, not the foundation's latest code or its currently skipped producing-CI gate.
Related issues
None.
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
Public API
None — public C# APIs and ABI are unchanged. No C API or Skia submodule change.
Behavior
.NET11+ WASM references select Emscripten 6.0.2 archives; net8/net9/net10 selections remain unchanged. Developer test entry points and CI provisioning change. Console output and Web API fixture conventions support real sample execution; declared frameworks and separate Docker images are retained. Production rendering, existing reference PNGs and comparison tolerance are unchanged.
Testing
Current-head CI — passed
Public build 1628893 succeeded, finishing
2026-10-09T01:21:56.104734Z. Its source merge isa4a9680d7623cf83a6b45aa10dfadfb8b52d2571; recordedpr.sourceShais exact pushed headf7640ff545bf366881a61f276920e6409fd543e0. Current-head GitHub checks: 118 passed, none pending or failed; conditional site/deployment checks are skipped.All six sample jobs ran and succeeded against that producing build's canonical package cohort (
pr.5291.26508.18). The net10 runner remained net10 in both consumer SDK profiles.macOS qualification: each macOS job's four unexecuted cases are exactly the two Docker image-build and two Docker runtime theories. The existing Docker-availability probe skips them on these hosted agents. Docker build/run/HTTP assertions passed on both Windows and Linux SDK profiles and locally on macOS; this is not hosted-macOS Docker execution evidence. No new skip, GPU policy change, tolerance increase or golden update was added to obtain this green build.
Native/managed builds, package assembly/scanning, core desktop/framework/mobile tests and stable/preview WASM jobs also succeeded. Current producing CI validates the source-built/cached-identical-input native archives and actual net11 WASM host; old local packages are not substituted for the new toolchain.
Coverage contract
Host-specific solution variants determine build eligibility. Docker images remain net10 in both SDK profiles.
sample.httprequests and decoded PNG responsesDevice/Desktop; not actual Basic MAUI navigationGolden; base reference unchangedExact local commands and results
Local sample runs use the 41 non-symbol packages from exact public build 1624468, with matching generated references
pr.5291.26505.69. This older net10/3.1.56 package cohort is not .NET11/6.0.2 linking proof. User SDK installations/caches and unrelated containers were not modified.Passed: 131, skipped: 0, duration: 47m07s. Full local CI-selected combined suite on main-merged
6dd2c81f2373b763165bdc2e1d4e8ffb35b4c5de, including actual sample builds/runtime/browser/Docker checks and all package-output cases.Passed: 101, skipped: 0, duration: 4m39s. Integrated peer-branch infrastructure, native smoke and all original 48 package-output cases. The subsequent
f7640ffmain/peer merge has an exactly identical tree.Passed: 5 rows, skipped: 0, duration: 29s. Eighty actual MSBuild item-selection evaluations across four source/package targets and threading/SIMD combinations. Dummy archives are selection fixtures, not native-linking proof.
Earlier focused commands retained in the session evidence:
Passed: 47/47 and 12/12 respectively, zero skips. Default IDE input/isolation/artifact-byte identity checks; actual browser/console/Docker execution and unchanged host/container/browser goldens. The earlier infrastructure count predates five new target-selection rows and the cleanup regression. Exact iPhone 16 Pro/iOS26.2 CPU/GL generated-view goldens also passed 2/2 during the refactor. Newly rewritten exact Android prerequisites and Windows desktop execution have not been validated locally on this Mac.
cd scripts/infra/samples DEVELOPER_DIR=/Applications/Xcode-26.6.0.app/Contents/Developer dotnet cake samples.cake --target=samples --exclusive --previewLabel=pr.5291 --buildNumber=26505.69 --sampleTestExcludeCategories=Device,Desktop,Golden,SampleBuild,DockerBuild,SampleRun,BrowserPassed: 95, skipped: 0, warnings/errors: 0 at the earlier orchestration revision. The real shared invocation retained TRX/category options and omitted only the Samples HangDump controller.
The final workload helper was exercised in fresh owned installations with the repository-approved feeds:
Passed in isolated PATH-selected SDK contexts with owned CLI home/NuGet caches.
dotnet --version,dotnet workload --versionanddotnet workload listverified exact SDK/set/IDs. A real divergent-DOTNET_ROOTrepro failed before the executable-root fix and passed afterward. RC1 6.0.2/net11 and backward 3.1.56/net10 packs were verified. No additional feeds were used; owned temporary installations/caches were cleaned.Local core limitation — not hidden
dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0Earlier Debug run failed locally: 6,336 passed, 23 existing skips, three managed-stream GC/handle assertions plus the recorded macOS ARM64
ganesh-gl/DiagonalLinesvisual mismatch.DEVELOPER_DIR=/Applications/Xcode-26.6.0.app/Contents/Developer dotnet test tests/SkiaSharp.Tests.Console.slnx -c Release -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0Final main-merged local Release run failed: 6,338 core cases passed, 24 existing skips, one identical pre-existing
ganesh-gl/DiagonalLinesmismatch. Singleton initialization, Gallery (50), Vulkan and Direct3D hosts passed under existing policies. Current cloud core gates passed; that does not erase the local limitation. No GPU skip, existing golden or tolerance was changed.python3 scripts/infra/caching/repo-deps.py validate— passed, zero uncovered files.python3 -m unittest discover -s scripts/infra/docs/release_notes/tests -p 'test_*.py'— passed.pwsh -NoLogo -NoProfile -File scripts/infra/publishing/tests/Test-PublishingScripts.ps1andpwsh -NoLogo -NoProfile -File scripts/infra/publishing/tests/Test-ReleaseMilestones.ps1— passed.YAML parsing, workload-helper PowerShell syntax, merged native-matrix equality, helper/template parity and
git diff --check— passed. The website workflow YAML/task assertions passed when its original floating install was restored.This PR remains draft and has not been merged or marked ready by the agent.
Checklist
Changesabove lists all public API and behavioral changes (or "None.")///documentation and regenerated bindings when applicablemono/skiaPR linked above and bindings regenerated