Skip to content

fix: bundle sqlite-jdbc to fix wheels new on lucee 7 - #8

Merged
bpamiri merged 1 commit into
masterfrom
peter/bundle-sqlite-jdbc
Apr 25, 2026
Merged

fix: bundle sqlite-jdbc to fix wheels new on lucee 7#8
bpamiri merged 1 commit into
masterfrom
peter/bundle-sqlite-jdbc

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a pinned sqlite_jdbc resource (3.49.1.0 from Maven Central, sha256 verified) and stages it into share/wheels/lib/.
  • Wrapper drops the JAR into ~/.wheels/express/<lucee>/lib/ext/ on every run, idempotent (copies only if missing).
  • Adds a brew-test assertion that the JAR ships in the Cellar.

Why

Companion to wheels-dev/wheels#2304. Lucee 7's BundleProvider crashes when resolving org.xerial.sqlite-jdbc via the bundleName hint (malformed entry javassist-3.9.0.GA copy.jar in the upstream S3 bundle listing). That PR dropped the hint from the SQLite datasource block emitted by wheels new. Without the hint, Lucee falls back to classpath resolution — but only if the JAR is actually on the classpath, which it isn't in any released Wheels distribution today. Without this companion change, wheels migrate latest after wheels new would fail with ClassNotFoundException: org.sqlite.JDBC on Homebrew installs.

Why the wrapper, not the install step

LuCLI extracts Lucee lazily into $LUCLI_HOME/express/<lucee-version>/ on first invocation. At brew-install time the express dir doesn't exist yet, so we can't drop the JAR straight in. Instead, the wrapper checks each invocation: if ~/.wheels/express/*/lib/ext/ exists and the JAR isn't there, copy it. The first wheels new run is a no-op for the JAR (LuCLI is extracting); the next run (typically wheels migrate latest) sees the now-extracted express dir and lands the JAR before exec. Self-healing — also recovers if the user wipes ~/.wheels and reinstalls.

Test plan

  • brew test wheels after install — new assertion verifies JAR is staged.
  • Run wheels new blogtest && cd blogtest && wheels migrate latest on a clean machine — confirm db/development.sqlite is non-zero size and tables exist (sqlite3 db/development.sqlite '.schema').
  • Verify the JAR appears in ~/.wheels/express/<lucee-version>/lib/ext/ after wheels migrate latest runs.

🤖 Generated with Claude Code

Lucee 7's BundleProvider crashes when resolving sqlite-jdbc via the
bundleName hint (malformed entry in upstream S3 bundle listing), so
wheels-dev/wheels#2304 dropped the hint from the datasource emitted by
`wheels new`. Without the hint Lucee falls back to classpath resolution,
which requires the JAR to be on the Lucee lib path.

This formula now:
- Adds a `sqlite_jdbc` resource (3.49.1.0 from Maven Central, sha256
  pinned) and stages it into share/wheels/lib/.
- Drops the JAR into ~/.wheels/express/<lucee>/lib/ext/ on every run
  via the wrapper, idempotent — copies only if missing. The express
  directory only exists after the first LuCLI extraction, so the copy
  is a no-op on the first invocation and self-heals from the second
  invocation onward (which is fine — `wheels new` doesn't touch the
  database; `wheels migrate latest` does).
- Adds a brew-test assertion that the JAR is staged into the Cellar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri
bpamiri merged commit 31c2442 into master Apr 25, 2026
1 check passed
@bpamiri
bpamiri deleted the peter/bundle-sqlite-jdbc branch April 25, 2026 23:34
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.

1 participant