Opened 4 months ago

Last modified 2 days ago

#73180 reopened request

Retry macOS 26 builds on buildbot with Xcode 26 Metal toolchain fix in place

Reported by: markmentovai (Mark Mentovai) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: breun (Nils Breunese), reneeotten (Renee Otten), jmroot (Joshua Root), Dave-Allured (Dave Allured)
Port: qt6-qtwebengine, openjdk17, openjdk21, openjdk25

Description

MacPorts 2.11.6 contains 4497293e70b1, the fix for #73160, which should make it significantly easier to build ports that depend on the Metal toolchain using Xcode 26.

It would be good to get the ports known to be affected by this problem built on the buildbot.

On the buildbot, assuming it’s updated to MacPorts 2.11.6, run:

% xcodebuild -downloadComponent MetalToolchain

While still using Xcode 26.0 or 26.0.1, additionally run:

% sudo --user=macports xcodebuild -showComponent MetalToolchain
% sudo rm -f "$(sudo --user=macports getconf DARWIN_USER_TEMP_DIR)/xcrun_db"

Then re-attempt builds for the following ports—links are to previous failing builds:

Change History (13)

comment:2 Changed 4 months ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

All builds were successful.

comment:3 Changed 3 weeks ago by breun (Nils Breunese)

Resolution: fixed
Status: closedreopened

I pushed updates for openjdk21 21.0.10 and openjdk25 25.0.2 this month, which succeeded for me locally after installing the Metal toolchain, but these builds are failing on the macOS 26 buildbots, so it seems this issue is back.

openjdk21: https://build.macports.org/builders/ports-26_arm64-builder/builds/25096

checking for metal... [not found]
checking if metal can be run using xcrun... no
configure: error: XCode tool 'metal' neither found in path nor with xcrun
configure exiting with result code 1

openjdk25: https://build.macports.org/builders/ports-26_arm64-builder/builds/25097

checking for metal... [not found]
checking if metal can be run using xcrun... no
configure: A full XCode is required to build the JDK (not only command line tools)
configure: If you have XCode installed, you might need to reset the Xcode active developer directory
configure: using 'sudo xcode-select -r'
configure: error: XCode tool 'metal' neither found in path nor with xcrun
configure exiting with result code 1

So, it seems like the Metal toolchain on the buildbots is no longer getting found, while it was found before and it is found for me locally on macOS 26.2 with Xcode 26.2 with the Metal toolchain set up according to the instructions at TahoeProblems#MetaltoolchainisnolongerbundledinXcode.

I'm holding off on pushing updates for other OpenJDK versions for now, because I expect those builds will also fail to access the Metal toolchain on the buildbots.

Last edited 3 weeks ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 3 weeks ago by markmentovai (Mark Mentovai)

On the bot, try removing the xcrun cache:

% sudo rm -f "$(sudo --user=macports getconf DARWIN_USER_TEMP_DIR)/xcrun_db"

and then retrying the build.

comment:5 Changed 3 weeks ago by ryandesign (Ryan Carsten Schmidt)

I already did that, since it's in the aforementioned instructions.

comment:6 Changed 2 weeks ago by markmentovai (Mark Mentovai)

Can you show the output of these commands on that bot, running as the macports user?

xcodebuild -showComponent MetalToolchain
xcodebuild -find metal
xcrun_verbose=1 xcrun --find metal
xcrun_verbose=1 xcrun --sdk macosx --find metal
xcrun_verbose=1 xcrun --sdk macosx26.2 --find metal
xcrun metal --version
xcrun --sdk macosx metal --version
xcrun --sdk macosx26.2 metal --version
mount | grep MetalToolchain
ls -ldfT / /private /private/var /private/var/run /private/var/run/com.apple.security.cryptexd /private/var/run/com.apple.security.cryptexd/mnt /private/var/run/com.apple.security.cryptexd/mnt
ls -lT /private/var/run/com.apple.security.cryptexd/mnt

That should help figure out which step the problem is creeping in at.

(Yeah, it’s a lot, but I’m hoping to reduce the number of turnarounds.)

comment:7 in reply to:  6 Changed 10 days ago by breun (Nils Breunese)

Ryan, could you run the commands Mark posted on the macOS 26 arm64 buildbot? Hopefully this lets us spot what is causing the Metal toolchain to not get found, which is causing OpenJDK builds to fail on macOS 26.

