luban setup
Install all enabled toolchain components. Run this once per machine.
Synopsis
luban setup [--only <name>[,<name>...]] [--force] [--dry-run] [--refresh-buckets]
Default behavior
Reads <config>/luban/selection.json (or seeds it from manifests_seed/selection.json on first run), installs every component with enabled: true. Idempotent — re-running is fast unless you pass --force.
The default selection installs:
| Component | Source | Approx. size |
|---|---|---|
| llvm-mingw | mstorsjo/llvm-mingw release | ~180 MB |
| cmake | Kitware/CMake release | ~50 MB |
| ninja | ninja-build/ninja release | ~300 KB |
| mingit | git-for-windows/git release | ~40 MB |
| vcpkg | microsoft/vcpkg release + bootstrap-vcpkg.bat | ~10 MB + (vcpkg.exe ~7 MB after bootstrap) |
Total: ~280 MB on disk after extraction (sum of ~50 MB compressed downloads in <cache>/luban/downloads).
Flags
--only <name>[,<name>...]
Install only the named component(s). Comma-separated list. Overrides the enabled flag in selection.json — useful for installing components disabled by default (like vcpkg which has its own overlay).
luban setup --only vcpkg
luban setup --only cmake,ninja
--force
Reinstall the component even if already present at the same version. Re-downloads if cache is stale, re-extracts, rewrites shims. Good for recovering after a corrupted toolchain dir.
--dry-run
Show what would be installed without doing it. Walks the selection, verifies manifests can be fetched + parsed, prints the URL each component would download. No network downloads, no extracts, no registry writes.
--refresh-buckets (experimental)
Force re-fetch of Scoop bucket mirrors. Normally luban fetches manifests on demand and caches them; this flag invalidates the cache.
Per-component pipeline
For each enabled component, luban runs:
- Resolve manifest — overlay → bucket cache → bucket remote (raw.githubusercontent)
- Validate manifest — reject if
installer,pre_install,post_install,uninstaller,persist, orpsmodulefields are present (these would require running PowerShell) - Download the archive to
<cache>/luban/downloads/, with retries + sha256 verification - Extract to a staging dir under
<data>/toolchains/.tmp-<name>-<ver>/ - Apply
extract_dir— descend into the wrapper directory if the archive uses one - Promote staging →
<data>/toolchains/<name>-<ver>-<arch>/(atomic rename, copy fallback for cross-volume) - Special bootstrap for vcpkg: run
bootstrap-vcpkg.batonce after extract to fetch matchingvcpkg.exefrom microsoft/vcpkg-tool releases - Write shims —
.cmd,.ps1, extensionless sh, one set perbinalias, into<data>/bin/ - Update registry —
<state>/luban/installed.json
What it does NOT touch
HKCU\Environment(useluban env --userfor that, separately)HKLM(anything system-wide; never)- The
~/scoop/directory if you have Scoop installed (we read Scoop manifests, never write the Scoop layout) - Existing user PATH (until you
luban env --user)
Common workflows
Fresh machine
luban setup # ~3 min on a fast connection
luban env --user # one-time HKCU PATH registration
Add vcpkg later
If the default selection doesn't include vcpkg (depends on which seed you ship):
luban setup --only vcpkg
luban env --user # picks up VCPKG_ROOT for new shells
Reinstall a corrupted toolchain
luban setup --only ninja --force
Verify what's about to happen
luban setup --dry-run
Failure modes
- Network:
luban setupretries 3× with exponential backoff. Persistent failure → exits 1 with the error from the last attempt. - Hash mismatch: download is discarded, no install. Suggests upstream tampering or a corrupted CDN edge.
- Unsafe manifest: aborts with a clear message; user must provide an overlay manifest in
<data>/registry/overlay/<name>.json. - Extract failure: staging dir is wiped, the partial extract is gone, registry untouched. Safe to retry.
The pipeline is designed so a Ctrl-C or system crash never leaves a half-installed component visible to luban — either the install completed and installed.json records it, or it didn't.
See also
luban env— the rustup-style PATH registrationluban doctor— verify what was installed- Reference → Manifest overlay format — how to add components luban doesn't ship by default