# Releasing lucisv Everything here runs on a normal developer machine with cargo, node and `shasum`. Nothing in the main checklist needs an account anywhere: the supported way to install the VS Code extension is to sideload the `.vsix` that `tools/release.sh` produces. Marketplace publishing is optional and deferred — it lives in the appendix at the bottom. ## Cross-platform builds (`--cross`) `tools/release.sh --cross` adds, next to the host (Apple Silicon) binaries: `x86_64-apple-darwin` (Intel Mac), `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl` (any x86-64 / ARM64 Linux — statically linked, no glibc dependency) and `x86_64-pc-windows-gnu` (`.exe`, depends only on DLLs Windows 10+ ships) and `x86_64-unknown-linux-gnu` — the glibc-linked build for enterprise distributions: the messense toolchain's sysroot keeps the highest referenced symbol at `GLIBC_2.28`, which is RHEL 8's own glibc, so it runs on RHEL 8.x (verified for 8.10 by symbol audit: `x86_64-unknown-linux-gnu-objdump -T dist/lucisv-server-* | grep -o 'GLIBC_[0-9.]*' | sort -Vu | tail -1`; every NEEDED library is in a base install). The static musl build runs there too — the gnu build exists for shops that require a native glibc link. Every build — host and each cross target — produces **three binaries**: `lucisv` (the CLI), `lucisv-server` (the language server) and `lucisv-mcp` (the MCP server for coding agents, `docs/features/mcp-packaging/README.md`). `--cross` also turns each cross-built set into a **platform-specific `.vsix`** that carries those three binaries inside it, so installing the extension needs no separate binary install (`docs/features/editor-platform-vsix/README.md`). The platform-independent `.vsix` — the same JavaScript, no binaries, server looked up on `PATH` — is still built as the universal fallback, and one more package, `lucisv--all.vsix`, carries **all five sets at once**. | package | rust triple | |---|---| | `darwin-arm64` | `aarch64-apple-darwin` (host; built without `--cross` too) | | `darwin-x64` | `x86_64-apple-darwin` | | `linux-x64` | `x86_64-unknown-linux-musl` | | `linux-arm64` | `aarch64-unknown-linux-musl` | | `win32-x64` | `x86_64-pc-windows-gnu` | | `all` | all five of the above, under `bin/-/` | `x86_64-unknown-linux-gnu` deliberately gets no package: `linux-x64` ships the static musl build, which runs on any distro. Alpine's own `alpine-x64` / `alpine-arm64` targets are not built either, so VS Code on Alpine is never offered a targeted package — the `all` package covers it instead, since it carries no `--target` and Alpine's `process.platform` is plain `linux`. One-time setup on the build Mac (2026-08-25, all via Homebrew): ```bash brew install rustup mingw-w64 brew install messense/macos-cross-toolchains/x86_64-unknown-linux-gnu /opt/homebrew/opt/rustup/bin/rustup toolchain install stable --profile minimal /opt/homebrew/opt/rustup/bin/rustup target add --toolchain stable \ x86_64-apple-darwin x86_64-unknown-linux-musl x86_64-unknown-linux-gnu \ x86_64-pc-windows-gnu # added 2026-08-27, for the linux-arm64 extension package (rust-lld links it; # no C toolchain needed): /opt/homebrew/opt/rustup/bin/rustup target add --toolchain stable \ aarch64-unknown-linux-musl ``` Notes the script encodes so nobody rediscovers them: the Homebrew *rust* package stays the project's day-to-day toolchain (rustup is keg-only and never on PATH; the script addresses `~/.rustup/toolchains/.../bin` absolutely, with `RUSTC` pinned so cargo cannot fall back to the PATH rustc, which lacks the cross std libs). The musl build links with `rust-lld`, which needs `DYLD_FALLBACK_LIBRARY_PATH` pointed at the toolchain's `lib/` — its own rpath misses `libLLVM.dylib` in rustup's layout. The Windows build needs mingw-w64 for the import libraries (`libkernel32.a` and friends); rust's self-contained mode does not carry them. Only the host binaries can be smoke-tested here (the Intel-Mac set also runs under Rosetta and is); Linux and Windows artifacts are file-type- and DLL-audited, not executed. ## 1. Bump the version Four files, one number. Keep them identical. | File | What to change | |---|---| | `Cargo.toml` | `[workspace.package] version` — **all nine crates inherit it** via `version.workspace = true`, so this is the only Rust edit | | `Cargo.lock` | regenerated by any `cargo` command; run `cargo check --workspace` and commit the result | | `editors/vscode/package.json` | `"version"` | | `editors/vscode/package-lock.json` | `"version"` in **both** places (the top level and the `packages[""]` entry) | Nothing hard-codes a version string in Rust: `lucisv --version` and the language server's `initialize` → `serverInfo.version` both read `env!("CARGO_PKG_VERSION")`, so the workspace bump reaches them for free. Verify after bumping: ```bash cargo build --release target/release/lucisv --version # lucisv X.Y.Z ``` ## 2. Write the changelog Add a section to `CHANGELOG.md`, newest first. It is a **user-facing** changelog: one tight paragraph per area (formatter/safety net, CLI, linter, language server, editors, corpus results), each linking to the feature READMEs under `docs/features/` that hold the detail. Not a commit log, not a round log. ## 3. Gate Every gate must be green before anything is built for distribution: ```bash tools/gates.sh # logs in target/gates// ``` It runs each gate as a separate `tools/guard.sh` step with its own clock, memory limit and log: `cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets -- -D warnings`, the test build (`cargo test --workspace --all-targets --no-run`), `cargo test -p --all-targets` for each workspace member in turn, the doc-tests (`cargo test --workspace --doc`), the corpus gate (`scripts/corpus_gate.sh` over `~/.cache/lucisv-corpus`, as CI runs it; skipped with a note when the corpus is absent — fetch it once with `tools/corpus_fetch.sh ~/.cache/lucisv-corpus`) the extension's `node --test editors/vscode/*_test.js`, and `cross` — a `cargo check` of the three binaries for Windows and Linux with the rustup toolchain the release build uses (skipped with a note when it is absent; added after 0.65.6 passed every other gate and then failed to compile for Windows). It prints one line per step start and end, then a table (step, result, seconds, passed/failed, log); it exits non-zero if any step failed. A step the guard killed is retried once and reported as `KILLED → retried → pass|fail` — a kill that passes on retry is still worth a line in the release notes' working log, and one that does not is a release blocker like any failure. The first attempt's log is kept as `.killed.log`. `tools/gates.sh --only suites,docs` or `--skip corpus` runs a subset (`--list` names the steps, `--help` the options). Do not replace it with a bare `cargo test --workspace`: that one command hid which binary stalled (TODO §65.3, `docs/features/release-gates/README.md`). Quote the corpus step's numbers in the changelog when they changed; a verification error or a crash there is a release blocker by definition. ## 4. Build the artifacts ```bash tools/release.sh # or: tools/release.sh -o /some/other/dir ``` It builds `--release`, copies the three binaries into `dist/` under version-and-host names, smoke-tests the server binary with `editors/vscode/smoke.js` and the MCP server with `editors/vscode/mcp_smoke.js` (initialize, `tools/list` with exactly the nine tools in order, one `hierarchy` over a tiny temporary project; then again with `--read-only`: the five read tools in order, one `hierarchy`, `rename` answered with the unknown-tool error and the project's files untouched), packages the extension into `dist/lucisv-.vsix` and into the host's platform package, runs the smoke tests (the MCP one in both modes) again against the binaries *unzipped out of* that package (and, with `--cross`, out of the `all` package), and writes `dist/SHA256SUMS`. `dist/` is gitignored and is deleted and recreated on every run. ``` dist/ lucisv-0.56.0-aarch64-apple-darwin lucisv-server-0.56.0-aarch64-apple-darwin lucisv-mcp-0.56.0-aarch64-apple-darwin lucisv-0.56.0.vsix # universal: no binaries, servers from PATH lucisv-0.56.0-darwin-arm64.vsix # the same extension with the three inside SHA256SUMS ``` With `--cross` the loose binaries appear for all six triples, the remaining four platform packages (`darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64`) join them, and so does the all-platforms `lucisv--all.vsix` — eighteen binaries and **seven** `.vsix` files, plus `SHA256SUMS`. The `all` package needs all five sets to exist, so it is the one artifact a plain run cannot produce. | artifact | per triple | in a platform `.vsix` | in the `all` `.vsix` | |---|---|---|---| | `lucisv` | `lucisv--[.exe]` | `bin/lucisv[.exe]` | `bin/-/lucisv[.exe]` | | `lucisv-server` | `lucisv-server--[.exe]` | `bin/lucisv-server[.exe]` | `bin/-/lucisv-server[.exe]` | | `lucisv-mcp` | `lucisv-mcp--[.exe]` | `bin/lucisv-mcp[.exe]` | `bin/-/lucisv-mcp[.exe]` | `tools/audit_artifacts.sh` gives all three the same audit per triple and fails on any other name. Verify the checksums the way a downloader would: ```bash cd dist && shasum -a 256 -c SHA256SUMS ``` **The binaries are host-only.** `release.sh` does not cross-compile — it builds for `rustc -vV`'s own host triple and names the files after it. Producing Linux and Windows binaries means running the script on those machines (or under a container) and collecting the `dist/` directories; that is deliberate, because the alternative is a cross-compilation toolchain dependency for a project that has none. ### The `.vsix`, in detail The script runs, inside `editors/vscode/`: ```bash npm ci # 8 packages, exact lockfile npx @vscode/vsce package --out ../../dist/lucisv-.vsix # then, per platform, with the three binaries staged in editors/vscode/bin/: npx @vscode/vsce package --target darwin-arm64 \ --out ../../dist/lucisv--darwin-arm64.vsix ``` - **No `--skip-license`.** `vsce` requires a `LICENSE` file next to `package.json`; `editors/vscode/LICENSE` is a copy of the repo root's, and `vsce` renames it to `LICENSE.txt` inside the package. If the root license ever changes, copy it across again — there is no symlink, because symlinks do not survive every checkout. - **Known environment issue: `vsce` fails under some sandbox paths.** It shells out to `npm list --parseable` and globs the paths that command prints. If the working directory sits under a path segment the environment rewrites (an agent session scratchpad with a UUID in it, for example), `vsce` globs a directory that does not exist, collects zero files, and fails with `ERROR Extension entrypoint(s) missing ... extension/extension.js`. It is not a packaging regression — it reproduces with a two-file toy extension. The fix is to package from a plain path, which is why `release.sh` packages inside the repo and only writes its *output* to `-o`. - `.vscodeignore` keeps `smoke.js`, `mcp_smoke.js`, every `*_test.js`, `.vscode/**` and `.gitignore` out of the package. It must **not** exclude `bin/`, which is where the platform packages' binaries are staged — nor any module `extension.js` requires at runtime (`restart.js`, `mcp.js`, `extract.js`, `hierarchyView.js`, `hierarchyModel.js`, `hierarchySections.js`, `hierarchyCurrent.js`, `referencesView.js`, `referencesModel.js`, `commentKeywords.js`, `commentScan.js`): an extension that ships without one fails to activate. Check that after any change to it: `unzip -l dist/lucisv-.vsix | grep -E 'smoke|_test'` must print nothing, `unzip -l dist/lucisv-.vsix | grep -E 'restart.js|mcp.js|references(View|Model).js'` must print `extension/restart.js`, `extension/mcp.js`, `extension/referencesView.js` and `extension/referencesModel.js`, and `unzip -l dist/lucisv-.vsix | grep syntaxes` must print the grammar — without it, hover cards ship unhighlighted. - **`editors/vscode/bin/` is transient.** `release.sh` stages one platform's three binaries into it (or, for the `all` package, all five sets into `bin/-/` subdirectories), packages, and removes it again, with an `EXIT` trap so a failed run cannot leave binaries in the working tree; it is gitignored as a second line of defence. Every package is then asserted with `unzip -Z1 'extension/bin/*'`: nothing for the universal one, exactly `lucisv`, `lucisv-server` and `lucisv-mcp` (`.exe` for `win32-x64`) for a platform one, and exactly fifteen entries under five subdirectories for the `all` one — Info-ZIP's `*` matches `/`, so one pattern covers both layouts. A stale `bin/` would otherwise ship one platform's server to another's users. ## 5. Install / distribute ```bash # the CLI and the server: anywhere on PATH install -m 755 dist/lucisv-0.7.0-aarch64-apple-darwin ~/.local/bin/lucisv install -m 755 dist/lucisv-server-0.7.0-aarch64-apple-darwin ~/.local/bin/lucisv-server # the editor extension: sideload, no marketplace involved code --install-extension dist/lucisv-0.7.0-darwin-arm64.vsix # binaries inside code --install-extension dist/lucisv-0.7.0.vsix # or: server from PATH ``` The platform package is the one to hand a user: it carries `lucisv`, `lucisv-server` and `lucisv-mcp` for that machine, so the two `install -m 755` lines above become optional. Pick the package by machine — `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64`. When the machine is *not* known in advance — a mixed fleet, an offline mirror, Alpine — hand over `lucisv--all.vsix` instead: same binaries, all five platforms in the one file, several times the size of a platform package (a platform package measured 6.8 MB at 0.56.0 with the three binaries; `lucisv-mcp` is 1.9 MB of that). The universal `lucisv-.vsix` remains the no-binaries fallback. Publishing means attaching the seven `.vsix` packages plus `SHA256SUMS` to a git tag / release page on `git.luci.ooo` — the CI release does exactly that and nothing more (the loose binaries stay unpublished; see "CI releases" below). Tag after the gate is green: ```bash git tag -a v0.5.0 -m 'lucisv 0.5.0' git push origin v0.5.0 ``` ## Appendix — if the owner ever publishes to a marketplace **Optional and deferred.** Sideloading covers every use lucisv has today, and none of the steps below can be run by anyone but the repo owner: they need accounts, tokens and a decision about the published identity. Recorded here so the information is not lost, not as a checklist step. What would have to change first: - `editors/vscode/package.json`'s `publisher` is the literal string `guoliangchen` (author: Guoliang Chen). Marketplace publishing would still need the owner to register that id in the Visual Studio Marketplace and log in to it with `vsce login`. - An **icon** (128×128 PNG, `"icon"` in `package.json`) and optionally a `galleryBanner`. Deliberately not added: binary brand assets are the owner's to choose, and a marketplace listing without them looks unfinished anyway. - A marketplace-audience pass over `editors/vscode/README.md` — it becomes the extension's listing page verbatim. The commands themselves, once those exist: ```bash # VS Code Marketplace: needs an Azure DevOps PAT for the publisher npx @vscode/vsce publish -p "$VSCE_TOKEN" # ... or publish an already-built package npx @vscode/vsce publish --packagePath dist/lucisv-0.7.0.vsix -p "$VSCE_TOKEN" # Open VSX (VSCodium, Gitpod, Cursor): needs an Eclipse Foundation account npx ovsx publish dist/lucisv-0.7.0.vsix -p "$OVSX_TOKEN" ``` Both tokens are secrets. Neither belongs in this repo, in a shell history, or in any file `release.sh` reads. ## CI releases (Gitea Actions) Since 0.7.1 the whole checklist above is automated (`docs/features/ci-release/README.md`): steps 1–2 stay manual (bump the four version files, write the CHANGELOG section — it becomes the release notes verbatim), then ```bash git tag v git push origin v ``` does the rest on the `lustudio-arm64` runner: first `tools/gates.sh`, the whole of step 3 — a red gate stops the release before anything is built (since 0.65.1; 0.65.0 was published while its checks had not finished) — then `tools/release.sh --cross`, a tag-vs-`lucisv --version` consistency check, `tools/prune_release_assets.sh dist `, which keeps **only the seven `.vsix` packages** in `dist/` (each checked by name — a missing package fails the release — and `SHA256SUMS` filtered down to them and re-verified), `tools/release_notes.sh` (a missing CHANGELOG section fails the release), and `tools/publish_release.sh`, which creates the Gitea release and attaches what remains. The loose binaries are built and audited on the runner — the packages are made from them — but never published: a standalone binary is a `cargo build --release` away for whoever wants one. Ordinary pushes run fmt/clippy/test via `.gitea/workflows/ci.yml`. The runner is the Mac Studio (since 2026-11-19; `mac-arm64`, on the previous build Mac, was retired the same day): the one-time setup at the top of this file, then `brew install gitea-runner`, registered instance-wide as `lustudio-arm64` (labels `macos-arm64`/`self-hosted`, host mode), running via `brew services start gitea-runner`; config at `/opt/homebrew/etc/gitea-runner/config.yaml`, logs at `/opt/homebrew/var/log/gitea-runner.{log,err}`. Registration tokens are one-time and minted in Gitea's admin UI; nothing secret lives in this repo — the release workflow authenticates with the `GITHUB_TOKEN` Gitea Actions injects per job. Since 0.7.2 the release workflow also runs `tools/audit_artifacts.sh` before publishing — the automated form of the manual symbol/file-type audit above (musl static-ness, the GLIBC_2.28 ceiling, PE/Mach-O types) — and ordinary CI gates every push on the corpus score (`scripts/corpus_gate.sh` against `scripts/corpus-baseline`).