Xcode 15 beta Command PhaseScriptExecution failed with a nonzero exit code

I have a Build Phase which runs a script. The script is a swift file, which I have simplified to illustrate the crash, like so:

#!/usr/bin/env xcrun --sdk macosx swift

import Foundation
import CryptoKit

var sha256 = SHA256()

// Do other stuff...

All the Xcode 15 betas fail to build my app, instead throwing the error: Command PhaseScriptExecution failed with a nonzero exit code.

The logs:

JIT session error: Symbols not found: [ _$s9CryptoKit6SHA256VMa, _$s9CryptoKit6SHA256VACycfC ]
Failed to materialize symbols: { (main, { _$s20PropertyListModifier6sha2569CryptoKit6SHA256Vvp, _main, __swift_FORCE_LOAD_$_swiftDarwin_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftIOKit_$_PropertyListModifier, ___swift_project_value_buffer, __swift_FORCE_LOAD_$_swiftFoundation_$_PropertyListModifier, ___swift_allocate_value_buffer, __swift_FORCE_LOAD_$_swiftObjectiveC_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftXPC_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftCoreFoundation_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftDispatch_$_PropertyListModifier }) }

Does anyone know of a work-around or solution, or does this just look like nothing more than a bug in the betas, which I should "wait out"? It's had the same problem right from beta 1 to the current beta 5 so it's starting to look like it won't be fixed which is worrying me.

Have you checked the User Script Sandboxing build setting? We added this in Xcode 14 (see the release notes) but it’s now the default in Xcode 15 beta and it’s a common cause of weird issues like this.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Sadly that does not seem to be the cause; I checked and found that ENABLE_USER_SCRIPT_SANDBOXING is already set to "No" in my project.

Thanks for your suggestion.

I'm experiencing the same issue using some legacy MD5 code. I get the same output whether I run the script from the command-line or as a build phase script, so I believe this also may be a bug in all of the betas.

#!/usr/bin/swift
import CryptoKit

let hash = Insecure.MD5.hash(data: ...)

I've filed FB12857119

CrunchyBagel wrote:

I've filed FB12857119

Thanks for that.

Marmaladesoul wrote:

BTW should I be able to view your feedback

No. See my Bug Reporting: How and Why? post for the full story here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Xcode 15 beta Command PhaseScriptExecution failed with a nonzero exit code
 
 
Q