5 compiled binaries each bundle full Bun runtime (~500MB redundant) -- suggest --no-compile / --lite setup mode
- Dominant language
- TypeScript
- Stars
- 133k
- Forks
- 19.9k
- Avg merge
- 18h 46m
- Merged PRs (30d)
- 26
Description
## Problem
gstack ships 5 Bun-compiled standalone executables, each bundling the complete Bun runtime (~100MB):
| Binary | Path | Size |
|--------|------|------|
| rowse | rowse/dist/browse | ~109.5 MB |
| ind-browse | rowse/dist/find-browse | ~109.5 MB |
| pdf | make-pdf/dist/pdf | ~109.5 MB |
| design | design/dist/design | ~109.5 MB |
| gstack-global-discover | in/gstack-global-discover | ~109.5 MB |
**Total: ~547 MB of compiled binaries, of which ~500 MB is redundant Bun runtime.** This accounts for ~38% of gstack's 1.3 GB install size.
All 5 binaries have different SHA256 hashes (different app code), but each includes an identical ~100MB Bun runtime baked in via un build --compile. Verified by finding the "Bun" signature in the first 64KB of every binary.
## Evidence that source mode already works
package.json already has dev scripts that run from source:
`json
"dev": "bun run browse/src/cli.ts",
"dev:make-pdf": "bun run make-pdf/src/cli.ts",
"dev:design": "bun run design/src/cli.ts"
`
And setup (line 223-261) unconditionally compiles when the binary is missing — there is no flag to skip compilation.
## Suggestion
Add a --no-compile (or --lite) flag to ./setup:
- **./setup --no-compile**: Skip un build --compile. Use un run .ts for all binaries. Requires Bun on PATH (already required by setup line 6).
- **./setup --lite**: Only compile the most-used binary (browse), run the rest from source.
- **Default behavior unchanged**: Users who don't pass the flag get the current compiled experience.
This would reduce install size from ~1.3 GB to ~800 MB for users who opt in, with no functional difference if Bun is installed (which it already must be for ./setup to run).
## Related
- #779 (tracked binary bloats clone size + dirty working tree)
- #407 (un build --compile fails on virtiofs mounts)
- #599 #342 #458 (Windows compiled binary issues that would not exist in source mode)
Contributor guide
Assessment
This issue has not been assessed yet.