Seeing the same swift runtime: backtrace-on-crash is not supported for privileged executables warning spammed all across our CI when testing macOS 26. Not sure which process is causing it yet.
A bunch of system tools on macOS 26 seem to be written in Swift, resulting in this warning when simply exporting SWIFT_BACKTRACE="enable=yes" to get backtraces from crashing processes:
torarne@macos-26-0-beta2 ~ % export SWIFT_BACKTRACE="enable=yes"
torarne@macos-26-0-beta2 ~ % launchctl version
swift runtime: backtrace-on-crash is not supported for privileged executables.
Darwin Bootstrapper Version 7.0.0: Fri Jun 13 01:32:47 PDT 2025; root:libxpc_executables-3088~37/launchd/RELEASE_ARM64E
torarne@macos-26-0-beta2 ~ % export SWIFT_BACKTRACE="enable=no"
torarne@macos-26-0-beta2 ~ % launchctl version
Darwin Bootstrapper Version 7.0.0: Fri Jun 13 01:32:47 PDT 2025; root:libxpc_executables-3088~37/launchd/RELEASE_ARM64E
torarne@macos-26-0-beta2 ~ % export SWIFT_BACKTRACE="enable=yes,warnings=suppressed"
torarne@macos-26-0-beta2 ~ % launchctl version
Darwin Bootstrapper Version 7.0.0: Fri Jun 13 01:32:47 PDT 2025; root:libxpc_executables-3088~37/launchd/RELEASE_ARM64E
torarne@macos-26-0-beta2 ~ %
Just saw the feedback that was filed here. This behaviour is by design — if you explicitly turn backtracing on, and run a process that is in some way privileged, you get a message telling you that it's not supported for that executable. It only happens if you force it on though; if it's turned on because it's on by default (e.g. because your program is running with stdout bound to a terminal on Linux or a new enough macOS), you won't get a warning in that case.
On macOS specifically, for system security reasons, "privileged" binaries includes everything that isn't signed with the get-task-allow privilege. Ideally if you're forcing the setting on, you'd do it for the executable you particularly care about, rather than for everything, but if you're doing this in a CI system where that might not be an option, you can indeed use the warnings=suppressed option — which is exactly what that was designed for.
My question is about warnings=suppressed not yet parsing: if it works for others, I must be using it wrong or have the wrong runtime.
What macOS release includes this in the runtime? Is there a way to check the version of the swift runtime on macOS?
It seems to fail on (latest) macOS 15.5 (from 5/12/25) when the commit for suppressing warnings in Backtrace.cpp was 2/14/25.
Below I happen to be using arm64 swift-dev as the binary to trigger the privilege warning. The result is the same for x86_64 and Xcode swift.
$ uname -rsm
Darwin 24.5.0 arm64
$ export SWIFT_BACKTRACE="enable=tty,warnings=suppressed"
$ swift --version
swift runtime: unknown backtracing setting 'warnings'
swift runtime: backtrace-on-crash is not supported for privileged executables.
...
Apple Swift version 6.2-dev (LLVM db18f41b83ba42e, Swift 0bf7b29acffa775)
Perhaps the doc change to say the macOS default is no before {some macOS version} and tty after? Here's the doc cited above:
Key
Default
enable
yes*
Set to no to disable crash catching, or tty to enable only if stdin is a terminal
(*) On macOS, this defaults to no rather than yes.`
I believe the warnings=suppressed option is in the latest developer betas, but it's likely not present before then. The best thing is to only set SWIFT_BACKTRACE explicitly for the program you're actually trying to test, rather than setting it more widely.
For the record, warnings is not recognized in macOS 15.6 on intel or arm, so probably can’t be expected in 15.any, and the recommended solution of only setting it per-program is even more compelling…