Repository navigation
[CI] Handle missing Xcode gracefully in provision script. Fixes #25934 - #25936
Conversation
The ListXcodes() function in the provisioning script calls 'ls -lad /Applications/Xcode*' which throws an ExitException when no Xcode is installed (exit code 1 from ls when the glob matches nothing). This causes the entire provisioning step to abort with an unhandled exception before any actual provisioning can happen. Wrap the ls call in a try-catch so that a missing Xcode installation is reported as informational output instead of crashing. The actual provisioning step (Xcode().XcodeSelect) will still run afterwards and install the required Xcode. Fixes #25934 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the CI provisioning script to avoid aborting when /Applications/Xcode* matches nothing (i.e., the machine has no preinstalled Xcode), allowing provisioning to continue and install/select the required Xcode.
Changes:
- Wrap
ListXcodes()βsls -lad /Applications/Xcode*call in a try/catch and print an informational message when no Xcodes are found.
Address review feedback: capture the exception and include its message in the output to aid troubleshooting if ls fails for an unexpected reason. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
β [PR Build #075f26b] Build passed (Detect API changes) β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 #a09ac94] Build passed (Build packages) βPipeline on Agent |
β [PR Build #a09ac94] Build passed (Build macOS tests) βPipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
π [CI Build #a09ac94] 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 macOS testsβ
Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
The
ListXcodes()function in the provisioning script callsls -lad /Applications/Xcode*which throws an unhandledExitExceptionwhen no Xcode is installed (exit code 1 from ls when the glob matches nothing). This causes the entire provisioning step to abort before any actual provisioning can happen.Wrap the ls call in a try-catch so that a missing Xcode installation is reported as informational output instead of crashing. The actual provisioning step (
Xcode(...).XcodeSelect()) still runs afterwards and installs the required Xcode.Fixes #25934
π€ Pull request created by Copilot