[release/11.0] Avoid xcodebuild probe error without Xcode - #133153
Open
github-actions[bot] wants to merge 1 commit into
Open
[release/11.0] Avoid xcodebuild probe error without Xcode#133153github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
## Description On macOS machines with only the Command Line Tools installed, `xcodebuild -version` writes an `xcode-select : error :` diagnostic to stderr. Although this probe already ignores its exit code, MSBuild recognizes that stderr line as a standard error and fails the NativeAOT publishing projects. Set `IgnoreStandardErrorWarningFormat` on the NativeAOT probe, matching the equivalent probes in `crossgen-corelib.proj` and `Microsoft.NET.CrossGen.targets`. This is a regression from .NET 10, where this target checked `clang --version` instead of invoking `xcodebuild`. This worked in the past when the clang version was aligned to the Xcode version (specifically for 15 and 16 which we're using to decide whether to use classic ld) but nowadays it's not aligned anymore and will fail the build if Xcode isn't installed. It changed in [`25f2dcb` (#123386)](25f2dcb). ## Testing - `./build.sh clr` on macOS with Command Line Tools installed but no Xcode > [!NOTE] > This pull request description was generated with GitHub Copilot. Copilot-Session: 9803f1dc-6ff0-43e2-9aff-e10f1c0b3fb2
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
akoeplinger
approved these changes
Sep 3, 2026
pragmanomos
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #133105 to release/11.0
/cc @akoeplinger
Customer Impact
On a macOS machine without Xcode installed (using just Command Line Tools) publishing a NativeAOT app fails with an error:
This is basically the same as this report from 9.0 timeframe in #100189 that we fixed back then and now regressed.
Regression
Regression was introduced in
25f2dcb(#123386) when we switched checking the output ofclang --versiontoxcodebuild --version.The previous behavior worked in the past when the clang version was aligned to the Xcode version (specifically for 15 and 16 which we're using to decide whether to use classic ld) but nowadays it's not aligned anymore so switching to checking the xcodebuild version is the correct fix.
The issue is that although the check already ignored the exit code, MSBuild recognizes the stderr line as a standard error and fails the build. The fix is to set
IgnoreStandardErrorWarningFormaton the check, matching the equivalent probes incrossgen-corelib.projandMicrosoft.NET.CrossGen.targets.Testing
Tested manually on a machine without Xcode. It was missed because most users use Xcode but there are some that don't as we got reports about a similar issue before.
Risk
Low. We just make sure to ignore the error output like we do in other places.
IMPORTANT: If this backport is for a servicing release, please verify that:
release/X.0-staging, notrelease/X.0.release/X.0(no-stagingsuffix).Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.