Skip to content

[make] Allow configuring the Xcode path#25622

Merged
dalexsoto merged 2 commits into
mainfrom
dev/alex/xcode-config
Jun 2, 2026
Merged

[make] Allow configuring the Xcode path#25622
dalexsoto merged 2 commits into
mainfrom
dev/alex/xcode-config

Conversation

@dalexsoto

@dalexsoto dalexsoto commented Jun 2, 2026

Copy link
Copy Markdown
Member

Add a configure-time option for selecting the Xcode installation used by the build.

Some build images install Xcode 26.5 as:

/Applications/Xcode_26.5.app

while the repository default points at:

/Applications/Xcode_26.5.0.app

Xcode does not behave well when accessed through symlinks, so make the path explicit instead of requiring machines to provide an alternate app bundle name.

The configure options accept either the Xcode app bundle path or the developer root path:

./configure --xcode=/Applications/Xcode_26.5.app
./configure --xcode=/Applications/Xcode_26.5.app/Contents/Developer
./configure --xcode-root=/Applications/Xcode_26.5.app
./configure --xcode-developer-root=/Applications/Xcode_26.5.app/Contents/Developer

Based on PR review feedback, configure now writes the selected path directly to configure.inc as XCODE_DEVELOPER_ROOT. Make.config includes configure.inc before resolving the Xcode block and uses ?= for the existing default path:

XCODE_DEVELOPER_ROOT?=/Applications/Xcode_26.5.0.app/Contents/Developer

This keeps the behavior simple and consistent with the other configure options: an explicitly configured Xcode path wins, while the existing .0.app path remains the default when no path is configured.

system-dependencies.sh now also checks configure.inc for XCODE_DEVELOPER_ROOT before falling back to the Make.config default, and direct invocations export DEVELOPER_DIR from the resolved Xcode root so the script and Make agree on the selected Xcode.

No pipeline- or agent-specific logic is added. CI can opt into the shorter app bundle name by running:

./configure --xcode=/Applications/Xcode_26.5.app

Local developers with Xcode_26.5.0.app can continue using the default configuration unchanged.

 Add a configure-time option for selecting the Xcode installation used by
 the build. Some build images install Xcode 26.5 as:

     /Applications/Xcode_26.5.app

 while the repository default points at:

     /Applications/Xcode_26.5.0.app

 Xcode does not behave well when accessed through symlinks, so make the
 path explicit instead of requiring machines to provide an alternate app
 bundle name.

 The new configure options accept either the Xcode app bundle path or the
 developer root path:

     ./configure --xcode=/Applications/Xcode_26.5.app
     ./configure --xcode=/Applications/Xcode_26.5.app/Contents/Developer
     ./configure --xcode-root=/Applications/Xcode_26.5.app
     ./configure --xcode-developer-root=/Applications/Xcode_26.5.app/Contents/Developer

 The selected path is written to configure.inc as
 CONFIGURED_XCODE_DEVELOPER_ROOT. Make.config now includes configure.inc
 before resolving the Xcode block and uses the configured value only when
 XCODE_DEVELOPER_ROOT was not explicitly provided. This preserves the
 existing precedence:

 1. command-line/environment XCODE_DEVELOPER_ROOT
 2. configure-provided CONFIGURED_XCODE_DEVELOPER_ROOT
 3. repository default /Applications/Xcode_26.5.0.app/Contents/Developer

 Update system-dependencies.sh to use the same configured Xcode root for
 the primary Xcode instead of always grepping the hardcoded Make.config
 default. Direct invocations of system-dependencies.sh now also export
 DEVELOPER_DIR from the resolved Xcode root, matching the Make.config
 behavior.

 No pipeline- or agent-specific logic is added; CI can opt into the
 shorter app bundle name by running:

     ./configure --xcode=/Applications/Xcode_26.5.app

 Local developers with Xcode_26.5.0.app can continue using the default
 configuration unchanged.
@dalexsoto dalexsoto requested a review from rolfbjarne as a code owner June 2, 2026 16:47
Copilot AI review requested due to automatic review settings June 2, 2026 16:47
@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

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 adds a configure-time mechanism to select the Xcode installation used by the build, allowing CI/hosts to use explicit Xcode app bundle names (avoiding symlinked Xcode paths) while preserving existing precedence between environment overrides, configure-provided defaults, and repository defaults.

Changes:

  • Adds ./configure options (--xcode*) to write CONFIGURED_XCODE_DEVELOPER_ROOT into configure.inc.
  • Updates Make.config to load configure.inc earlier and prefer CONFIGURED_XCODE_DEVELOPER_ROOT when XCODE_DEVELOPER_ROOT isn’t explicitly set.
  • Updates system-dependencies.sh to resolve/export the configured Xcode developer root (and use it when computing Xcode-related paths).

Reviewed changes

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

File Description
system-dependencies.sh Introduces get_xcode_developer_root and exports DEVELOPER_DIR/XCODE_DEVELOPER_ROOT based on configured/default Xcode selection.
Make.config Includes configure.inc earlier and applies configured Xcode developer root when not explicitly overridden.
configure Adds --xcode* arguments, validates/canonicalizes the provided path, and persists it to configure.inc.

Comment thread system-dependencies.sh
Comment on lines +241 to +245
if test -z "${NO_XCODE:-}"; then
XCODE_DEVELOPER_ROOT=$(get_xcode_developer_root)
export XCODE_DEVELOPER_ROOT
export DEVELOPER_DIR="$XCODE_DEVELOPER_ROOT"
fi
Comment thread Make.config
MACCATALYST_NUGET_VERSION_NO_METADATA=$(MACCATALYST_NUGET_VERSION)$(NUGET_PRERELEASE_IDENTIFIER)
MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)$(NUGET_BUILD_METADATA)

-include $(TOP)/configure.inc
Comment thread configure Outdated
fi

if [[ -n "$XCODE_ARG" ]]; then
echo "CONFIGURED_XCODE_DEVELOPER_ROOT=$XCODE_ARG" >> "$CONFIGURED_FILE"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's easier to just write to the XCODE_DEVELOPER_ROOT variable (none of the other options use a custom variable).

Suggested change
echo "CONFIGURED_XCODE_DEVELOPER_ROOT=$XCODE_ARG" >> "$CONFIGURED_FILE"
echo "XCODE_DEVELOPER_ROOT=$XCODE_ARG" >> "$CONFIGURED_FILE"

Comment thread Make.config Outdated
ifneq ($(CONFIGURED_XCODE_DEVELOPER_ROOT),)
XCODE_DEVELOPER_ROOT := $(CONFIGURED_XCODE_DEVELOPER_ROOT)
else
XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.5.0.app/Contents/Developer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the configure script sets XCODE_DEVELOPER_ROOT, this works (set unless not already set):

Suggested change
XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.5.0.app/Contents/Developer
XCODE_DEVELOPER_ROOT?=/Applications/Xcode_26.5.0.app/Contents/Developer

then all the ifndef/ifneq/else/endif/endif changes can go away.

Comment thread system-dependencies.sh Outdated
fi
fi

grep "^XCODE${suffix}_DEVELOPER_ROOT=" Make.config | sed 's/.*=//'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we write to XCODE_DEVELOPER_ROOT in configure.inc, we can do something like:

if XCODE_DEVELOPER_ROOT_ASSIGNMENT=$(grep "^XCODE_DEVELOPER_ROOT=" configure.inc); then
    echo "$XCODE_DEVELOPER_ROOT_ASSIGNMENT" | sed 's/.*=//'
    exit 0
fi
grep "^XCODE${suffix}_DEVELOPER_ROOT=" Make.config | sed 's/.*=//'

(and delete the rest of this function)

@vs-mobiletools-engineering-service2

This comment has been minimized.

Apply feedback from the PR review by simplifying the configure-based Xcode path selection.

The configure script now writes XCODE_DEVELOPER_ROOT directly to configure.inc, matching the pattern used by the other configure options. Make.config uses ?= for the default /Applications/Xcode_26.5.0.app/Contents/Developer path, so the configure-provided value, environment overrides, and command-line overrides can take precedence without additional custom variables.

system-dependencies.sh now checks configure.inc for XCODE_DEVELOPER_ROOT before falling back to the Make.config default, and it accepts the ?= assignment form used by Make.config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dalexsoto dalexsoto requested a review from rolfbjarne June 2, 2026 17:10
@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run

@vs-mobiletools-engineering-service2

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

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

Pipeline on Agent
Hash: c182d561eb9cb32de5d72bc0a1b60188b1fa134a [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

✅ [PR Build #c182d56] Build passed (Build packages) ✅

Pipeline on Agent
Hash: c182d561eb9cb32de5d72bc0a1b60188b1fa134a [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: c182d561eb9cb32de5d72bc0a1b60188b1fa134a [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #c182d56] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: c182d561eb9cb32de5d72bc0a1b60188b1fa134a [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #c182d56] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 193 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 (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 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. Html Report (VSDrops) Download
✅ monotouch (iOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 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. 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: c182d561eb9cb32de5d72bc0a1b60188b1fa134a [PR build]

@dalexsoto dalexsoto merged commit dbc04b5 into main Jun 2, 2026
55 checks passed
@dalexsoto dalexsoto deleted the dev/alex/xcode-config branch June 2, 2026 19:13
dalexsoto added a commit that referenced this pull request Jun 4, 2026
Move the CI build/test/API-diff flows to the ACES shared macOS pool
while keeping PR validation on the existing PR pool for now.

## Scope

This PR enables ACES for the CI entry points only:

- `build-pipeline.yml`
- `run-ci-api-diff.yml`
- `run-post-ci-build-tests.yml`

The PR entry points remain opt-out for now and can be flipped later once
CI is stable:

- `build-pull-request.yml`
- `run-pr-api-diff.yml`
- `run-post-pr-build-tests.yml`

## What changed

- Added/used the `useACES` template parameter to route CI build, API
diff, and simulator-test jobs to the ACES shared pool/image.
- Kept the existing non-ACES pool and demand behavior when `useACES` is
false.
- Marked ACES simulator-test jobs with `VM_VENDOR=ACES` so tests that
should not run on virtualized machines can opt out correctly.
- Avoid deleting simulator runtimes on ACES, since that operation is not
supported/reliable there.
- Wait longer for non-x64 simulator cleanup to complete before
continuing.
- Skip x64 simulator test runs on ACES machines.
- Use the Xcode selected by `xcode-select` for build configuration and
pre-configure provisioning, so ACES agents with
`/Applications/Xcode_26.5.app` do not require symlinks or the
traditional `/Applications/Xcode_26.5.0.app` bundle name.
- Harden the `System.Net.Http` monotouch tests against transient
CI/httpbin network timeouts so network stalls do not hang the entire
monotouch app until the harness timeout.

## Related Xcode path support

This branch includes the configure support from #25622. The CI templates
use the selected Xcode developer root so both classic bots and ACES
images can configure/build with the Xcode that is actually installed on
the agent.

## Validation notes

The original green build links in this PR description became stale as
the branch evolved. Recent follow-up failures were investigated and
resulted in the Xcode selection and network-timeout fixes included here.
The intended validation matrix is:

- CI Build on ACES
- CI API diff on ACES
- Post-CI simulator tests on ACES
- PR pipelines still using the existing PR pool

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
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