[release/10.0.1xx-sr6] Cache Gradle downloads between CI runs to avoid transient failures - #35016
Merged
PureWeen merged 4 commits intoApr 17, 2026
Conversation
Add a shared cache-gradle.yml template using Cache@2 to persist ~/.gradle/caches between pipeline runs. This prevents transient DNS/network failures from breaking builds when Gradle resolves Maven Central dependencies during Android binding compilation. The cache key includes Agent.OS, gradle-wrapper.properties, and build.gradle files so it auto-invalidates on Gradle version or dependency changes. Adapted from dotnet/android: 0a681023be145d62d0d55a6e49bfc7f2b9aac86f Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…, fix display names - Add settings.gradle and gradle.properties to cache key to avoid stale cache when repository config or Jetifier flag changes - Cache entire ~/.gradle (not just caches/) to include wrapper/dists and avoid transient failures downloading the Gradle distribution itself - Guard cache template with skipAndroidCommonSdks so non-Android jobs (iOS, MacCatalyst, Windows) skip the cache steps entirely - Disambiguate step display names for Linux/macOS vs Windows - Add intermediate restoreKeys entry keyed on gradle-wrapper.properties so dependency-only changes still get a partial cache hit - Document the v1 version segment as the manual cache-bust mechanism Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The RunOnAndroid integration test job doesn't invoke Gradle directly, so ~/.gradle is never created. When Cache@2 runs its post-job save, tar fails with 'No such file or directory' (exit code 2). Pre-create the directory in the variable-setting steps so the post-job save always has a valid (possibly empty) directory to tar. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback from @jonathanpeppers: use YAML folded scalar (>-) to split the long cache key string across multiple lines, one per file segment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run maui-pr-uitests, maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
This was referenced Apr 17, 2026
Open
Closed
PureWeen
added a commit
that referenced
this pull request
Apr 21, 2026
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Problem The official build (`dotnet-maui`, definition 1095) for `release/10.0.1xx-sr6` has been failing with Gradle network errors on Windows: ``` Permission denied: getsockopt Could not GET https://repo.maven.apache.org/maven2/... gradlew.bat exited with code 1 ``` Build [2954057](https://dev.azure.com/dnceng/internal/_build/results?buildId=2954057) failed even though it included the Gradle cache fix from PR #35016. The cache step was added to `provision.yml`, but the official Pack job uses `pack.yml` directly — which never calls `provision.yml`. ## Fix Add the same `cache-gradle.yml` template call to `eng/pipelines/common/pack.yml` before the pack step, matching the pattern already used in `provision.yml`. ## Impact This unblocks the 10.0.60 official build by ensuring the Gradle dependency cache is warm before the Pack step invokes Gradle on Windows agents with network isolation. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Backport of #34804 to release/10.0.1xx-sr6
/cc @PureWeen