Repository navigation
[release/10.0.1xx] [msbuild] Fix transitive AOT incremental invalidation. Fixes #26608 - #26618
Conversation
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
There was a problem hiding this comment.
π‘ 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]withA -> B,A -> C, andB -> A,Cis popped first; this branch marksAstale, but the SCC scan stops before including the rootA, soBremains 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
β API diff for current PR / commitNET (empty diffs)β API diff vs stableNET (empty diffs)βΉοΈ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
π [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 macOS testsβ
Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
AOTCompileonly 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.