Repository navigation
Fix ANGLE WinAppSDK download failure on 1ES agents - #4014
Merged
Merged
Conversation
The DevDiv internal 1ES agents block Python's urllib from making outbound HTTPS connections (WinError 10013), causing the ANGLE WinUI build to fail when winappsdk_setup.py tries to download the Microsoft.WindowsAppSDK NuGet package from nuget.org. Replace the call to ANGLE's winappsdk_setup.py with a pure cake implementation that: - Downloads the .nupkg from the dnceng dotnet-public feed using Cake's DownloadFile (which uses .NET's HTTP stack) - Extracts it with Unzip - Processes WINMD files with winmdidl.exe directly - Processes IDL files with midlrt.exe directly This eliminates the Python network dependency entirely and uses a feed (pkgs.dev.azure.com/dnceng) accessible from internal agents. Co-authored-by: Copilot <[email protected]>
Contributor
📦 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 -- 4014PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4014"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4014/packages --name skiasharp-pr-4014More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4014 |
Contributor
|
📖 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. |
The midlrt.exe tool needs the C preprocessor (cl.exe) to process IDL files. Without it in PATH, it fails with MIDL1005. Pass /cpp_cmd with the full path to cl.exe found via VS_INSTALL. Also fix the outer guard to check for the actual generated header file instead of the nuspec, so retries after partial failures still attempt header generation. Co-authored-by: Copilot <[email protected]>
The /cpp_cmd flag doesn't handle paths with spaces properly. Instead, temporarily add the cl.exe directory to PATH so midlrt can find it naturally. Also fix IDL path construction to avoid doubled drive letters. Co-authored-by: Copilot <[email protected]>
…ulation Generate a temp batch script with all winmdidl + midlrt commands and run it under vcvarsall.bat, matching the original approach where Python was invoked through the vcvarsall wrapper. This ensures the full MSVC environment is set up correctly (cl.exe on PATH, include dirs, etc.) without relying on wildcards to find specific tool directories. Co-authored-by: Copilot <[email protected]>
Replace dynamically-generated batch code with a checked-in script that takes win_sdk_bin, include_dir, and lib_dir as arguments. The cake file now simply invokes it through vcvarsall.bat. This is easier to read, debug, and maintain. Co-authored-by: Copilot <[email protected]>
The ps1 script takes just the WinAppSDK root path and finds the Windows SDK tools itself. This simplifies the cake invocation to a single argument and makes the script self-contained and easier to maintain. Co-authored-by: Copilot <[email protected]>
midlrt resolves imported IDL files relative to CWD. Use Push-Location to set the working directory to the include path before running midlrt, matching the original Python script behavior (subprocess.run with cwd=include). Co-authored-by: Copilot <[email protected]>
mattleibow
force-pushed
the
mattleibow/dev-fix-angle-winappsdk-download
branch
from
May 20, 2026 18:52
0942487 to
7789969
Compare
WinAppSDK 1.4 has additional namespaces (e.g. Microsoft.UI.Content) that weren't in 1.3. Instead of maintaining a hardcoded IDL list, enumerate all .idl files generated by winmdidl and run midlrt on each. This makes the script forward-compatible with newer WinAppSDK versions. Co-authored-by: Copilot <[email protected]>
The WINMD list was still hardcoded, missing files like Microsoft.Windows.ApplicationModel.Resources.winmd that exist in the 1.4 package. Now both WINMD discovery and IDL processing are fully dynamic. Co-authored-by: Copilot <[email protected]>
Some IDL files (e.g. Microsoft.Windows.ApplicationModel.Resources) reference metadata from external packages that midlrt cannot resolve, causing MIDL9008 errors. Instead of aborting, create empty stub headers so downstream #includes don't fail — ANGLE doesn't use types from these namespaces. Co-authored-by: Copilot <[email protected]>
mattleibow
added a commit
that referenced
this pull request
May 22, 2026
…ne (#4045) [CI] Fix native build failures on release/3.119.x (#4045) Context: #4014, #4022, #3743, #4013 Four independent CI failures were blocking all builds on the 3.119.x release branch. Each fix is backported from main and adapted to the older file layout (scripts/ vs scripts/infra/). ~~ ANGLE WinAppSDK download (WinError 10013) ~~ DevDiv 1ES agents block Python's urllib from making outbound HTTPS connections. Replace the winappsdk_setup.py invocation with a Cake DownloadFile() from dnceng's dotnet-public feed, followed by a new PowerShell script (generate_winappsdk_headers.ps1) that runs winmdidl + midlrt to produce the C++ headers ANGLE needs. ~~ WASM Emscripten 2.0.6 hang ~~ The 2.0.6 build intermittently hangs in CI. No .NET release ever consumed this version — it was a legacy artifact from early experimentation. Remove it from the matrix and merge lists. ~~ Tizen SDK 6.1 permanently broken ~~ Samsung rebranded Tizen Studio to Tizen SDK starting with version 10.0 and the old 6.1 Certificate-Manager package fails deterministically with NoClassDefFoundError. Update to SDK 10.0 with the new URL pattern. ~~ Alpine apk.static transient download failures ~~ GitLab returns intermittent HTTP 5xx for apk.static. Without --fail, curl silently saves the error body and the script tries to chmod +x a JSON string. Add --fail --retry 5 --retry-delay 10 --retry-all-errors. Co-authored-by: Copilot <[email protected]>
mattleibow
added a commit
that referenced
this pull request
May 22, 2026
…ne (#4045) [CI] Fix native build failures on release/3.119.x (#4045) Context: #4014, #4022, #3743, #4013 Four independent CI failures were blocking all builds on the 3.119.x release branch. Each fix is backported from main and adapted to the older file layout (scripts/ vs scripts/infra/). ~~ ANGLE WinAppSDK download (WinError 10013) ~~ DevDiv 1ES agents block Python's urllib from making outbound HTTPS connections. Replace the winappsdk_setup.py invocation with a Cake DownloadFile() from dnceng's dotnet-public feed, followed by a new PowerShell script (generate_winappsdk_headers.ps1) that runs winmdidl + midlrt to produce the C++ headers ANGLE needs. ~~ WASM Emscripten 2.0.6 hang ~~ The 2.0.6 build intermittently hangs in CI. No .NET release ever consumed this version — it was a legacy artifact from early experimentation. Remove it from the matrix and merge lists. ~~ Tizen SDK 6.1 permanently broken ~~ Samsung rebranded Tizen Studio to Tizen SDK starting with version 10.0 and the old 6.1 Certificate-Manager package fails deterministically with NoClassDefFoundError. Update to SDK 10.0 with the new URL pattern. ~~ Alpine apk.static transient download failures ~~ GitLab returns intermittent HTTP 5xx for apk.static. Without --fail, curl silently saves the error body and the script tries to chmod +x a JSON string. Add --fail --retry 5 --retry-delay 10 --retry-all-errors. Co-authored-by: Copilot <[email protected]>
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.
Problem
The ANGLE WinUI build fails on internal DevDiv CI (1ES agents) because Python's
urllibis blocked from making outbound HTTPS connections (WinError 10013). The existingwinappsdk_setup.pyscript downloads a NuGet package using Python's HTTP stack, which doesn't work on restricted agents.Root Cause
DevDiv 1ES hosted agents block Python.exe from making outbound HTTPS socket connections. .NET's HTTP stack works fine on the same agents. This started affecting builds when the agents were updated — it's not related to any code change.
Solution
Replace the Python-based WinAppSDK download and header generation with:
Cake-based download — Downloads the NuGet package from the dnceng
dotnet-publicfeed using .NET'sDownloadFile(), which isn't blocked on 1ES agents. Version is read fromVERSIONS.txtviaGetVersion().PowerShell header generation script (
generate_winappsdk_headers.ps1) — A checked-in, self-contained script that:-Pathargument (WinAppSDK NuGet root)winmdidl.exe,midlrt.exe) automatically.winmdfiles and processes them (no hardcoded lists).idlfiles and runsmidlrton eachmidlrtcan't process an IDL (e.g. external package dependencies likeMicrosoft.Windows.ApplicationModel.Resources)vcvarsall.batsomidlrtcan findcl.exeKey Design Decisions
Get-ChildItem -Recurse, making the script forward-compatible with newer WinAppSDK versions without maintenance.cl.exeis on PATH (required bymidlrt).Files Changed
native/winui-angle/build.cake— Replaced Python script invocation with Cake download + PS1 invocationnative/winui-angle/generate_winappsdk_headers.ps1— New self-contained PowerShell script for header generation