Commit da9058f
fix(cli): wheels start auto-stages SQLite driver to close fresh-VM F8 (#2349)
* feat(cli): add Wheels SQLite Lucee extension (.lex) for fresh-VM bundle gap
Build, install, and ship a Lucee CFML extension that packages the xerial
sqlite-jdbc OSGi bundle so Lucee 7 can resolve `org.sqlite.JDBC` for
`wheels new` SQLite-by-default datasources without manual JAR drops.
This addresses fresh-VM onboarding finding F8 — the SQLite class-load
cliff that blocks every fresh `wheels migrate latest` because Lucee 7
ships drivers for MySQL/MSSQL/PostgreSQL/HSQLDB but not SQLite.
What's in tools/lucee-extensions/sqlite/:
- src/build.properties + src/SQLite.cfc + src/sqlite-jdbc-3.49.1.0.jar
(vendored from Maven Central) — extension source.
- build.sh produces dist/org.xerial.sqlite-jdbc-3.49.1.0.lex (~14 MB).
Mirrors the layout/manifest of lucee/extension-jdbc-postgresql and
lucee/extension-jdbc-duckdb but uses bash+zip instead of Ant.
- install.sh drops the patched bundle straight into a Lucee server's
lucee-server/bundles/ directory — deterministic on Lucee 7 and the
recommended path until the deploy/ auto-install quirk is solved.
- README documents three install paths (bundle/.lex/admin UI), the
upstream upgrade plan, and the OSGi manifest patch.
The non-obvious fix: xerial's JAR is a valid OSGi bundle, but it
declares `Require-Capability: osgi.ee;version=1.8` (exact match in some
resolvers). Felix on Java 21 cannot satisfy that, so the bundle is
silently rejected. build.sh patches the JAR's MANIFEST.MF to
`(version>=1.8)` (matching PostgreSQL's filter) and drops the
`;singleton:=true` directive on Bundle-SymbolicName. Original JAR in
src/ is untouched — the patch is applied during build.
Verified end-to-end on macOS arm64 + Lucee 7.0.0.395:
BEFORE install.sh: dbtest -> FAIL "org.xerial.sqlite-jdbc not available locally"
AFTER install.sh: dbtest -> OK datasource=sqliteapp result=1
AFTER install.sh: wheels migrate latest creates tables in db/development.sqlite
Follow-ups (separate PRs):
1. Wire `wheels new` (or first `wheels start`) to auto-run install.sh
against the freshly-created server so SQLite-by-default works
zero-config on fresh VMs.
2. Debug Lucee 7's deploy/ -> failed-to-deploy/ silent quarantine so
the canonical deploy/ install path works without falling back to
the bundle drop.
3. File upstream PR as lucee/extension-jdbc-sqlite once stable so the
Lucee community gets it via the standard update server, and a
separate issue with xerial/sqlite-jdbc to relax their OSGi
Require-Capability filter.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(cli): close 0.0.0-dev version display gap on installed Wheels apps
Two compounding bugs caused the dev toolbar / /wheels/info to report
"Wheels Version: 0.0.0-dev" on installed (brew/chocolatey) apps even
though every release artifact already carries the precise SNAPSHOT
build version. Both are fixed here.
## Bug 1 — wheels-module tarball never substitutes module.json
release.yml's "Build Wheels Module Tarball" step tars cli/lucli/
directly with no version substitution, while wheels-core/wheels-base
(which run through prepare-*.sh) get @build.version@ properly replaced.
As a result every wheels-module-*.tar.gz on the GitHub releases page
ships with module.json's hardcoded "version": "4.0.0" — even though
the tag itself is "v4.0.0-SNAPSHOT+1625".
That hardcoded value is then read by BaseModule.version() at runtime
and fed into FrameworkInstaller.rewriteVersionPlaceholder as the
cliVersion fallback (added in #2343 / #2333), so on installs whose
vendor/wheels/box.json went through that fallback path, the framework
"version" is the imprecise "4.0.0" instead of the build's
"4.0.0-SNAPSHOT+1625".
Fix: change cli/lucli/module.json to use "version": "@build.version@"
(matching every other manifest in the repo), and add the same find +
sed substitution release.yml's other build steps already do, in the
"Build Wheels Module Tarball" step before tar/zip. Uses an env: block
to satisfy our workflow injection lint and avoids inlining the version
into shell commands.
## Bug 2 — runtime fallback only recognizes the monorepo's box.json
When vendor/wheels/box.json's @build.version@ leaks through scaffold-
time substitution (e.g. user's CLI is pre-#2343, or any other gap in
the install pipeline), Global.cfc:$readFrameworkVersion's fallback
walks two levels up looking for the wheels-dev/wheels monorepo's
box.json — and only synthesizes "<rootversion>-dev" when slug=="wheels"
or name=="Wheels.fw". An installed app's app-root box.json comes from
wheels-base-template (slug=wheels-base-template), which carries the
precise framework SNAPSHOT version stamped at release time — but the
fallback rejects it because the monorepo signal is absent. Fall-through
returns the bare "0.0.0-dev" sentinel.
Fix: extend the fallback so when the monorepo signal is missing AND
the parent's box.json self-identifies as wheels-base-template (slug or
name match), use its version verbatim (no -dev suffix — that version is
the actual installed framework version, not an upcoming dev build).
The monorepo signal still wins when both could match; both signals are
ignored if their version is itself the unreplaced placeholder.
Three new specs in frameworkVersionSpec.cfc cover the new path,
including the precedence ordering and the placeholder guard. Existing
specs (including the regression for #2291) still pass.
## Verification
- Framework suite: 3333 passed (no regressions).
- CLI suite: 452 pass, 3 fail — pre-existing DoctorSpec issues (#2260),
unrelated.
- Local dry-run of the release.yml sed substitution: cli/lucli/module.json
picks up MODULE_VERSION, no other false positives in cli/lucli/.
Closes #2326.
* fix(cli): wheels start auto-stages SQLite driver to close fresh-VM F8
Closes #2326. After this PR, `wheels new` + `wheels start` works with the
zero-config SQLite default datasource on any install path — brew, choco,
dev checkout, manual — without the user needing to drop a JAR by hand.
## Background
Lucee 7's stock Express distribution ships JDBC drivers for MySQL, MSSQL,
PostgreSQL, and HSQLDB but not SQLite. `wheels new`, however, writes
SQLite as the zero-config default (`class: "org.sqlite.JDBC"`,
`connectionString: "jdbc:sqlite:..."`). Without a SQLite JAR somewhere
Lucee can find it (Tomcat classpath via lib/ext/ or an OSGi bundle in
lucee-server/bundles/), every fresh app fails on the first request:
ClassException: org.sqlite.JDBC
The brew formula already drops the upstream xerial JAR into
`~/.wheels/express/<lucee>/lib/ext/` from a wrapper script, but that only
covers brew installs. Chocolatey, dev checkouts, and manual installs all
hit F8 on the first VM cycle.
## What this changes
- `cli/lucli/services/BundleStager.cfc` (new) — extracted from Module.cfc
for unit-testability. Two methods:
- `projectUsesSqliteDatasource(projectRoot)` — true if config/app.cfm
references `jdbc:sqlite:`, `org.sqlite.JDBC`, or
`org.xerial.sqlite-jdbc`. Detection covers both the legacy app.cfm
format (which carried the bundleName hint) and the current format
post-#2304 which omits the hint and relies on classpath resolution.
- `stageIntoLibExt(bundleSrc, expressRoot, jarFileName)` — copies the
JAR into every Lucee version's `lib/ext/`. Idempotent, best-effort,
returns `{staged, skipped, failed}` for testability.
- `cli/lucli/Module.cfc` — `start()` calls `$ensureWheelsBundles()` both
before and after delegating to LuCLI's `server start`. Pre-stage covers
the case where the express dir already exists; post-stage covers the
very first invocation that just extracted express. Either way, `wheels
start` and `wheels start --force` end up with the JAR on the classpath
before Lucee resolves any SQLite datasource.
`$resolveLucliHome()` follows LuCLI's own resolution order:
1. `$LUCLI_HOME` env var (e.g. brew wrapper exports `$HOME/.wheels`),
2. `$HOME/.<lucli.binary.name>` — picks `~/.wheels` for `wheels`
invocations and `~/.lucli` for bare `lucli`,
3. `$HOME/.lucli` fallback.
- `cli/lucli/resources/extensions/sqlite/org.xerial.sqlite-jdbc-3.49.1.0.jar`
(~13 MB) — patched JAR baked into the wheels-module distribution. Built
from `tools/lucee-extensions/sqlite/build.sh` (#2347), which patches
upstream's `Require-Capability: osgi.ee;version=1.8` (exact match — fails
on Felix + Java 21) to `(version>=1.8)` matching the PostgreSQL bundle's
filter.
- `cli/lucli/tests/specs/services/BundleStagerSpec.cfc` (new, 10 specs) —
detection edge cases, multi-version Express layouts, idempotency, and
defensive behavior when the bundle source or express dir is missing.
## Bypass cases (separate follow-ups)
- `wheels server start --force` is a LuCLI built-in passthrough (not
routed through Module.cfc). Users hit by this can use `wheels start
--force` instead. F5 in the journal already tracks updating the error
message that points users at the bypass form.
- Lucee caches a per-process negative bundle resolution. If a user hits a
SQLite endpoint before the JAR is staged, restart the server. The
pre-stage in `start()` makes this only matter on a single end-of-train
user; the post-stage seeds for the next start.
## Verification
- Framework suite: 3333 passed (no regressions).
- CLI suite: 462 passed, 3 fail — pre-existing DoctorSpec issues (#2260),
unrelated. Of the 462, 10 are new BundleStagerSpec coverage.
- End-to-end: on a clean macOS arm64 + JDK 21 env with no SQLite JAR
anywhere, `wheels new finalapp` + `wheels start` + `curl /dbtest.cfm`
returns `OK datasource=finalapp result=1` zero-config. Pre-stage logs
show the JAR copied into `~/.wheels/express/7.0.0.395/lib/ext/`.
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4f1914d commit da9058f
4 files changed
Lines changed: 374 additions & 0 deletions
File tree
- cli/lucli
- resources/extensions/sqlite
- services
- tests/specs/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
363 | 375 | | |
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
367 | 379 | | |
368 | 380 | | |
369 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
370 | 389 | | |
371 | 390 | | |
372 | 391 | | |
| |||
3672 | 3691 | | |
3673 | 3692 | | |
3674 | 3693 | | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
3675 | 3788 | | |
3676 | 3789 | | |
3677 | 3790 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
0 commit comments