Skip to content

Conversation

@0xcadams
Copy link
Member

@0xcadams 0xcadams commented Jan 7, 2026

When installing @rocicorp/zero-sqlite3 with Bun (e.g., in a Docker container using oven/bun:1), the install fails and falls back to node-gyp, which requires Python and build tools:

prebuild-install warn install 'better-sqlite3' is not yet supported in Bun.
gyp ERR! find Python You need to install the latest version of Python.

Root Cause

prebuild-install actually succeeds in downloading and extracting the prebuilt binary under Bun. However, Bun prints a dumb compatibility warning and causes the process to exit with code 1. The original install script used ||, so any non-zero exit triggered the node-gyp fallback.

Solution

Change the install script to check if the binary file exists before falling back to node-gyp.

This handles the case where prebuild-install exits non-zero but still successfully downloaded the binary. The check is cross-platform (works on Windows, Linux, macOS).

Testing

Verified in oven/bun:1 Docker container - install now completes successfully without requiring Python or build tools.

You can test with:

docker run --rm -v ./:/app -w /app oven/bun:1 sh -c '
    rm -rf build && 
    bun run install; 
    echo "Exit code: $?"; 
    ls build/Release/better_sqlite3.node 2>/dev/null && echo "Success!" || echo "Failed"
  '

@0xcadams 0xcadams requested a review from tantaman January 7, 2026 19:58
@0xcadams
Copy link
Member Author

0xcadams commented Jan 7, 2026

Demo of this working:

rocicorp/onboarding#20

Copy link
Contributor

@tantaman tantaman left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks for figuring this out.

@tantaman
Copy link
Contributor

tantaman commented Jan 8, 2026

To make a new release you'll have to:

  1. create a tag for the new version
  2. push the tag
  3. create the release for that tag in github

tag format: https://github.com/rocicorp/zero-sqlite3/tags

@0xcadams 0xcadams merged commit d365884 into main Jan 8, 2026
20 of 25 checks passed
@0xcadams 0xcadams deleted the 0xcadams/bun branch January 8, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants