Skip to content

Fix Ogre build failure on Xcode 26 (xcodebuild -n removed)#1751

Open
idesign0 wants to merge 3 commits into
ros2:rollingfrom
idesign0:rolling
Open

Fix Ogre build failure on Xcode 26 (xcodebuild -n removed)#1751
idesign0 wants to merge 3 commits into
ros2:rollingfrom
idesign0:rolling

Conversation

@idesign0

Copy link
Copy Markdown
Contributor

Problem

Xcode 26 removed the -n flag from xcodebuild. Ogre v1.12.10's CMakeLists.txt uses execute_process with a shell pipe to detect the macOS SDK path:

execute_process(
  COMMAND xcodebuild -version -sdk "${XCODE_ATTRIBUTE_SDKROOT}" Path | head -n 1
  OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)

CMake's execute_process does not use a shell, so | head -n 1 is passed as literal arguments to xcodebuild. With Xcode 26, the -n argument is rejected:

xcodebuild: error: option '-n' is no longer supported
Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] ...
       xcodebuild [-project <projectname>] -scheme <schemeName> [-destination <destinationspecifier>]...
       ...

The full usage page is captured into CMAKE_OSX_SYSROOT, corrupting it with embedded newlines and breaking all subsequent compiler invocations:

/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file

Fix

Add patches/0007-fix-xcodebuild-n-xcode26.patch which replaces the broken call with:

execute_process(COMMAND xcrun --sdk macosx --show-sdk-path
                OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)

xcrun --show-sdk-path is the correct modern replacement and works across all supported Xcode versions.

Fyi, @traversaro — this may affect RoboStack/conda-forge builds of rviz on macOS with Xcode 26. The same bug exists in gz_ogre_next_vendor (ogre-next v2.3.3, same execute_process pipe pattern) — fix incoming there too.

@traversaro

Copy link
Copy Markdown
Contributor

Fyi, @traversaro — this may affect RoboStack/conda-forge builds of rviz on macOS with Xcode 26. The same bug exists in gz_ogre_next_vendor (ogre-next v2.3.3, same execute_process pipe pattern) — fix incoming there too.

Thanks for the mention! Indeed, that may be the case, fyi @wep21 @Tobias-Fischer.

@mergify

mergify Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants