Skip to content

fix(build): decouple doc generation from binary compilation#557

Open
HMAKT99 wants to merge 1 commit intogarrytan:mainfrom
HMAKT99:arun/fix-build-chain-independence
Open

fix(build): decouple doc generation from binary compilation#557
HMAKT99 wants to merge 1 commit intogarrytan:mainfrom
HMAKT99:arun/fix-build-chain-independence

Conversation

@HMAKT99
Copy link
Copy Markdown
Contributor

@HMAKT99 HMAKT99 commented Mar 27, 2026

Summary

  • split build into build:docs and build:binaries
  • use ; so binary compilation runs even if doc generation fails
  • browse binary is no longer blocked by template errors

Problem

After upgrading gstack, browse/dist/browse is missing. ./setup reports "gstack ready" but every browse command fails with ENOENT.

The build script chains everything with &&:

bun run gen:skill-docs && bun run gen:skill-docs --host codex && bun build --compile browse/src/cli.ts ...

If gen:skill-docs fails (missing Codex host config, template syntax error, stale resolver), the && chain stops. bun build --compile never runs. The trailing || true masks the exit code — ./setup doesn't detect the failure.

Reproduction

  1. Upgrade gstack (e.g. v0.11.15.0 → v0.11.18.2) with a stale Codex config
  2. Run ./setup
  3. gen:skill-docs --host codex fails, entire build chain aborts
  4. ./setup prints "gstack ready"
  5. $B goto https://example.comzsh: no such file or directory: browse/dist/browse

Fix

"build": "bun run build:docs; bun run build:binaries",
"build:docs": "bun run gen:skill-docs && bun run gen:skill-docs --host codex",
"build:binaries": "bun build --compile ... && git rev-parse HEAD > browse/dist/.version ..."

; runs build:binaries regardless of build:docs exit code. Doc generation errors still print to stderr but the browse binary that users need always gets compiled.

+3/-1 in package.json.

Fixes #482.

The build script chained gen:skill-docs && bun build --compile with
&&, so a template error in gen:skill-docs would prevent browse
binaries from being compiled. ./setup would report success but leave
browse/dist/browse missing — every browse command fails with ENOENT.

Split into build:docs and build:binaries. Use ; (not &&) in the top-
level build command so binary compilation runs even if doc generation
fails. Doc errors are still visible in output but no longer block
the browse binary that users need.

Fixes garrytan#482.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

setup: browse binary not compiled when gen:skill-docs fails

1 participant