Repository navigation
[release/11.0.1xx] [tests] Prevent concurrent MonoTouch.Dialog builds. Fixes #26688 - #26827
Conversation
The app-level test target forwarded HotReloadCompatibleBuild=false to direct project references even though false is already the default for libraries. Indirect references then reached MonoTouch.Dialog without that global property, causing concurrent MSBuild project instances to compile and copy the same output. Only propagate true so compatible builds still define HOTRELOAD_COMPATIBLE_BUILD across referenced projects without splitting non-compatible builds into separate instances.\n\nFixes #26688 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Forwarding the true value only from app projects still left transitive libraries with a different global-property set. When another path reached the same library without HotReloadCompatibleBuild, both project instances could write the same outputs. Forward true from any project that received it, while leaving false unset so non-hot-reload builds continue to deduplicate.\n\nFollow-up to #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
MSBuild evaluates a target's Condition before its DependsOnTargets list. Moving the true check onto the ItemGroup ensures that an app whose hot-reload compatibility is computed by the SDK forwards the value after computation, while false and unset values leave project-reference metadata unchanged.\n\nCompletes the build-graph race fix for #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add a focused MSBuild metadata regression test for both application and transitive library contexts. It simulates the SDK computing HotReloadCompatibleBuild after project evaluation, asserts that true is forwarded at both reference levels, and verifies that false adds no global-property metadata. This protects the MonoTouch.Dialog shared-output fix against either a skipped late-computed value or duplicate non-hot-reload project instances.\n\nRef #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The focused ProjectReference metadata test added for the review suggestion passes, but the maintainer prefers not to carry this synthetic test. Remove it while retaining the production MSBuild target fix and its earlier local validation.\n\nRef #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A Debug app can explicitly compute HotReloadCompatibleBuild=false while a referenced library defaults to true. Forward false for those non-NativeAOT app references to keep their compile mode aligned. Continue omitting false for NativeAOT and library references so the MonoTouch.Dialog instances do not split on a false-versus-unset global property.\n\nRef #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Windows CI revealed that SDK project-reference traversal can still build MonoTouch.Dialog twice in parallel, once with HotReloadCompatibleBuild=true and once without it. Those instances previously compiled into the same assembly path, causing CS2012 even after propagating the property through explicit references. Give the true-valued instance separate intermediate and output directories while leaving false and unset builds unchanged. MSBuild GetTargetPath and evaluated-property checks confirm distinct paths across iOS, tvOS, Mac Catalyst, Debug, and Release.\n\nRef #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
BundledResources tests resource stripping according to the app's HotReloadCompatibleBuild setting. Read the existing ObjCRuntime.Runtime.HotReloadCompatible AppContext switch at runtime instead of compiling a library-specific symbol, which could disagree with the app. Remove the test-only project-reference propagation and MonoTouch.Dialog output isolation introduced to mitigate its parallel-project race; without the property propagation, those extra project instances are no longer required.\n\nFixes #26688. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The backport matches the merged upstream fix, but branch-specific CI remains in progress.
Review effort: Balanced
Findings: None
What changed in this PR
Backports the fix for concurrent MonoTouch.Dialog builds caused by divergent hot-reload project instances.
Changes:
- Reads hot-reload compatibility from the runtime AppContext switch.
- Removes test-only MSBuild property propagation that triggered duplicate builds.
| File | Description |
|---|---|
tests/BundledResources/ResourcesTest.cs |
Uses the app’s runtime hot-reload setting for assertions. |
tests/common/shared-dotnet.csproj |
Removes conflicting project-reference property propagation. |
✅ 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 |
🚀 [CI Build #6d8c841] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 269 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 |
Parallel builds of MonoTouch.Dialog reached the same output path with different
HotReloadCompatibleBuildglobal properties. That race produced MSB3026 in the tvOS NativeAOT warning test and CS2012 in a Windows iOS binding test.The BundledResources assertion only needs to know the running app's hot-reload setting. It now reads the existing
ObjCRuntime.Runtime.HotReloadCompatibleAppContext switch instead of using a library-specificHOTRELOAD_COMPATIBLE_BUILDcompilation symbol. This removes the test-only targets that propagated the property into project references, eliminating the divergent project instances that caused the shared-output race. The temporary MonoTouch.Dialog output-path workaround is no longer part of the final diff.The setting was previously verified from the failing CI binlogs. Local XML and source checks passed; Apple-project compilation could not run locally without the iOS workload and Xcode 27. CI on this final approach is pending.
Fixes #26688
🤖 Pull request created by Copilot
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com
Backport of #26692.