comment:8 in reply to:  6 Changed 9 days ago by ryandesign (Ryan Carsten Schmidt)

Replying to markmentovai:

Can you show the output of these commands on that bot, running as the macports user?

% sudo -u macports -s
Password:
%
% whoami
macports
%
% xcodebuild -showComponent MetalToolchain
Asset Path: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/0bc538ab0cfa107625f77ad7bcfa566abe43e917.asset/AssetData
Build Version: 17C48
Status: installed
Toolchain Identifier: com.apple.dt.toolchain.Metal.32023
Toolchain Search Path: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw
%
% xcodebuild -find metal
/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal
%
% xcrun_verbose=1 xcrun --find metal
xcrun: note: database key is: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk|/Applications/Xcode.app/Contents/Developer|<manpath>
xcrun: note: lookup resolved in '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db' : '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:'
xcrun: note: PATH = '/opt/bblocal/bin:/opt/bblocal/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin'
xcrun: note: SDKROOT = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
xcrun: note: TOOLCHAINS = ''
xcrun: note: DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'
xcrun: note: XCODE_DEVELOPER_USR_PATH = ''
xcrun: note: xcrun_db = '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db'
xcrun: note: xcrun via metal (xcrun)
xcrun: note: database key is: metal|/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk||/Applications/Xcode.app/Contents/Developer|
xcrun: note: looking up with '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find metal 2> /dev/null'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
xcrun: note: lookup resolved with 'xcodebuild -find' to '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal'
/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal
%
% xcrun_verbose=1 xcrun --sdk macosx --find metal
xcrun: note: database key is: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk|/Applications/Xcode.app/Contents/Developer|<manpath>
xcrun: note: lookup resolved in '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db' : '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:'
xcrun: note: PATH = '/opt/bblocal/bin:/opt/bblocal/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin'
xcrun: note: SDKROOT = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk'
xcrun: note: TOOLCHAINS = ''
xcrun: note: DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'
xcrun: note: XCODE_DEVELOPER_USR_PATH = ''
xcrun: note: xcrun_db = '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db'
xcrun: note: xcrun via metal (xcrun)
xcrun: note: database key is: metal|/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk||/Applications/Xcode.app/Contents/Developer|
xcrun: note: looking up with '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk -find metal 2> /dev/null'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
xcrun: note: lookup resolved with 'xcodebuild -find' to '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal'
/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal
%
% xcrun_verbose=1 xcrun --sdk macosx26.2 --find metal
xcrun: note: looking up SDK with '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk macosx26.2 -version Path'
xcrun: note: PATH = '/opt/bblocal/bin:/opt/bblocal/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin'
xcrun: note: SDKROOT = 'macosx26.2'
xcrun: note: TOOLCHAINS = ''
xcrun: note: DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'
xcrun: note: XCODE_DEVELOPER_USR_PATH = ''
xcrun: note: xcrun_db = '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
xcrun: note: lookup resolved to: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk'
xcrun: note: database key is: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk|/Applications/Xcode.app/Contents/Developer|<manpath>
xcrun: note: lookup resolved in '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db' : '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:'
xcrun: note: PATH = '/opt/bblocal/bin:/opt/bblocal/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin'
xcrun: note: SDKROOT = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk'
xcrun: note: TOOLCHAINS = ''
xcrun: note: DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'
xcrun: note: XCODE_DEVELOPER_USR_PATH = ''
xcrun: note: xcrun_db = '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db'
xcrun: note: xcrun via metal (xcrun)
xcrun: note: database key is: metal|/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk||/Applications/Xcode.app/Contents/Developer|
xcrun: note: lookup resolved in '/var/folders/yt/6ck4znss62l7v2tk_2qsqg680000gp/T/xcrun_db' : '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal'
/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/bin/metal
%
% xcrun metal --version
Apple metal version 32023.850 (metalfe-32023.850.10)
Target: air64-apple-darwin25.2.0
Thread model: posix
InstalledDir: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/metal/current/bin
%
% xcrun --sdk macosx metal --version
Apple metal version 32023.850 (metalfe-32023.850.10)
Target: air64-apple-darwin25.2.0
Thread model: posix
InstalledDir: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/metal/current/bin
%
% xcrun --sdk macosx26.2 metal --version
Apple metal version 32023.850 (metalfe-32023.850.10)
Target: air64-apple-darwin25.2.0
Thread model: posix
InstalledDir: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw/Metal.xctoolchain/usr/metal/current/bin
%
% mount | grep MetalToolchain
/dev/disk7s1 on /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw (apfs, sealed, local, read-only, journaled, nobrowse)
%
% ls -ldfT / /private /private/var /private/var/run /private/var/run/com.apple.security.cryptexd /private/var/run/com.apple.security.cryptexd/mnt /private/var/run/com.apple.security.cryptexd/mnt
drwxr-xr-x  22 root  wheel    704 Nov 22 13:49:28 2025 /
drwxr-xr-x   6 root  wheel    192 Feb  9 19:31:10 2026 /private
drwxr-xr-x  35 root  wheel   1120 Jan 19 14:57:04 2026 /private/var
drwxrwxr-x  32 root  daemon  1024 Feb  9 19:46:12 2026 /private/var/run
drwx---r-x   8 root  daemon   256 Feb  9 19:31:22 2026 /private/var/run/com.apple.security.cryptexd
drwxr-xr-x   3 root  daemon    96 Feb  9 19:47:40 2026 /private/var/run/com.apple.security.cryptexd/mnt
drwxr-xr-x   3 root  daemon    96 Feb  9 19:47:40 2026 /private/var/run/com.apple.security.cryptexd/mnt
%
% ls -lT /private/var/run/com.apple.security.cryptexd/mnt
total 0
drwxr-xr-x  4 root  wheel  128 Nov 12 23:56:17 2025 com.apple.MobileAsset.MetalToolchain-v17.3.48.0.Nbv3Sw
%

comment:9 Changed 6 days ago by breun (Nils Breunese)

Any idea what's wrong here, Mark?

comment:10 Changed 5 days ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:11 in reply to:  9 ; Changed 4 days ago by markmentovai (Mark Mentovai)

Replying to breun:

Any idea what's wrong here, Mark?

Everything in comment 8 looks totally correct. I’d expect the build to succeed on that bot on the basis of what’s shown, assuming it’s running MacPorts 2.11.6 or later with the initgroups fix.

Can the build be retried? Then, only if it fails, we can repeat the investigation, in particular of the xcrun_verbose=1 xcrun --find commands?

Nils, note that the OpenJDK build has this quirk, where it finds metal by running xcrun -sdk macosx metal. The -sdk macosx circumvents the MacPorts-set SDKROOT, which may be undesirable, and results in xcrun using a different cache key than it would otherwise use. But JDK calling out -sdk macosx is why I asked for xcrun --sdk macosx --find metal above, and as you’ll see from Ryan’s response, xcrun was still able to resolve metal properly even with the SDK specified by that name. I don’t think that this is our problem, but you might still want to address it in the JDK ports regardless.

comment:12 in reply to:  11 Changed 4 days ago by ryandesign (Ryan Carsten Schmidt)

Replying to markmentovai:

Can the build be retried?

Sure; they'll show up at https://build.macports.org/builders/ports-26_arm64-watcher/builds/4679 tomorrow. (Until then, that URL will show "No such resource".)

comment:13 Changed 2 days ago by breun (Nils Breunese)

Failed again sadly.

openjdk21 (https://build.macports.org/builders/ports-26_arm64-builder/builds/28552/steps/install-port/logs/stdio):

checking for metal... [not found]
checking if metal can be run using xcrun... no
configure: error: XCode tool 'metal' neither found in path nor with xcrun
configure exiting with result code 1

openjdk25 (https://build.macports.org/builders/ports-26_arm64-builder/builds/28553/steps/install-port/logs/stdio):

checking for metal... [not found]
checking if metal can be run using xcrun... no
configure: A full XCode is required to build the JDK (not only command line tools)
configure: If you have XCode installed, you might need to reset the Xcode active developer directory
configure: using 'sudo xcode-select -r'
configure: error: XCode tool 'metal' neither found in path nor with xcrun
configure exiting with result code 1

qt6-qtwebengine (https://build.macports.org/builders/ports-26_arm64-builder/builds/28554/steps/install-port/logs/stdio):

error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain

Ryan, could you repeat Mark's commands on the buildbot ("repeat the investigation, in particular of the xcrun_verbose=1 xcrun --find commands")?

Last edited 2 days ago by breun (Nils Breunese) (previous) (diff)
Note: See TracTickets for help on using tickets.