zrebuild - Force Complete Rebuild with Validation¶
Performs a comprehensive three-phase rebuild: syntax validation of all source files, clean removal of all compiled bytecode, and fresh recompilation from scratch.
Overview¶
zrebuild is stricter than zr. It validates every .zsh file for syntax errors before touching any compiled output, removes all existing .zwc files to ensure a clean slate, and then runs zprime --quiet to recompile everything. If any syntax error is found, the process stops immediately without deleting or recompiling anything.
When to use: When zr produces unexpected results, after pulling large changesets, or when you suspect corrupted bytecode.
Usage¶
Options¶
-h,--help: Show help message
Examples¶
What It Does¶
- Phase 1 — Syntax validation: Runs
zsh -non every.zshfile in all framework directories plusbuild/andlib/rebuild/. Stops immediately if any file has syntax errors. - Phase 2 — Clean bytecode: Removes all
.zwcfiles and generated-all.zshconcatenations from.compiled/directories. Also removes stray.zwcfiles up to 2 levels deep. - Phase 3 — Recompilation: Loads
core/02_vars.zshandcore/06_engine.zshto bootstrapzprime, then runszprime --quietfor a fresh build.
Dependencies¶
- Required:
zsh(forzsh -nsyntax checking),zprime(compilation engine) - Required:
core/02_vars.zsh,core/06_engine.zsh
See Also¶
- zr — Standard incremental rebuild (faster, less thorough)
- zfresh — Clean rebuild with automatic shell restart
- zrecompile — Selective recompilation by scope