Skip to content

error: Could not compute dependency graph: Error Domain=NSPOSIXErrorDomain Code=86 "Bad CPU type in executable" #836

@torarnv

Description

@torarnv

When swift-build computes the dependency graph for a build it seems to resolve the toolchains available on the system, which may include tools that are x86_64 only. If Rosetta2 is not installed, this results in a hard-failure for every build in Xcode/xcodebuild on Apple Silicon system:

Image

Installing Rosetta2, and then watching process creation via Process Monitor during a build shows:

{
  "event": "ES_EVENT_TYPE_NOTIFY_EXEC",
  "timestamp": "2025-10-02 09:39:14 +0000",
  "process": {
    "pid": 35254,
    "name": "qcc",
    "path": "/opt/qnx700/host/darwin/x86_64/usr/bin/qcc",
    "uid": 501,
    "architecture": "unknown",
    "arguments": [
      "/opt/qnx700/host/darwin/x86_64/usr/bin/qcc",
      "-dM",
      "E",
      "-x",
      "c",
      "-c",
      "/dev/null",
      "-o",
      "/dev/null"
    ],
    "ppid": 35253,
    "rpid": 34691,
    "ancestors": [
      34691,
      1
    ],
    "signing info (reported)": {
      "csFlags": 0,
      "platformBinary": 0,
      "signingID": "",
      "teamID": "",
      "cdHash": "0000000000000000000000000000000000000000"
    },
    "signing info (computed)": {
      "signatureStatus": -67062
    }
  }
}

With SWBBuildService as its parent process.

I don't know if there's any way to opt out of (specific) toolchain lookups?

In any case, the logic here for QNX, or possibly at a higher level, should probably handle the situation gracefully by treating it as the toolchain not found, possibly with an explicit warning, rather than the opaque "Bad CPU type in executable" with no info about which executable failed to run 😄

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions