ComposioHQ/composio · error · Error

Swift build completed but ${target.buildPath} was not produc

Error message

Swift build completed but ${target.buildPath} was not produced.

What it means

`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.

Source

Thrown at ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts:159

  }

  if (replacementCount > 0) {
    console.log(
      `Patched ${replacementCount} BetterSwiftAX Accessibility constants for the current macOS SDK.`
    );
  }
};

const buildTarget = async (target: Target) => {
  console.log(`Building imessage-cli for ${target.platform} (${target.swiftArch})...`);
  await patchBetterSwiftAxForCurrentSdk();
  await $`swift build -c release --product imessage-cli --arch ${target.swiftArch}`.cwd(
    submodulePath
  );

  const builtBinary = path.join(submodulePath, target.buildPath);
  if (!(await exists(builtBinary))) {
    throw new Error(`Swift build completed but ${target.buildPath} was not produced.`);
  }

  const targetDir = path.join(outputRoot, target.platform);
  const outputBinary = path.join(targetDir, 'imessage-cli');
  await fs.mkdir(targetDir, { recursive: true });
  await fs.copyFile(builtBinary, outputBinary);
  await fs.chmod(outputBinary, 0o755);
  console.log(`Wrote ${path.relative(repoRoot, outputBinary)}`);
};

const writeNotice = async (params: { version: string; commit: string }) => {
  const notice = `# Beeper platform-imessage CLI binary

These \`imessage-cli\` binaries are built from the Composio fork of Beeper platform-imessage.

- Upstream fork: \`${upstreamRepository}\`
- Upstream version: \`${params.version}\`
- Upstream submodule commit: \`${params.commit}\`

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Check `swift build --show-bin-path -c release --arch <arch>` and align target.buildPath with the actual output directory.
  2. Verify the product is still named imessage-cli in the submodule's Package.swift; update script and buildPath if renamed.
  3. Clean .build and rebuild to rule out stale/partial artifacts.
Defensive patterns

Strategy: validation

Validate before calling

import { exists } from 'fs/promises';
const builtBinary = path.join(submodulePath, target.buildPath);
if (!(await exists(builtBinary))) {
  const binPath = (await $`swift build --show-bin-path -c release --arch ${target.swiftArch}`.cwd(submodulePath)).stdout.trim();
  // use path.join(binPath, 'imessage-cli') instead
}

Prevention

When it happens

Trigger: 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.

Common situations: Newer Swift toolchains changing .build layout; product name mismatch in Package.swift (imessage-cli renamed upstream).

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/3f07ccecb1710276. Report an issue: GitHub.