{"record":{"id":"3f07ccecb1710276","repo":"ComposioHQ/composio","slug":"swift-build-completed-but-target-buildpath-was","errorCode":null,"errorMessage":"Swift build completed but ${target.buildPath} was not produced.","messagePattern":"Swift build completed but (.+?) was not produced\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts","lineNumber":159,"sourceCode":"  }\n\n  if (replacementCount > 0) {\n    console.log(\n      `Patched ${replacementCount} BetterSwiftAX Accessibility constants for the current macOS SDK.`\n    );\n  }\n};\n\nconst buildTarget = async (target: Target) => {\n  console.log(`Building imessage-cli for ${target.platform} (${target.swiftArch})...`);\n  await patchBetterSwiftAxForCurrentSdk();\n  await $`swift build -c release --product imessage-cli --arch ${target.swiftArch}`.cwd(\n    submodulePath\n  );\n\n  const builtBinary = path.join(submodulePath, target.buildPath);\n  if (!(await exists(builtBinary))) {\n    throw new Error(`Swift build completed but ${target.buildPath} was not produced.`);\n  }\n\n  const targetDir = path.join(outputRoot, target.platform);\n  const outputBinary = path.join(targetDir, 'imessage-cli');\n  await fs.mkdir(targetDir, { recursive: true });\n  await fs.copyFile(builtBinary, outputBinary);\n  await fs.chmod(outputBinary, 0o755);\n  console.log(`Wrote ${path.relative(repoRoot, outputBinary)}`);\n};\n\nconst writeNotice = async (params: { version: string; commit: string }) => {\n  const notice = `# Beeper platform-imessage CLI binary\n\nThese \\`imessage-cli\\` binaries are built from the Composio fork of Beeper platform-imessage.\n\n- Upstream fork: \\`${upstreamRepository}\\`\n- Upstream version: \\`${params.version}\\`\n- Upstream submodule commit: \\`${params.commit}\\`","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts#L141-L177","documentation":"`swift build -c release` exited successfully but the expected binary at target.buildPath (e.g. .build/release/imessage-cli under the arch-specific directory) does not exist. The build configuration changed where it emits products, so the script can't copy the artifact.","triggerScenarios":"Building a target (arm64/x86_64) where Swift renames or relocates the release output — commonly when --arch produces a .build/<triple>/release path instead of the assumed buildPath.","commonSituations":"Newer Swift toolchains changing .build layout; product name mismatch in Package.swift (imessage-cli renamed upstream).","solutions":["Check `swift build --show-bin-path -c release --arch <arch>` and align target.buildPath with the actual output directory.","Verify the product is still named imessage-cli in the submodule's Package.swift; update script and buildPath if renamed.","Clean .build and rebuild to rule out stale/partial artifacts."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { exists } from 'fs/promises';\nconst builtBinary = path.join(submodulePath, target.buildPath);\nif (!(await exists(builtBinary))) {\n  const binPath = (await $`swift build --show-bin-path -c release --arch ${target.swiftArch}`.cwd(submodulePath)).stdout.trim();\n  // use path.join(binPath, 'imessage-cli') instead\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive buildPath from `swift build --show-bin-path` instead of hardcoding it.","Run the build on the exact Swift toolchain version used for the last successful release."],"tags":["swift","build-artifact","release-build"],"backgroundTag":"build-output-not-found","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}