fix: podtui binary crashed with 'preload not found' when launched from repo root
The embedded runtime reads the CWD bunfig.toml at startup; the repo's top-level 'preload = ["@opentui/solid/preload"]' made the standalone die because that module isn't bundled. Removed the ambient preload from bunfig.toml and moved the solid transform registration to explicit --preload flags in the start/dev scripts ([test] preload untouched). Verified: binary boots from repo root, from a clean dir, and dev/start still work; bun test 54 pass. No new release needed — the binaries were never config-dependent; this was purely the repo's bunfig trap.
This commit is contained in:
12
README.md
12
README.md
@@ -70,6 +70,11 @@ sudo install -m755 podtui /usr/local/bin/podtui
|
|||||||
> The tarball contains `podtui` plus `libopentui.<ext>` and
|
> The tarball contains `podtui` plus `libopentui.<ext>` and
|
||||||
> `libcavacore.<ext>` **beside it** — keep them together (don't move just the
|
> `libcavacore.<ext>` **beside it** — keep them together (don't move just the
|
||||||
> binary alone), or the native FFI libraries won't load.
|
> binary alone), or the native FFI libraries won't load.
|
||||||
|
>
|
||||||
|
> One caveat: the embedded runtime reads a `bunfig.toml` from the directory
|
||||||
|
> you launch from. If that file has a `preload` entry (as Bun project
|
||||||
|
> directories often do), startup fails with `preload not found`. Launching
|
||||||
|
> from a normal directory (home, `~/bin`, …) works fine.
|
||||||
|
|
||||||
### 3. Arch Linux (AUR)
|
### 3. Arch Linux (AUR)
|
||||||
|
|
||||||
@@ -187,9 +192,10 @@ make dist-mac # (run on macOS) → podtui-darwin-<arch>.tar.gz
|
|||||||
make dist-linux # (run on Linux) → podtui-linux-<arch>.tar.gz
|
make dist-linux # (run on Linux) → podtui-linux-<arch>.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
`make dist` compiles against `bunfig.standalone.toml` (a preload-free Bun
|
`make dist` emits a config-independent binary: Bun does not bake bunfig
|
||||||
config) so the emitted binary doesn't bake in the dev-only `@opentui/solid`
|
settings into `--compile` output, and the solid JSX transform is registered in
|
||||||
preload. The solid JSX transform is registered in `build.ts` itself.
|
`build.ts` itself. The binary then embeds the `preload`-free runtime, so launch
|
||||||
|
it from any normal directory.
|
||||||
|
|
||||||
## Packaging model
|
## Packaging model
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
preload = ["@opentui/solid/preload"]
|
# NO top-level `preload` here — intentional. A compiled PodTUI binary's
|
||||||
|
# embedded Bun runtime reads the launching process's CWD bunfig.toml, and a
|
||||||
|
# top-level `preload` entry (e.g. "@opentui/solid/preload", which the
|
||||||
|
# standalone cannot resolve) makes the binary die at startup with
|
||||||
|
# "preload not found". Dev/test still get the solid transform via explicit
|
||||||
|
# `--preload` flags in package.json and the [test] section below.
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
preload = "@opentui/solid/preload"
|
preload = "@opentui/solid/preload"
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
"podtui": "./dist/index.js"
|
"podtui": "./dist/index.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "bun src/index.tsx",
|
"start": "bun --preload @opentui/solid/preload src/index.tsx",
|
||||||
"dev": "bun --watch src/index.tsx",
|
"dev": "bun --preload @opentui/solid/preload --watch src/index.tsx",
|
||||||
"build:native": "bash scripts/build-cavacore.sh",
|
"build:native": "bash scripts/build-cavacore.sh",
|
||||||
"build": "bun run build.ts",
|
"build": "bun run build.ts",
|
||||||
"dist": "bun dist/index.js",
|
"dist": "bun dist/index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user