Skip to content

[release/10.0.1xx] [msbuild] Fix transitive AOT incremental invalidation. Fixes #26608 - #26618

Merged
rolfbjarne merged 2 commits into
release/10.0.1xxfrom
dev/rolf/backport-pr-26616-release/10.0.1xx-2026-09-15
Sep 16, 2026
Merged

rolfbjarne merged 2 commits into
release/10.0.1xxfrom
dev/rolf/backport-pr-26616-release/10.0.1xx-2026-09-15

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

AOTCompile only propagated an out-of-date dependency while first visiting that dependency. If another referencing assembly encountered the same dependency after Tarjan's traversal had completed it, the referencing assembly incorrectly retained stale AOT output.

Propagate the dependency's out-of-date state after its traversal has completed as well, so incremental AOT compilation no longer depends on assembly traversal order.

Add a focused unit test with two assemblies sharing one stale dependency. The test verifies that both referencing assemblies are selected for recompilation.

Fixes #26608.

πŸ€– Pull request created by Copilot

Backport of #26616.

Propagate an out-of-date state from assembly references that Tarjan's traversal has already completed and removed from its stack. This prevents referencing assemblies from retaining stale AOT output based solely on traversal order.

Add a focused task test with two assemblies sharing one stale dependency, verifying that both referencing assemblies are selected for recompilation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 666b62eb-0b6a-41d2-9861-a5669ae6b9d9
Keep the regression assertion nullable-aware so a missing FileWrites output produces a normal NUnit mismatch instead of bypassing nullability analysis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 666b62eb-0b6a-41d2-9861-a5669ae6b9d9
Copilot AI lite review requested due to automatic review settings September 15, 2026 18:19

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.

🟑 Changes recommended

Consolidate duplicated stale-state propagation logic in AOTCompile.cs before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes order-dependent incremental AOT invalidation and adds regression coverage for shared stale dependencies.

Changes:

  • Propagates stale state for already-visited dependencies.
  • Adds a test verifying both referencing assemblies are recompiled.
File summaries
File Description
msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs Updates dependency traversal invalidation.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/AOTCompileTests.cs Tests shared stale dependency handling.
Review details

Suppressed comments (1)

msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs:137

  • ❌ bug β€” This propagation can leave a strongly connected component partially marked up-to-date. For input order [C, A, B] with A -> B, A -> C, and B -> A, C is popped first; this branch marks A stale, but the SCC scan stops before including the root A, so B remains up-to-date and its stale AOT output is retained. Include the root in the SCC aggregate and add a regression test covering a cycle with an already-visited stale dependency.
				} else if (info.IsUpToDate && !referenceInfo.IsUpToDate) {
					Log.LogMessage (MessageImportance.Low, $"The assembly {assemblyPath} is not up-to-date with regards to the reference {referenceInfo.TaskItem.ItemSpec}.");
					info.IsUpToDate = false;
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… API diff for current PR / commit

NET (empty diffs)

βœ… API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: c8dbac63f9166162d1f8adc4a3e8ea1a26a5e5fd [PR build]

@rolfbjarne
rolfbjarne enabled auto-merge (squash) September 15, 2026 19:49
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

πŸš€ [CI Build #c8dbac6] Test results πŸš€

Test results

βœ… All tests passed on VSTS: test results.

πŸŽ‰ All 195 tests passed πŸŽ‰

Tests counts

βœ… assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
βœ… cecil: All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
βœ… framework: All 2 tests passed. Html Report (VSDrops) Download
βœ… fsharp: All 4 tests passed. Html Report (VSDrops) Download
βœ… generator: All 5 tests passed. Html Report (VSDrops) Download
βœ… interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
βœ… introspection: All 4 tests passed. Html Report (VSDrops) Download
βœ… linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
βœ… linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
βœ… linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
βœ… linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
βœ… monotouch (iOS): All 19 tests passed. [attempt 2] Html Report (VSDrops) Download
βœ… monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
βœ… monotouch (macOS): All 21 tests passed. Html Report (VSDrops) Download
βœ… monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
βœ… msbuild: All 2 tests passed. Html Report (VSDrops) Download
βœ… sharpie: All 1 tests passed. Html Report (VSDrops) Download
βœ… windows: All 3 tests passed. Html Report (VSDrops) Download
βœ… xcframework: All 4 tests passed. Html Report (VSDrops) Download
βœ… xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

βœ… Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
βœ… Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
βœ… Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
⚠️ Tests on macOS Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

βœ… Linux build succeeded

Pipeline on Agent
Hash: c8dbac63f9166162d1f8adc4a3e8ea1a26a5e5fd [PR build]

@rolfbjarne
rolfbjarne merged commit 4c47339 into release/10.0.1xx Sep 16, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/backport-pr-26616-release/10.0.1xx-2026-09-15 branch September 16, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants