[make] Allow configuring the Xcode path#25622
Conversation
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.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
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
./configureoptions (--xcode*) to writeCONFIGURED_XCODE_DEVELOPER_ROOTintoconfigure.inc. - Updates
Make.configto loadconfigure.incearlier and preferCONFIGURED_XCODE_DEVELOPER_ROOTwhenXCODE_DEVELOPER_ROOTisn’t explicitly set. - Updates
system-dependencies.shto 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. |
| if test -z "${NO_XCODE:-}"; then | ||
| XCODE_DEVELOPER_ROOT=$(get_xcode_developer_root) | ||
| export XCODE_DEVELOPER_ROOT | ||
| export DEVELOPER_DIR="$XCODE_DEVELOPER_ROOT" | ||
| fi |
| 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 |
| fi | ||
|
|
||
| if [[ -n "$XCODE_ARG" ]]; then | ||
| echo "CONFIGURED_XCODE_DEVELOPER_ROOT=$XCODE_ARG" >> "$CONFIGURED_FILE" |
There was a problem hiding this comment.
I think it's easier to just write to the XCODE_DEVELOPER_ROOT variable (none of the other options use a custom variable).
| echo "CONFIGURED_XCODE_DEVELOPER_ROOT=$XCODE_ARG" >> "$CONFIGURED_FILE" | |
| echo "XCODE_DEVELOPER_ROOT=$XCODE_ARG" >> "$CONFIGURED_FILE" |
| ifneq ($(CONFIGURED_XCODE_DEVELOPER_ROOT),) | ||
| XCODE_DEVELOPER_ROOT := $(CONFIGURED_XCODE_DEVELOPER_ROOT) | ||
| else | ||
| XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.5.0.app/Contents/Developer |
There was a problem hiding this comment.
If the configure script sets XCODE_DEVELOPER_ROOT, this works (set unless not already set):
| 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.
| fi | ||
| fi | ||
|
|
||
| grep "^XCODE${suffix}_DEVELOPER_ROOT=" Make.config | sed 's/.*=//' |
There was a problem hiding this comment.
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)
This comment has been minimized.
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>
This comment has been minimized.
This comment has been minimized.
|
/azp run |
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines successfully started running 3 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #c182d56] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #c182d56] Build passed (Build packages) ✅Pipeline on Agent |
✅ 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 |
✅ [PR Build #c182d56] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
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>
Add a configure-time option for selecting the Xcode installation used by the build.
Some build images install Xcode 26.5 as:
while the repository default points at:
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:
Based on PR review feedback,
configurenow writes the selected path directly toconfigure.incasXCODE_DEVELOPER_ROOT.Make.configincludesconfigure.incbefore resolving the Xcode block and uses?=for the existing default path:This keeps the behavior simple and consistent with the other configure options: an explicitly configured Xcode path wins, while the existing
.0.apppath remains the default when no path is configured.system-dependencies.shnow also checksconfigure.incforXCODE_DEVELOPER_ROOTbefore falling back to theMake.configdefault, and direct invocations exportDEVELOPER_DIRfrom 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:
Local developers with
Xcode_26.5.0.appcan continue using the default configuration unchanged.