Skip to content

[release/11.0] Avoid xcodebuild probe error without Xcode - #133153

Open
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-133105-to-release/11.0
Open

[release/11.0] Avoid xcodebuild probe error without Xcode#133153
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-133105-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backport of #133105 to release/11.0

/cc @akoeplinger

Customer Impact

  • Customer reported
  • Found internally

On a macOS machine without Xcode installed (using just Command Line Tools) publishing a NativeAOT app fails with an error:

xcode-select : error : tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

This is basically the same as this report from 9.0 timeframe in #100189 that we fixed back then and now regressed.

Regression

  • Yes
  • No

Regression was introduced in 25f2dcb (#123386) when we switched checking the output of clang --version to xcodebuild --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 IgnoreStandardErrorWarningFormat on the check, matching the equivalent probes in crossgen-corelib.proj and Microsoft.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:

  • For .NET 8 and .NET 9: The PR target branch is release/X.0-staging, not release/X.0.
  • For .NET 10+: The PR target branch is release/X.0 (no -staging suffix).

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.

## 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

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@artl93
artl93 requested a review from pragmanomos September 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-NativeAOT-coreclr Servicing-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants