Skip to content

[release/11.0.1xx] [tests] Prevent concurrent MonoTouch.Dialog builds. Fixes #26688 - #26827

Merged
rolfbjarne merged 8 commits into
release/11.0.1xxfrom
dev/rolf/backport-pr-26692-release/11.0.1xx-2026-10-02
Oct 2, 2026
Merged

rolfbjarne merged 8 commits into
release/11.0.1xxfrom
dev/rolf/backport-pr-26692-release/11.0.1xx-2026-10-02

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Parallel builds of MonoTouch.Dialog reached the same output path with different HotReloadCompatibleBuild global 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.HotReloadCompatible AppContext switch instead of using a library-specific HOTRELOAD_COMPATIBLE_BUILD compilation 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.

rolfbjarne and others added 8 commits October 2, 2026 18:49
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>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 16:51
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner October 2, 2026 16:51
@rolfbjarne rolfbjarne added backported ready-to-review This PR is ready to review/merge. labels Oct 2, 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.

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.

@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: 6d8c841a776494ecf412803cc4612d7445680184 [PR build]

@rolfbjarne
rolfbjarne enabled auto-merge (squash) October 2, 2026 17:42
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ 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 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 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): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 6d8c841a776494ecf412803cc4612d7445680184 [PR build]

@rolfbjarne
rolfbjarne merged commit 936520e into release/11.0.1xx Oct 2, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/backport-pr-26692-release/11.0.1xx-2026-10-02 branch October 2, 2026 20:01
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