Skip to content

[release/11.0.1xx] Preserve AAR consumer rules on cache hits - #13077

Merged
simonrozsival merged 1 commit into
release/11.0.1xxfrom
simonrozsival-aar-rule-backport
Oct 12, 2026
Merged

simonrozsival merged 1 commit into
release/11.0.1xxfrom
simonrozsival-aar-rule-backport

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

This backports the AAR consumer-rule cache-hit fix from #13061. When the app project timestamp changes, _ResolveLibraryProjectImports reruns but unchanged AARs skip extraction; the cache-hit path must still collect the existing proguard.txt so the cache and subsequent R8 --pg-conf arguments retain the consumer rules.

Related issue: #12965.

Validation:

  • ./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj -c Debug -v minimal — passed, 0 errors.
  • Before the fix, ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "Name~AarConsumerRulesRemainInR8ConfigurationAfterAppProjectTimestampChange" — failed as expected because the cache contained no AAR rules.
  • After the fix, DOTNET_ROOT="$PWD/bin/Debug/dotnet" ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "Name~AarConsumerRulesRemainInR8ConfigurationAfterAppProjectTimestampChange" — passed, 1/1.
  • The combined AAR/AAPT/ResolveLibraryProjectImportsCoreCLR filter passed 2 tests; the CoreCLR selector did not match. A separate DOTNET_ROOT="$PWD/bin/Debug/dotnet" ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "Name~ResolveLibraryProjectImports" run passed for CoreCLR. NativeAOT restore was blocked because exact RC2 packages at 11.0.0-rc.2.26475.136 are unavailable (nearest ILCompiler package .137).

The pinned servicing SDK 11.0.100-rtm.26480.113 could not be downloaded. These tests used the installed .NET 11 RC2 SDK with a temporary local pack overlay, which was removed after validation. make leeroy was not run.

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

Keep extracted AAR proguard.txt entries in the imports cache when the resolver takes the unchanged-AAR path, and cover the incremental R8 flow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 08:18
@simonrozsival simonrozsival changed the title [Xamarin.Android.Build.Tasks] Preserve AAR consumer rules on cache hits [release/11.0.1xx] Preserve AAR consumer rules on cache hits Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The fix matches cold-extraction behavior and includes focused regression coverage; only an optional deduplication suggestion remains.

1 open finding
What changed in this PR

Backports the AAR cache-hit fix so incremental builds retain consumer ProGuard rules for R8.

Changes:

  • Restores existing proguard.txt entries on AAR cache hits.
  • Adds regression coverage for cache preservation and R8 inputs.
File Description
IncrementalBuildTest.cs Tests consumer-rule preservation after timestamp changes.
ResolveLibraryProjectImports.cs Rehydrates ProGuard configuration on cache hits.

🧠 Review effort: Balanced

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Oct 12, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

@dalexsoto review

@simonrozsival
simonrozsival enabled auto-merge (squash) October 12, 2026 11:41
@simonrozsival
simonrozsival merged commit c6d965b into release/11.0.1xx Oct 12, 2026
45 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-aar-rule-backport branch October 12, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants