Skip to content

Build the macOS natives on macos-15 - #214

Open
pietrygamat wants to merge 1 commit into
java-native:masterfrom
pietrygamat:macos-15
Open

pietrygamat wants to merge 1 commit into
java-native:masterfrom
pietrygamat:macos-15

Conversation

@pietrygamat

Copy link
Copy Markdown
Collaborator

The macos-14 runner image retires on November 2, 2026, and its brownouts already cancel the macOS jobs. This moves them to macos-15, which is arm64 too and still sets XCODE_16_DEVELOPER_DIR.

macos-15 defaults to Xcode 16.4, whose xcrun shims (/usr/bin/make, /usr/bin/c++) read SDKROOT and cannot resolve MacOSX10.9.sdk, so CMake fails to configure. The workflows now export only CMAKE_OSX_SYSROOT, which ant/build.xml passes to CMake as -DCMAKE_OSX_SYSROOT, and the shims keep the default SDK.

This does not change the compatibility of the natives: they are still built against the same MacOSX10.9.sdk and MacOSX11.0.sdk with the same MACOSX_DEPLOYMENT_TARGET values.

The macos-14 runner image retires on November 2, 2026, and its brownouts
already cancel the macOS jobs. Move them to macos-15, which is arm64 too
and still sets XCODE_16_DEVELOPER_DIR.

macos-15 defaults to Xcode 16.4, whose xcrun shims (/usr/bin/make,
/usr/bin/c++) read SDKROOT and cannot resolve MacOSX10.9.sdk, so CMake
fails to configure. The workflows now export only CMAKE_OSX_SYSROOT,
which ant/build.xml passes to CMake as -DCMAKE_OSX_SYSROOT, and the shims
keep the default SDK.

This does not change the compatibility of the natives: they are still
built against the same MacOSX10.9.sdk and MacOSX11.0.sdk with the same
MACOSX_DEPLOYMENT_TARGET values.
@tresf

tresf commented Nov 1, 2026

Copy link
Copy Markdown

Thanks. I assume you've already ruled out keeping the old method, but can you help me understand what's going on? I'm having a hard time understanding based on the code and PR description and the cmake docs still claim that the old environment variable is valid. https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html

@pietrygamat

Copy link
Copy Markdown
Collaborator Author

already ruled out keeping the old method

After simply updating the runner the build failed with this:

[INFO] --- antrun:3.1.0:run (cmake-generate) @ jssc ---

[INFO]      [exec] -- Check for working CXX compiler: /usr/bin/c++
[INFO]      [exec] -- Check for working CXX compiler: /usr/bin/c++ - broken
[INFO]      [exec] -- Configuring incomplete, errors occurred!
[INFO]      [exec] CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:71 (message):
[INFO]      [exec]   The C++ compiler
[INFO]      [exec] 
[INFO]      [exec]     "/usr/bin/c++"
[INFO]      [exec] 
[INFO]      [exec]   is not able to compile a simple test program.
[INFO]      [exec] 
[INFO]      [exec]   It fails with the following output:
[INFO]      [exec] 
[INFO]      [exec]     Change Dir: '/Users/runner/work/jssc/jssc/target/cmake/CMakeFiles/CMakeScratch/TryCompile-vsZLyS'
[INFO]      [exec]     
[INFO]      [exec]     Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_78dfa/fast
[INFO]      [exec]     make: error: sh -c '/Applications/Xcode_16.4.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -find make 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
[INFO]      [exec]     xcode-select: Failed to locate 'make', requesting installation of command line developer tools.
[INFO]      [exec]     
[INFO]      [exec]     
[INFO]      [exec] 
[INFO]      [exec] 
[INFO]      [exec] 
[INFO]      [exec]   CMake will not be able to correctly generate this project.
[INFO]      [exec] Call Stack (most recent call first):
[INFO]      [exec]   CMakeLists.txt:19 (project)
[INFO]      [exec] 
[INFO]      [exec] 
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE

CMake used to set CMAKE_OSX_SYSROOT itself implicitly based on SDKROOT we passed to the build. Now, we don't pass SDKROOT, but set CMAKE_OSX_SYSROOT explicitly in the job - and the CMake file is updated to accept the value if it's set, or default to old behavior otherwise, so no breakage of setups other than ours CI should happen.

The problem as I understand it - is that the newer xcode 16.4 also uses the SDKROOT for other things, and when used with older 10.9 SDK it fails, suggesting there is no developer tools installed at all:

Check for working CXX compiler: /usr/bin/c++ - broken
...
[Failed to locate 'make', requesting installation of command line developer tools.](xcode-select: Failed to locate 'make', requesting installation of command line developer tools.)

And that's before the cmake configuration even starts. When given CMAKE_OSX_SYSROOT, the check passes

[INFO]      [exec] -- Check for working CXX compiler: /usr/bin/c++ - skipped
...
[INFO]      [exec] -- Adding legacy include path: /Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1

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