stablyai/orca · error

Unsupported local-build compatibility architecture: ${contex

Error message

Unsupported local-build compatibility architecture: ${context.arch}

What it means

On macOS afterPack, electron-builder's `context.arch` numeric enum is mapped via `{ 1: 'x64', 3: 'arm64' }` to determine the local-build compatibility architecture. Only x64 (1) and arm64 (3) are supported for writing the mac-build-compatibility metadata. If context.arch is 0 (ia32), 2 (armv7l), or 4 (universal), the mapping returns undefined and this error fires.

Source

Thrown at config/electron-builder.config.cjs:227

      verifyLinuxGlibcFloor(context.appOutDir)
    }
    const resourcesDir =
      context.electronPlatformName === 'darwin'
        ? join(
            context.appOutDir,
            `${context.packager.appInfo.productFilename}.app`,
            'Contents',
            'Resources'
          )
        : join(context.appOutDir, 'resources')
    if (!existsSync(resourcesDir)) {
      throw new Error(`Missing packaged resources directory: ${resourcesDir}`)
    }
    if (context.electronPlatformName === 'darwin') {
      const architectureByEnum = { 1: 'x64', 3: 'arm64' }
      const architecture = architectureByEnum[context.arch]
      if (!architecture) {
        throw new Error(`Unsupported local-build compatibility architecture: ${context.arch}`)
      }
      const version = context.packager.appInfo.version
      let commit = process.env.ORCA_BUILD_COMMIT || process.env.GITHUB_SHA || 'unknown'
      if (commit === 'unknown') {
        try {
          commit = execFileSync('git', ['rev-parse', '--short=12', 'HEAD'], {
            encoding: 'utf8'
          }).trim()
        } catch {
          // Source archives can still produce a signed build with an explicit version.
        }
      }
      writeMacBuildCompatibility(resourcesDir, { version, commit, architecture })
    }
    prunePackagedRuntimeNodeModules(resourcesDir, context.electronPlatformName, context.arch)
    verifyPackagedMainRuntimeDeps(resourcesDir)
    // Why: boot the packaged daemon-entry under plain Node, but only for the
    // slice matching the packaging host's arch — daemon-entry.js is JS, yet it

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Check the mac.target configuration in electron-builder.config.cjs:404 — the arch list should only contain 'x64' and 'arm64'.
  2. If you need universal builds, extend the architectureByEnum map at line 224 to include `{ 4: 'universal' }` and handle the universal case in writeMacBuildCompatibility.
  3. If you hit this unexpectedly, log `context.arch` to identify which enum value electron-builder is passing.

Example fix

// before
const architectureByEnum = { 1: 'x64', 3: 'arm64' }

// after — add universal support
const architectureByEnum = { 1: 'x64', 3: 'arm64', 4: 'universal' }
Defensive patterns

Strategy: validation

Validate before calling

// Check arch before running afterPack
function assertMacArch(archEnum) {
  const supported = { 1: 'x64', 3: 'arm64' }
  if (!supported[archEnum]) {
    throw new Error(`macOS arch ${archEnum} not supported for compatibility metadata — use x64 (1) or arm64 (3)`)
  }
}

Type guard

function isSupportedMacArch(archEnum: number): archEnum is 1 | 3 {
  return archEnum === 1 || archEnum === 3
}

Prevention

When it happens

Trigger: Configuring electron-builder to build macOS for an architecture other than x64 or arm64 (e.g., adding 'armv7l' or ia32 to the mac.target arch list). Building a universal binary (context.arch === 4) which this compatibility-metadata path doesn't handle. Electron-builder changing its Arch enum values.

Common situations: Adding a new architecture target to the macOS build config. A change in electron-builder's Arch enum numbering. Attempting to build for an Intel 32-bit macOS target (not supported by modern Electron).

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/817a1c03de224dc7. Report an issue: GitHub.