Skip to content

[mtouch] Make mtouch work without Xcode, since we don't really need Xcode for what mtouch currently does. - #25430

Merged
rolfbjarne merged 6 commits into
mainfrom
dev/rolf/mtouch-no-xcode
May 22, 2026
Merged

rolfbjarne merged 6 commits into
mainfrom
dev/rolf/mtouch-no-xcode

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

mtouch only needs to know the Xcode version to do what it currently does
(create the partial static registrar code during our build), so just pass that
instead of the path to Xcode.

…code for what mtouch currently does.

mtouch only needs to know the Xcode version to do what it currently does
(create the partial static registrar code during our build), so just pass that
instead of the path to Xcode.

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 aims to let mtouch run its registrar-generation workflow without requiring an Xcode installation by passing the Xcode version (instead of an Xcode path) through the build.

Changes:

  • Removed ValidateXcode invocation from mtouch entrypoint to avoid requiring an installed Xcode.
  • Added a new --xcode-version command-line option and plumbed it through the mtouch build Makefile.
  • Added a partial fallback for Mac Catalyst macOS→iOS version mapping when Xcode isn’t configured.

Reviewed changes

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

File Description
tools/mtouch/mtouch.cs Stops validating/finding Xcode before running registrar generation.
tools/mtouch/Makefile Passes --xcode-version $(XCODE_VERSION) to mtouch and adds a Linux-oriented no-xcode-build path.
tools/common/Driver.cs Adds --xcode-version parsing and exposes a setter for Driver.XcodeVersion.
tools/common/Application.cs Adds a warning+fallback path for Mac Catalyst version mapping when Xcode isn’t configured.

Comment thread tools/mtouch/mtouch.cs
Comment thread tools/common/Driver.cs Outdated
Comment thread tools/common/Driver.cs
Comment thread tools/common/Application.cs
Comment thread tools/common/Application.cs Outdated
Comment thread tools/mtouch/Makefile Outdated
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

The hardcoded macOS dylib path does not exist on Linux. Using "libc"
as the library name lets the .NET runtime resolve the correct native
library on both macOS and Linux.

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits May 18, 2026 18:33
- Wrap the no-Xcode Mac Catalyst fallback in #if LEGACY_TOOLS
- Fix spelling: "a internal" → "an internal"
- Use Version.TryParse with MX0026 error for --xcode-version parsing
- Throw a clear MX0099 error from XcodeVersion getter when unset
- Remove duplicate no-xcode-build prerequisite from Makefile

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

…r.cs

These were using macOS-specific library paths (/usr/lib/libSystem.dylib)
which do not exist on Linux. CoreResolver calls GetRealPath during
registrar generation, so this breaks the no-xcode-build on Linux.

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne marked this pull request as ready for review May 21, 2026 17:53
@rolfbjarne
rolfbjarne enabled auto-merge (squash) May 21, 2026 17:53
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #38dbf9c] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 38dbf9cf6e8f1702188c5a0735ca4e79dd89b812 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #38dbf9c] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 38dbf9cf6e8f1702188c5a0735ca4e79dd89b812 [PR build]

@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: 38dbf9cf6e8f1702188c5a0735ca4e79dd89b812 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #38dbf9c] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 38dbf9cf6e8f1702188c5a0735ca4e79dd89b812 [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 #38dbf9c] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 183 tests passed 🎉

Tests counts

✅ 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 Publish failed ⚠️) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 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 Monterey (12): All 5 tests passed. [attempt 2] 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: 38dbf9cf6e8f1702188c5a0735ca4e79dd89b812 [PR build]

@rolfbjarne
rolfbjarne merged commit 7717e7b into main May 22, 2026
54 checks passed
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