{"record":{"id":"8257418e90f87749","repo":"stablyai/orca","slug":"unsupported-macos-build-architecture-architectu","errorCode":null,"errorMessage":"Unsupported macOS build architecture: ${architecture}","messagePattern":"Unsupported macOS build architecture: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/mac-build-compatibility.cjs","lineNumber":9,"sourceCode":"const { writeFileSync } = require('node:fs')\nconst { join } = require('node:path')\nconst compatibilityContract = require('../../src/shared/local-build-compatibility-contract.json')\n\nconst MAC_BUILD_COMPATIBILITY_FILENAME = 'orca-local-build.json'\n\nfunction createMacBuildCompatibility({ version, commit, architecture }) {\n  if (architecture !== 'arm64' && architecture !== 'x64') {\n    throw new Error(`Unsupported macOS build architecture: ${architecture}`)\n  }\n  return {\n    ...compatibilityContract,\n    buildId: `${version}-${commit}-${architecture}`,\n    version,\n    commit,\n    platform: 'darwin',\n    architecture\n  }\n}\n\nfunction writeMacBuildCompatibility(resourcesDir, identity) {\n  const compatibility = createMacBuildCompatibility(identity)\n  writeFileSync(\n    join(resourcesDir, MAC_BUILD_COMPATIBILITY_FILENAME),\n    `${JSON.stringify(compatibility, null, 2)}\\n`,\n    'utf8'\n  )","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/mac-build-compatibility.cjs#L1-L27","documentation":"createMacBuildCompatibility writes a per-build compatibility descriptor for macOS and only accepts arm64 or x64 architectures. The architecture flows into the buildId and the descriptor's architecture field consumed by compatibility checks; an unknown value would produce a descriptor no consumer recognizes. This is a build-time guard in a CommonJS module.","triggerScenarios":"Calling createMacBuildCompatibility with architecture set to a value other than 'arm64'/'x64' — e.g. 'arm', 'x86_64', 'universal', undefined, or a process.arch like 'ia32'.","commonSituations":"Passing process.arch from a non-Mac host (e.g. 'linux' or 'win32'), using a universal-build label that the contract does not model, or a build matrix variable emitting the wrong arch string.","solutions":["Pass exactly 'arm64' or 'x64' to createMacBuildCompatibility.","Normalize upstream: map process.arch/process.env targets to the two accepted values before calling.","If a universal build is needed, write two descriptors (one per arch) rather than inventing a third value."],"exampleFix":"// before\ncreateMacBuildCompatibility({ version, commit, architecture: 'arm' })\n\n// after\ncreateMacBuildCompatibility({ version, commit, architecture: 'arm64' })","handlingStrategy":"type-guard","validationCode":"const MAC_ARCHS = ['arm64', 'x64']\nif (!MAC_ARCHS.includes(architecture)) {\n  throw new Error(`architecture must be one of ${MAC_ARCHS.join(',')}, got ${architecture}`)\n}","typeGuard":"const isMacArch = (a) => a === 'arm64' || a === 'x64'","tryCatchPattern":null,"preventionTips":["Normalize process.arch to the accepted set before calling.","Emit one descriptor per concrete arch rather than a 'universal' label.","Add a unit test covering arm64/x64 plus a rejection case."],"tags":["validation","architecture","macos","build"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}