Add cross-OS Gradle cache fallback for Windows bootstrap#35067
Closed
PureWeen wants to merge 1 commit into
Closed
Conversation
The official build on release/10.0.1xx-sr6 (build 2956987) fails on Pack Windows because no Windows-specific Gradle cache entry exists for this branch scope. The macOS cache is populated but Windows gets a cache miss, causing Gradle to hit repo.maven.apache.org which is blocked by CFSClean network isolation policy. Adding an OS-independent fallback restore key allows Windows to bootstrap from the macOS-populated cache. Gradle dependencies are predominantly platform-independent Java JARs. The only OS-specific artifact (aapt2) is resolved by Maven classifier — Gradle will not use the macOS binary on Windows, it will attempt to download the Windows variant separately. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35067Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35067" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the shared Gradle caching template used by MAUI’s Azure DevOps pipelines to improve Windows “bootstrap” behavior when an OS-specific Gradle cache entry doesn’t exist in the available cache scope.
Changes:
- Add an OS-independent Gradle cache
restoreKeysfallback ("gradle" | "v1") so Windows agents can restore from any available Gradle cache entry (e.g., one produced on macOS) when Windows-specific keys miss.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Problem
The official build on
release/10.0.1xx-sr6(build 2956987) still fails on Pack Windows with Gradle errors despite #35049. The root cause: no Windows-specific Gradle cache entry exists for therelease/10.0.1xx-sr6branch scope.The cache log shows:
Meanwhile Pack macOS succeeds because a macOS cache entry exists from
mainbranch scope. Without a Windows cache, Gradle attempts to download fromrepo.maven.apache.org, which is blocked by CFSClean network isolation:Fix
Add an OS-independent fallback restore key (
"gradle" | "v1") tocache-gradle.yml, allowing Windows to bootstrap from the macOS-populated cache when no Windows-specific entry exists.Why this is safe (addressing @jonathanpeppers's earlier concern from #35049)
The concern was that restoring a macOS Gradle cache on Windows could cause
aapt2native binary crashes, sinceaapt2is published with OS-specific Maven classifiers (aapt2-*-osx.jarvsaapt2-*-windows.jar).This is not a risk because:
aapt2by classifier — it will never use the macOS binary on Windows. It would attempt to download the Windows variant separately.kotlin-stdlib,jna-platform,juniversalchardet,javax.annotation-api, AndroidX, etc.) are pure Java JARs that are byte-identical across platforms.Net effect: Cross-OS fallback gives Windows ~95% of cached deps (all Java JARs). The only gap is
aapt2-windows.jar, which still needs Maven Central access. This is strictly better than the current complete cache miss.Cross-checked with Claude Sonnet 4.6, GPT Codex 5.3, and Goldeneye — all agree Gradle self-heals on incompatible cache entries (cache miss → regenerate, not crash).
Long-term fix
Request
repo.maven.apache.orgto be added to CFSClean allowlist. This cache fallback is a bridge until that happens.