Skip to content

[msbuild] Disable device-specific builds by default.#26005

Open
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/remove-device-specific-builds
Open

[msbuild] Disable device-specific builds by default.#26005
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/remove-device-specific-builds

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Jul 9, 2026

Copy link
Copy Markdown
Member

Device-specific builds were originally implemented to:

  1. Build for a single architecture when we knew which device the app was going to be installed on.
  2. Speed up resource compilation a bit by filtering resource compilation to the target device.

However, the first reason is no longer applicable (arm64 is the only architecture), and the feature adds complexity and increases path lengths in the bin directory (which causes MAX_PATH issues on Windows).

Changes:

  • Default DeviceSpecificBuild to false (was tied to _BundlerDebug).
  • Don't run ParseDeviceSpecificBuildInformation on .NET 11+, unless the private _DeviceSpecificBuildOverride property is set to true. This completely disables device-specific builds (unless the override is specified, which will hopefully never be necessary, and then we can remove the code in .NET 12).

Contributes towards #23846

🤖 Pull request created by Copilot

Device-specific builds are no longer useful since arm64 is the only
architecture, and the extra path segments cause MAX_PATH issues on Windows.

Changes:
- Default DeviceSpecificBuild to false (was tied to _BundlerDebug).
- Don't run ParseDeviceSpecificBuildInformation on .NET 10+, unless the
  private _DeviceSpecificBuildOverride property is set to true. This
  completely disables device-specific builds (unless the override is
  specified, which will hopefully never be necessary, and then we can remove
  the code in .NET 12).

Contributes towards #23846.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne changed the title [msbuild] Disable device-specific builds by default. Fixes #23846 [msbuild] Disable device-specific builds by default. Jul 9, 2026
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [PR Build #85b511b] Build failed (Detect API changes) 🔥

Build failed for the job 'Detect API changes' (with job status 'Failed')

Pipeline on Agent
Hash: 85b511bca3a7c4f04ff4b4d841fb70b61f6c2334 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne marked this pull request as ready for review July 10, 2026 09:54
@rolfbjarne rolfbjarne requested a review from mauroa as a code owner July 10, 2026 09:54
Copilot AI review requested due to automatic review settings July 10, 2026 09:54

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.

Pull request overview

This PR simplifies the .NET Apple MSBuild pipeline by disabling device-specific builds by default (to reduce complexity and shorten bin/obj paths), while keeping an escape hatch for .NET 11+ via a private override property.

Changes:

  • Default DeviceSpecificBuild to false instead of tying it to _BundlerDebug.
  • Skip ParseDeviceSpecificBuildInformation for .NET 11+ unless _DeviceSpecificBuildOverride is explicitly set to true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
msbuild/Xamarin.Shared/Xamarin.Shared.targets Adds a .NET-version gate (with an override) to stop running the device-specific build parsing task for .NET 11+.
msbuild/Xamarin.Shared/Xamarin.iOS.Common.props Changes the default value of DeviceSpecificBuild to false.

Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.targets
Comment thread msbuild/Xamarin.Shared/Xamarin.iOS.Common.props
…eSpecificBuild=true

Since the default is now false, the test must explicitly opt-in to
device-specific builds for the test to exercise that code path.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@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: 22b4fb469fc8307edf2bf1d19c556269f9a6f79e [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #22b4fb4] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 199 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. [attempt 2] 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 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. [attempt 2] 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 Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ 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

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 22b4fb469fc8307edf2bf1d19c556269f9a6f79e [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants