fix: bundle altimate-core in binary — required at runtime#250
Merged
anandgupta42 merged 1 commit intomainfrom Mar 18, 2026
Merged
fix: bundle altimate-core in binary — required at runtime#250anandgupta42 merged 1 commit intomainfrom
anandgupta42 merged 1 commit intomainfrom
Conversation
…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 Code ReviewThis repository is configured for manual code reviews. Comment |
| // 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 |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
altimate-core was marked external which causes
Cannot find moduleat runtime. It's a napi binary that must be bundled. ~35MB size increase is the Rust SQL engine — acceptable.