Skip to content

fix: bundle altimate-core in binary — required at runtime#250

Merged
anandgupta42 merged 1 commit intomainfrom
fix/bundle-altimate-core
Mar 18, 2026
Merged

fix: bundle altimate-core in binary — required at runtime#250
anandgupta42 merged 1 commit intomainfrom
fix/bundle-altimate-core

Conversation

@anandgupta42
Copy link
Contributor

altimate-core was marked external which causes Cannot find module at runtime. It's a napi binary that must be bundled. ~35MB size increase is the Rust SQL engine — acceptable.

…o work

altimate-core is a napi binary that must be in the compiled binary.
Marking it external causes 'Cannot find module' at runtime.

The ~35MB size increase (86→122MB per binary) is acceptable — it's
the Rust SQL engine that powers all 34 analysis methods.

dbt-integration stays external (heavy transitive deps, loaded lazily).
Database drivers stay external (installed per warehouse on demand).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude
Copy link

claude bot commented Mar 18, 2026

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

@anandgupta42 anandgupta42 merged commit bb238d6 into main Mar 18, 2026
6 of 7 checks passed
// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant