{"record":{"id":"122be0d476bdd41e","repo":"ComposioHQ/composio","slug":"swift-package-resolution-completed-but-the-betters","errorCode":null,"errorMessage":"Swift package resolution completed but the BetterSwiftAX AccessibilityControl checkout was not found.","messagePattern":"Swift package resolution completed but the BetterSwiftAX AccessibilityControl checkout was not found\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts","lineNumber":115,"sourceCode":"  for (const candidate of licenseCandidates) {\n    const sourcePath = path.join(submodulePath, candidate);\n    if (await exists(sourcePath)) {\n      await fs.copyFile(sourcePath, path.join(outputRoot, 'LICENSE.txt'));\n      return;\n    }\n  }\n  throw new Error('No upstream license file found in platform-imessage submodule.');\n};\n\nconst patchBetterSwiftAxForCurrentSdk = async () => {\n  await $`swift package resolve`.cwd(submodulePath);\n\n  const checkoutRoot = path.join(\n    submodulePath,\n    '.build/checkouts/BetterSwiftAX/Sources/AccessibilityControl'\n  );\n  if (!(await exists(checkoutRoot))) {\n    throw new Error(\n      'Swift package resolution completed but the BetterSwiftAX AccessibilityControl checkout was not found.'\n    );\n  }\n\n  let replacementCount = 0;\n  for (const fileName of betterSwiftAxFallbackFiles) {\n    const sourcePath = path.join(checkoutRoot, fileName);\n    if (!(await exists(sourcePath))) {\n      throw new Error(\n        `Swift package resolution completed but BetterSwiftAX ${fileName} was not found.`\n      );\n    }\n\n    const source = await fs.readFile(sourcePath, 'utf8');\n    let fileReplacementCount = 0;\n    const patched = source.replace(betterSwiftAxConstantReferencePattern, constantName => {\n      fileReplacementCount += 1;\n      return betterSwiftAxConstantLiteral(constantName);","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts#L97-L133","documentation":"After `swift package resolve`, the script patches the BetterSwiftAX sources in the expected checkout directory (.build/checkouts/BetterSwiftAX/Sources/AccessibilityControl). If that directory doesn't exist, dependency resolution silently changed (renamed package, different product layout) and patching cannot proceed.","triggerScenarios":"A newer BetterSwiftAX version reorganized its Sources tree or renamed the package/product, so the hardcoded checkout path is absent after resolution.","commonSituations":"Unpinned Swift dependencies (missing/outdated Package.resolved); upstream repo restructuring.","solutions":["Pin BetterSwiftAX to the known-good revision in Package.resolved / submodule and re-run.","Inspect .build/checkouts/ to find the new layout and update checkoutRoot in the script accordingly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const checkoutRoot = path.join(submodulePath, '.build/checkouts/BetterSwiftAX/Sources/AccessibilityControl');\nif (!(await exists(checkoutRoot))) {\n  throw new Error('BetterSwiftAX layout changed — pin the dependency or update checkoutRoot');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit Package.resolved so `swift package resolve` is deterministic.","After any dependency bump, run the patch step in isolation to catch layout changes early."],"tags":["swift-package-manager","dependency-resolution","build-script"],"backgroundTag":"dependency-checkout-path-changed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}