Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions packages/opencode/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ for (const item of targets) {
tsconfig: "./tsconfig.json",
plugins: [solidPlugin],
sourcemap: "external",
// Packages that must NOT be bundled into the compiled binary.
// They are loaded lazily via dynamic import() at runtime.
// Packages excluded from the compiled binary — loaded lazily at runtime.
// NOTE: @altimateai/altimate-core is intentionally NOT external — it's a
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Removing @altimateai/altimate-core from the external list will break builds for target platforms like linux-musl and win32-arm64 because pre-built native binaries for this package don't exist for them.
Severity: CRITICAL

Suggested Fix

Either add @altimateai/altimate-core to the list of packages that install binaries for all platforms (using --os="*" --cpu="*"), keep it as an external dependency for the unsupported platforms, or filter out the unsupported targets from the build matrix.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/opencode/script/build.ts#L203

Potential issue: The change removes `@altimateai/altimate-core` from the `external`
list, causing it to be bundled during the build process. However,
`@altimateai/altimate-core` is a native module and lacks pre-built binaries for several
target platforms defined in the build script, including `linux-x64-musl`,
`linux-arm64-musl`, and `win32-arm64`. When the CI pipeline attempts to build for these
unsupported platforms, the `bun` compiler will fail to find the required native binary.
This will either cause the build to fail outright or produce a broken binary that
crashes at runtime with a "Cannot find module" error, preventing the CLI from working on
those platforms.

Did we get this right? 👍 / 👎 to inform future reviews.

// napi binary that must be bundled for the CLI to work out of the box.
external: [
// altimate-core napi binary — ~50MB per platform, loaded on first tool call
"@altimateai/altimate-core",
// dbt integration — heavy transitive deps (electron, aws-sdk, etc.)
// dbt integration — heavy transitive deps, loaded on first dbt operation
"@altimateai/dbt-integration",
// Database drivers — users install on demand
// Database drivers — users install on demand per warehouse
"pg", "snowflake-sdk", "@google-cloud/bigquery", "@databricks/sql",
"mysql2", "mssql", "oracledb", "duckdb", "better-sqlite3",
// Optional infra packages
Expand Down
Loading