Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a93143bfb | ||
|
|
ec65e0831f | ||
|
|
a399f81ad9 | ||
|
|
20ad318d4e |
No files matched your search
@@ -1,9 +1,13 @@
|
||||
# Release: pushing a tag `vX.Y.Z` builds every distribution artifact and
|
||||
# publishes a Gitea release with the CHANGELOG section for that version as
|
||||
# its notes. The artifact set is exactly what tools/release.sh --cross
|
||||
# produces: host (Apple Silicon) + x86_64 macOS + static-musl Linux +
|
||||
# RHEL 8-compatible linux-gnu + Windows binaries for both lucisv and
|
||||
# lucisv-server, the platform-independent .vsix, and SHA256SUMS.
|
||||
# its notes. What the release page carries is the six .vsix packages —
|
||||
# the universal one plus darwin-arm64/darwin-x64/linux-x64/linux-arm64/
|
||||
# win32-x64 with the lucisv + lucisv-server binaries embedded — and
|
||||
# SHA256SUMS; each platform package is a must, and a missing one fails
|
||||
# the release. The loose binaries are still built for every target
|
||||
# (the packages are made from them) and still audited, but they are not
|
||||
# attached: anyone who wants a standalone binary builds it with
|
||||
# `cargo build --release` (docs/features/editor-platform-vsix).
|
||||
#
|
||||
# The release fails, deliberately, when the tag does not match the
|
||||
# workspace version or CHANGELOG.md has no section for it: every release
|
||||
@@ -30,6 +34,26 @@ jobs:
|
||||
echo "tag $GITHUB_REF_NAME does not match crate version $v" >&2
|
||||
exit 1
|
||||
}
|
||||
# The release page ships extension packages only. All six must exist
|
||||
# (release.sh would have failed earlier, but a missing package here is
|
||||
# exactly the failure this release exists to prevent, so it is checked
|
||||
# by name); the loose binaries were needed to build and audit them and
|
||||
# are dropped now. SHA256SUMS is filtered, not recomputed — the
|
||||
# published hashes are the audited ones — and re-verified after.
|
||||
- name: Keep only the extension packages
|
||||
run: |
|
||||
v=${GITHUB_REF_NAME#v}
|
||||
cd dist
|
||||
for t in "" -darwin-arm64 -darwin-x64 -linux-x64 -linux-arm64 -win32-x64; do
|
||||
[ -f "lucisv-$v$t.vsix" ] || {
|
||||
echo "missing lucisv-$v$t.vsix" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
grep '\.vsix$' SHA256SUMS > SHA256SUMS.tmp
|
||||
mv SHA256SUMS.tmp SHA256SUMS
|
||||
find . -type f ! -name '*.vsix' ! -name SHA256SUMS -delete
|
||||
shasum -a 256 -c SHA256SUMS
|
||||
- name: Extract the release notes from CHANGELOG.md
|
||||
run: tools/release_notes.sh "${GITHUB_REF_NAME#v}" > dist/RELEASE_NOTES.md
|
||||
- name: Create the release and attach the artifacts
|
||||
|
||||
@@ -4,6 +4,41 @@ All notable changes to lucisv are recorded here. Versions follow
|
||||
[semantic versioning](https://semver.org/); until 1.0 the CLI's exit codes
|
||||
(see `README.md`) are the only frozen contract.
|
||||
|
||||
## 0.10.1 — 2026-08-27
|
||||
|
||||
The install-in-one-step release: the VS Code extension now ships as
|
||||
**platform-specific packages with the binaries inside**, and the release
|
||||
page carries exactly those packages — nothing to build, nothing to put on
|
||||
`PATH`.
|
||||
|
||||
### Platform packages for the VS Code extension
|
||||
|
||||
Five new `.vsix` packages — `darwin-arm64`, `darwin-x64`, `linux-x64`,
|
||||
`linux-arm64`, `win32-x64` — each embedding that platform's `lucisv` and
|
||||
`lucisv-server` under `bin/` inside the extension. Install the one
|
||||
matching your machine with `code --install-extension` and the extension
|
||||
spawns its own server; both Linux packages are statically linked (musl),
|
||||
so they run on any distro, and `linux-arm64` is a **new build target**
|
||||
altogether. The extension resolves the server as: an explicitly set
|
||||
`lucisv.serverPath` first, then the bundled binary (made executable on
|
||||
activation — VSIX extraction drops the bit), then `PATH` — so pointing at
|
||||
your own `target/release` build still works, and clearing the setting
|
||||
falls back to the bundled server. The universal `lucisv-<version>.vsix`
|
||||
(no binaries, server from `PATH`) remains the fallback for platforms
|
||||
without a package. Details and the verification story:
|
||||
`docs/features/editor-platform-vsix/README.md`.
|
||||
|
||||
### The release page ships packages only
|
||||
|
||||
A tagged release now publishes the six `.vsix` files and `SHA256SUMS`,
|
||||
nothing else. Every platform package is checked by name before publishing
|
||||
— a missing one fails the release — and the per-platform binaries are
|
||||
still built and audited (static-linkage, glibc ceiling, file types) since
|
||||
the packages embed them, but no longer attached as loose assets: a
|
||||
standalone binary is a `cargo build --release` away. The host package's
|
||||
embedded server is smoke-tested through a full LSP session, straight out
|
||||
of the zip, on every release.
|
||||
|
||||
## 0.10.0 — 2026-08-27
|
||||
|
||||
The audit-complete release: TODO.md §9c, the last section of the LSP
|
||||
|
||||
Generated
+8
-8
@@ -97,7 +97,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lucisv"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"lucisv_core",
|
||||
"rayon",
|
||||
@@ -108,11 +108,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lucisv_core"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
|
||||
[[package]]
|
||||
name = "lucisv_server"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"lsp-server",
|
||||
"lsp-types",
|
||||
@@ -248,14 +248,14 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||
|
||||
[[package]]
|
||||
name = "vlog_formatter"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"vlog_parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vlog_linter"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"vlog_formatter",
|
||||
"vlog_parser",
|
||||
@@ -264,11 +264,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vlog_parser"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
|
||||
[[package]]
|
||||
name = "vlog_refactor"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"vlog_parser",
|
||||
"vlog_semantic",
|
||||
@@ -276,7 +276,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vlog_semantic"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"vlog_parser",
|
||||
]
|
||||
+1
-1
@@ -12,7 +12,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
authors = ["Guoliang Chen"]
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
@@ -610,30 +610,39 @@ go-to-definition, references and document/workspace symbols — the full list,
|
||||
and what is deliberately *not* advertised yet, is in
|
||||
`docs/features/lucisv-server/README.md`.
|
||||
|
||||
**The binary comes from the same build as the CLI.** Download it from the
|
||||
[releases page](https://git.luci.ooo/lucio/lucisv/releases) for your
|
||||
platform, or build it yourself:
|
||||
**VS Code needs no separate binary**: every release on the
|
||||
[releases page](https://git.luci.ooo/lucio/lucisv/releases) carries a
|
||||
platform-specific `.vsix` with both binaries inside it — pick yours
|
||||
(`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64`)
|
||||
and sideload it:
|
||||
|
||||
```bash
|
||||
code --install-extension lucisv-<version>-darwin-arm64.vsix
|
||||
```
|
||||
|
||||
Every other editor (and the universal `lucisv-<version>.vsix`, the fallback
|
||||
for platforms not listed) finds `lucisv-server` on `PATH`; the binary comes
|
||||
from the same build as the CLI:
|
||||
|
||||
```bash
|
||||
cargo build --release # target/release/lucisv-server (and target/release/lucisv)
|
||||
cp target/release/lucisv-server ~/.local/bin/ # anywhere on PATH
|
||||
```
|
||||
|
||||
Every editor below defaults to finding `lucisv-server` on `PATH`; each also
|
||||
accepts an absolute path if you would rather leave the binary in `target/`.
|
||||
Each editor also accepts an absolute path if you would rather leave the
|
||||
binary in `target/`.
|
||||
|
||||
**VS Code** — a thin extension in `editors/vscode/` whose entire job is
|
||||
registering the file types and starting the server:
|
||||
registering the file types and starting the server (bundled, from `PATH`, or
|
||||
from the `lucisv.serverPath` setting). To build the packages yourself:
|
||||
|
||||
```bash
|
||||
tools/release.sh # builds dist/lucisv-<version>.vsix
|
||||
code --install-extension dist/lucisv-<version>.vsix
|
||||
tools/release.sh # dist/lucisv-<version>.vsix + the host platform package
|
||||
code --install-extension dist/lucisv-<version>-darwin-arm64.vsix
|
||||
```
|
||||
|
||||
The `.vsix` is also attached to every release on the
|
||||
[releases page](https://git.luci.ooo/lucio/lucisv/releases). Sideloading it
|
||||
is the supported install; the extension is not on any marketplace. To package it by hand instead: `cd editors/vscode && npm ci &&
|
||||
npx @vscode/vsce package`.
|
||||
Sideloading is the supported install; the extension is not on any
|
||||
marketplace.
|
||||
|
||||
Settings are listed in `editors/vscode/README.md`, along with the full steps,
|
||||
the F5 development flow and troubleshooting.
|
||||
@@ -694,14 +703,18 @@ expected outputs with `UPDATE_SNAPSHOTS=1 cargo test -p vlog_formatter`.
|
||||
|
||||
Prebuilt downloads live on the
|
||||
[releases page](https://git.luci.ooo/lucio/lucisv/releases): every tagged
|
||||
version carries `lucisv` and `lucisv-server` for Apple Silicon and Intel
|
||||
macOS, static-musl and RHEL 8-compatible glibc Linux, and Windows, plus the
|
||||
`.vsix` and a `SHA256SUMS` to verify them with
|
||||
(`shasum -a 256 -c SHA256SUMS`). Copy the two binaries onto your `PATH` and
|
||||
sideload the extension with `code --install-extension`. The macOS binaries
|
||||
are smoke-tested on the build machine; the Linux and Windows ones are
|
||||
cross-built and audited (file type, dynamic-linkage, glibc-version ceiling),
|
||||
not executed — there is no Linux or Windows machine in the loop.
|
||||
version carries **six `.vsix` packages** — platform-specific ones for
|
||||
Apple Silicon and Intel macOS, x86-64 and ARM64 Linux (static musl) and
|
||||
Windows, each with `lucisv` and `lucisv-server` embedded, plus the
|
||||
universal no-binary fallback — and a `SHA256SUMS` to verify them with
|
||||
(`shasum -a 256 -c SHA256SUMS`). Sideload the one for your machine with
|
||||
`code --install-extension`. Standalone binaries are not published; build
|
||||
them with `cargo build --release` (or `tools/release.sh --cross` for the
|
||||
full set — the release binaries are cut from the same scripts). The macOS
|
||||
binaries inside the packages are smoke-tested on the build machine; the
|
||||
Linux and Windows ones are cross-built and audited (file type,
|
||||
dynamic-linkage, glibc-version ceiling), not executed — there is no Linux
|
||||
or Windows machine in the loop.
|
||||
|
||||
To build the same artifact set yourself:
|
||||
|
||||
|
||||
@@ -1391,7 +1391,13 @@ mod tests {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus");
|
||||
let target_dir = root.join("ibex/vendor/lowrisc_ip/ip/prim/rtl");
|
||||
let old = target_dir.join("prim_assert.sv");
|
||||
assert!(old.is_file(), "the corpus is checked in: {old:?}");
|
||||
// Skipped when `corpus/` is not checked out, like every other
|
||||
// corpus test in this crate — asserting its presence panicked any
|
||||
// environment (a bare CI checkout, `act`) that never fetched it.
|
||||
if !old.is_file() {
|
||||
eprintln!("corpus/ not checked out — skipping");
|
||||
return;
|
||||
}
|
||||
let new = target_dir.join("prim_assert_renamed.sv");
|
||||
|
||||
let mut ws = Workspace::default();
|
||||
|
||||
@@ -5,11 +5,18 @@
|
||||
Automate the checks and the release. Every push to master runs the three
|
||||
checks CLAUDE.md requires (fmt, clippy, test) on Gitea Actions; every tag
|
||||
`vX.Y.Z` builds the full cross-platform artifact set (Apple Silicon +
|
||||
x86_64 macOS, static-musl and RHEL 8-compatible Linux, Windows — both
|
||||
binaries each — plus the `.vsix` and `SHA256SUMS`) and publishes a Gitea
|
||||
release whose notes are the CHANGELOG section for that version. The point
|
||||
is that a release is one `git tag` + `git push` and cannot ship without
|
||||
green checks, matching versions, and written notes.
|
||||
x86_64 macOS, static-musl x86-64/ARM64 and RHEL 8-compatible Linux,
|
||||
Windows — both binaries each — plus the six `.vsix` packages and
|
||||
`SHA256SUMS`) and publishes a Gitea release whose notes are the CHANGELOG
|
||||
section for that version. **Published assets are the six `.vsix` packages
|
||||
only** (since 2026-08-27, owner decision): the extension is the product a
|
||||
release delivers, each platform package is checked by name before
|
||||
publishing, and the loose binaries — still built and audited, since the
|
||||
packages embed them — stay unpublished; a standalone binary is
|
||||
`cargo build --release` for whoever wants one
|
||||
(docs/features/editor-platform-vsix). The point is that a release is one
|
||||
`git tag` + `git push` and cannot ship without green checks, matching
|
||||
versions, written notes, and all six packages.
|
||||
|
||||
## Assumptions
|
||||
|
||||
@@ -38,8 +45,11 @@ green checks, matching versions, and written notes.
|
||||
## Handshakes
|
||||
|
||||
- Consumes `tools/release.sh --cross` unchanged: artifact names
|
||||
(`lucisv[-server]-<version>-<triple>[.exe]`, `lucisv-<version>.vsix`,
|
||||
`SHA256SUMS`) and the version-from-binary convention.
|
||||
(`lucisv[-server]-<version>-<triple>[.exe]`,
|
||||
`lucisv-<version>[-<vsce-target>].vsix`, `SHA256SUMS`) and the
|
||||
version-from-binary convention. The workflow's pruning step depends on
|
||||
those `.vsix` names exactly — it checks all six by name and filters
|
||||
`SHA256SUMS` down to `.vsix` lines before publishing.
|
||||
- Consumes `CHANGELOG.md`'s heading convention: `## <version> — <date>`;
|
||||
`tools/release_notes.sh` keys on the second word of `## ` headings.
|
||||
- `tools/publish_release.sh` expects the GitHub-compatible CI environment
|
||||
@@ -68,6 +78,13 @@ green checks, matching versions, and written notes.
|
||||
automates what RELEASING.md documented as manual; Linux/Windows binaries
|
||||
remain audited, never executed (no such machine in the loop, and no
|
||||
container runtime on the runner).
|
||||
- [x] Publish `.vsix` packages only (2026-08-27): after the audit, the
|
||||
workflow asserts all six packages exist by name, filters `SHA256SUMS`
|
||||
down to them (keeping the audited hashes), re-verifies it, and deletes
|
||||
the loose binaries from `dist/` so `publish_release.sh` attaches only
|
||||
the packages. Prune logic tested locally against a real `--cross`
|
||||
`dist/`, with a negative control (one package removed → the step fails
|
||||
naming it).
|
||||
- [ ] A second runner on a non-macOS host, if native-built (rather than
|
||||
cross-built) Linux artifacts are ever wanted.
|
||||
|
||||
@@ -92,6 +109,24 @@ green checks, matching versions, and written notes.
|
||||
rejected: no container runtime exists on the runner Mac, and installing
|
||||
a VM stack is an owner decision, not a CI increment.
|
||||
|
||||
- 2026-08-27 — lead. Owner decision: the release page ships the six
|
||||
`.vsix` packages only (each platform package a must, checked by name;
|
||||
the universal fallback included), no loose binaries — the platform
|
||||
packages embed them, and an experienced user builds standalone binaries
|
||||
with cargo. Implemented as a "Keep only the extension packages" step in
|
||||
`release.yml` between the artifact audit and the notes extraction: the
|
||||
audit still sees (and gates on) the loose binaries, then the step
|
||||
filters `SHA256SUMS` to `.vsix` lines — the published hashes are the
|
||||
audited ones, not recomputed — deletes everything else from `dist/`,
|
||||
and re-runs `shasum -c`. `publish_release.sh` is untouched: it attaches
|
||||
whatever `dist/` holds. Tested against the real 0.10.0 `--cross` dist
|
||||
(six packages verify, correct survivors) and negative-controlled (one
|
||||
package removed → fails naming `lucisv-0.10.0-linux-arm64.vsix`). Docs
|
||||
trued up: RELEASING.md (publishing + CI sections), top-level README
|
||||
(Editor setup and Install-and-releases sections now lead with the
|
||||
platform package and say binaries are build-your-own), and this README's
|
||||
Goal/Handshakes/Status.
|
||||
|
||||
## QA log
|
||||
|
||||
_(no QA round — infrastructure, verified by the live v0.7.1 run; see work log)_
|
||||
|
||||
@@ -0,0 +1,409 @@
|
||||
# editor-platform-vsix
|
||||
|
||||
## Goal
|
||||
|
||||
Installing the VS Code extension has always been half an install: the `.vsix`
|
||||
is platform-independent JavaScript and the *server it spawns* is a binary the
|
||||
user has to build or download and put on `PATH` first. This round closes that
|
||||
gap the way rust-analyzer and ruff close it — **platform-specific `.vsix`
|
||||
packages that carry the binaries inside them**. Five packages, one per
|
||||
platform we cross-build for; VS Code picks the one matching the machine by the
|
||||
`--target` stamped into the package, downloads only that one, and the
|
||||
extension spawns the server out of its own install directory. The old
|
||||
platform-independent package stays, unchanged in behaviour, as the universal
|
||||
fallback for a platform we do not build (and for anyone who prefers their own
|
||||
binary on `PATH`).
|
||||
|
||||
## Assumptions
|
||||
|
||||
- **`vsce`'s target names and rustc's triples are two different vocabularies**,
|
||||
and the mapping between them is a hand-written table. `vsce` validates
|
||||
`--target` against its own fixed list; nothing derives one name from the
|
||||
other.
|
||||
|
||||
| vsce target | rust triple | why that triple |
|
||||
|---|---|---|
|
||||
| `darwin-arm64` | `aarch64-apple-darwin` | the host build |
|
||||
| `darwin-x64` | `x86_64-apple-darwin` | Intel Macs (also runs under Rosetta) |
|
||||
| `linux-x64` | `x86_64-unknown-linux-musl` | static, so it runs on every distro |
|
||||
| `linux-arm64` | `aarch64-unknown-linux-musl` | same, for ARM servers/Pi/Asahi |
|
||||
| `win32-x64` | `x86_64-pc-windows-gnu` | `.exe`, DLLs Windows 10+ ships |
|
||||
|
||||
- **Linux gets the musl build, not the glibc one.** `x86_64-unknown-linux-gnu`
|
||||
is still built and shipped as a loose artifact (it exists for shops that
|
||||
require a native glibc link — see `tools/RELEASING.md`), but the *extension*
|
||||
embeds musl: a statically linked binary runs on any distro at any glibc
|
||||
vintage, which is exactly the property an extension installed by a stranger
|
||||
needs. There is no second `linux-x64` package to choose between.
|
||||
- **Alpine is an accepted gap.** `vsce` has separate `alpine-x64` /
|
||||
`alpine-arm64` targets and VS Code running on Alpine looks for *those*, not
|
||||
for `linux-x64` — so an Alpine user gets the universal package and needs
|
||||
`lucisv-server` on `PATH`, even though the musl binary we ship would have run
|
||||
there perfectly. Building two more packages with identical contents to satisfy
|
||||
a name is not worth the release-matrix growth today; if someone asks, it is a
|
||||
two-line change (`alpine-x64` ← the same musl triple).
|
||||
- **VSIX extraction does not preserve the executable bit.** This is why
|
||||
`extension.js` chmods what it is about to spawn rather than trusting the
|
||||
package's file modes — the same thing rust-analyzer's extension does, for the
|
||||
same reason. `release.sh` still `chmod +x`es the staged binaries before
|
||||
packaging, so the mode inside the zip is right; the client-side chmod is the
|
||||
belt to that suspenders.
|
||||
- **No version handshake.** The bundled server is the one built from the same
|
||||
tree as the extension, so extension and server always match by construction.
|
||||
A user who points `lucisv.serverPath` at something else takes that risk, as
|
||||
before.
|
||||
- **The binaries are the same ones `dist/` ships.** `release.sh` stages them
|
||||
*out of* `dist/`, so the file a user gets from the release page and the file
|
||||
inside the `.vsix` are byte-identical (and the `.vsix` copies are covered
|
||||
transitively by `SHA256SUMS`' entry for the package).
|
||||
|
||||
## Handshakes
|
||||
|
||||
**Consumed from `editor-packaging`** — the spawn contract, unchanged: binary
|
||||
name `lucisv-server`, no arguments, LSP on stdin/stdout. The only thing this
|
||||
feature changes is *which path* is spawned, never how.
|
||||
|
||||
**Consumed from `tools/release.sh`** — the `dist/lucisv[-server]-<version>-<triple>`
|
||||
naming. The staging step reads those exact names; renaming an artifact breaks
|
||||
packaging loudly (a missing `cp` source), not silently.
|
||||
|
||||
**Promised to `extension.js`** — a platform package always contains **both**
|
||||
binaries under `bin/`, named plainly (`lucisv`, `lucisv-server`, with `.exe` on
|
||||
Windows) with no version or triple in the name; the universal package contains
|
||||
**no** `bin/` directory at all. `release.sh` asserts both with `unzip -Z1`
|
||||
after every package it builds, so "the extension found a stale binary from the
|
||||
previous target" cannot ship.
|
||||
|
||||
**Promised to `tools/audit_artifacts.sh`** — every loose binary in `dist/` is
|
||||
still named `lucisv[-server]-<version>-<triple>`; the new `.vsix` names all end
|
||||
in `.vsix` and are skipped by the audit's existing case arm.
|
||||
|
||||
**Requested of other modules** — none.
|
||||
|
||||
## Resolution order in the extension
|
||||
|
||||
`extension.js` picks the server command from three candidates, most specific
|
||||
first:
|
||||
|
||||
1. **A `lucisv.serverPath` the user actually set.** Detected with
|
||||
`inspect('serverPath')`, not `get()`: `get()` cannot tell a user's setting
|
||||
from the manifest's own `"default": "lucisv-server"`, and that default would
|
||||
otherwise shadow the bundled binary for *everyone*. Any of
|
||||
`globalValue`, `workspaceValue`, `workspaceFolderValue` or their three
|
||||
language-scoped variants counts as "the user set it"; `defaultValue` and
|
||||
`defaultLanguageValue` do not, because those are contributed defaults, not
|
||||
user intent. Most specific wins, matching VS Code's own `get()` precedence.
|
||||
2. **The bundled binary**, `<extension>/bin/lucisv-server`(`.exe`), if the file
|
||||
exists. Its existence is the whole runtime test for "am I a platform package
|
||||
or the universal one" — no build-time flag, no manifest field.
|
||||
3. **The bare name `lucisv-server`**, looked up on `PATH`. What the universal
|
||||
package has always done, and what a `cargo build` + `PATH` install still
|
||||
does.
|
||||
|
||||
The CLI (`bin/lucisv`) is chmod'ed alongside the server even though nothing in
|
||||
the extension spawns it: it is shipped so a user who installed the extension
|
||||
already has the command-line tool, and a non-executable file would make that
|
||||
claim false.
|
||||
|
||||
## What gets built, and when
|
||||
|
||||
| | `release.sh` | `release.sh --cross` |
|
||||
|---|---|---|
|
||||
| universal `lucisv-<v>.vsix` | yes | yes |
|
||||
| `darwin-arm64` (host) | yes | yes |
|
||||
| the other four | no | yes |
|
||||
|
||||
Without `--cross` there are no cross binaries to embed, so only the host
|
||||
package can be built — building it anyway (rather than only the universal one)
|
||||
keeps the packaging path exercised on every ordinary release run, including the
|
||||
embedded-server smoke test. The CI release workflow runs `--cross`, so releases
|
||||
always carry all six.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `rustup target add --toolchain stable aarch64-unknown-linux-musl` on the
|
||||
build Mac, and the line recorded in `tools/RELEASING.md`'s one-time setup.
|
||||
- [x] `tools/release.sh`: `aarch64-unknown-linux-musl` in the `--cross` set,
|
||||
same rust-lld linker and `DYLD_FALLBACK_LIBRARY_PATH` as the x86-64 musl
|
||||
build; its two binaries land in `dist/` and in `SHA256SUMS`.
|
||||
- [x] `editors/vscode/extension.js`: three-step server resolution, `inspect()`
|
||||
for user intent, chmod of both bundled binaries.
|
||||
- [x] `editors/vscode/package.json`: `lucisv.serverPath` description mentions
|
||||
the bundled default.
|
||||
- [x] `tools/release.sh`: stage `bin/`, package per target, remove `bin/`,
|
||||
with an `EXIT` trap so a failure cannot leave binaries in the tree.
|
||||
- [x] `tools/release.sh`: `unzip -Z1` content assertions for every package, and
|
||||
an LSP smoke test of the server unzipped out of the host package.
|
||||
- [x] `tools/audit_artifacts.sh`: `aarch64-unknown-linux-musl` arm.
|
||||
- [x] `editors/vscode/.gitignore`: `bin/`.
|
||||
- [x] Docs: this file, `tools/RELEASING.md`, `editors/vscode/README.md`.
|
||||
- [ ] **Not done, and not doable here:** none of the five packages has been
|
||||
*installed into a real VS Code*. `require('vscode')` resolves only in the
|
||||
extension host, so the resolution order above is proven by reading it and
|
||||
by the packaging assertions, not by an editor picking the right package
|
||||
off a marketplace. The Linux and Windows packages have additionally never
|
||||
been *executed* anywhere — same standing limitation the loose binaries
|
||||
have had since `--cross` existed.
|
||||
- [ ] **Not done, deliberate:** `alpine-x64` / `alpine-arm64` packages (see
|
||||
Assumptions), and a `linux-x64` glibc variant.
|
||||
|
||||
## Work log
|
||||
|
||||
### 2026-08-27 — dev agent
|
||||
|
||||
- **Toolchain.** `rustup target add --toolchain stable
|
||||
aarch64-unknown-linux-musl` ran clean (`rust-std` component only, no linker
|
||||
needed — `rust-lld` links it, exactly like the x86-64 musl target).
|
||||
`rustup target list --installed` now shows six targets. The line is in
|
||||
`tools/RELEASING.md`'s one-time-setup block.
|
||||
- **`release.sh` structure.** The new `aarch64-unknown-linux-musl` build sits
|
||||
next to the x86-64 musl one with the identical env pair
|
||||
(`DYLD_FALLBACK_LIBRARY_PATH="$tc/lib"` +
|
||||
`CARGO_TARGET_..._LINKER=rust-lld`); the copy loop just gained the triple.
|
||||
Packaging became three pieces: `vsce_target_for` (the triple→vsce-target
|
||||
table), `package_vsix` (stage `bin/`, package, remove `bin/`), and
|
||||
`expect_vsix_bins` (assert what a package carries). `bin_dir` is removed by an
|
||||
`EXIT` trap set before the first build, so an interrupted or failed run cannot
|
||||
leave a stale binary where the next package — or a developer's `git status` —
|
||||
would pick it up.
|
||||
- **The universal package is packaged first and with `bin/` provably absent**
|
||||
(`rm -rf` immediately before, `expect_vsix_bins` with no expected entries
|
||||
immediately after). That ordering matters: the universal package is the one
|
||||
that must never accidentally carry a platform's binaries.
|
||||
- **The embedded smoke test is a real round trip.** The host package is
|
||||
unzipped into `target/vsix-check/` (gitignored, outside the session
|
||||
scratchpad), both binaries are asserted present, the server is chmod'ed and
|
||||
driven through the same `smoke.js` LSP session the loose binary gets, and the
|
||||
directory is removed. So the claim "installing the extension gives you a
|
||||
working server" is tested against a file that has actually been through the
|
||||
zip.
|
||||
- **`inspect()` and not `get()`** is the one non-obvious line in
|
||||
`extension.js`, and the reason is in the file: `get()` returns
|
||||
`"lucisv-server"` for a user who has never touched the setting, because that
|
||||
is the manifest default — so a `get()`-based check would make the bundled
|
||||
binary unreachable for every user who did not explicitly override it. The
|
||||
scope list is most-specific-first and excludes `defaultValue` /
|
||||
`defaultLanguageValue`.
|
||||
- **The objdump question was answered by running it, not guessed.** This
|
||||
machine's `x86_64-unknown-linux-gnu-objdump` *does* parse an aarch64 ELF —
|
||||
`-p` prints `file format elf64-little` and the full program header table, and
|
||||
finds zero `NEEDED` entries in our static binary — so the new arm keeps the
|
||||
same `NEEDED` check the x86-64 musl arm uses. It also asserts `file -b`'s own
|
||||
`ARM aarch64` and `statically linked`, for two reasons the comment states:
|
||||
objdump's `elf64-little` does not name the architecture at all (so `file` is
|
||||
the only thing checking we did not ship an x86-64 binary under an aarch64
|
||||
name), and a future binutils that stopped parsing aarch64 would make the
|
||||
`NEEDED` grep pass *by finding nothing* — the exact quiet failure the audit
|
||||
exists to prevent.
|
||||
- **`x86_64-unknown-linux-gnu` gets no `.vsix`.** It is still built and still
|
||||
audited; `linux-x64` is the musl build because a static binary is the right
|
||||
thing to hand a stranger. Recorded in Assumptions so nobody re-litigates it
|
||||
silently.
|
||||
- **The no-`--cross` path was run too**, into a throwaway `-o` directory, to
|
||||
confirm the decision in "What gets built": host pair, universal package,
|
||||
`darwin-arm64` package, embedded smoke test, checksums, exit 0.
|
||||
- **`.vscodeignore` was left alone** and confirmed not to exclude `bin/` (it
|
||||
lists `smoke.js`, `.vscode/**`, `.gitignore` and nothing else). `bin/` is in
|
||||
`editors/vscode/.gitignore` instead, as a second line of defence behind the
|
||||
`EXIT` trap.
|
||||
- Did not bump any version, did not `git commit`/`git push`, did not touch
|
||||
`crates/`. `TODO.md` was read; the two items that touch editor packaging
|
||||
(§6 "Editor packaging", §6 "Release prep") are already `[x]` and neither
|
||||
mentions platform-specific packages, so nothing was checked off.
|
||||
|
||||
**Validation run on this machine (from the real repo path, never the
|
||||
scratchpad — `vsce` collects zero files under the scratchpad's UUID segment,
|
||||
`docs/features/editor-packaging` QA Finding 2):**
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `bash -n tools/release.sh tools/audit_artifacts.sh` | clean |
|
||||
| `node --check editors/vscode/extension.js` | clean |
|
||||
| `python3 -c json.load` on `editors/vscode/package.json` | valid |
|
||||
| `cargo fmt --check` | clean |
|
||||
| `cargo clippy --all-targets` | clean, no new warnings |
|
||||
| `cargo test -p lucisv_server` | **1015 unit + 50 e2e + 3 grammar green**, 5 ignored, 0 failed |
|
||||
| `tools/release.sh --cross` | exit 0 — 18 artifacts + `SHA256SUMS` (table below) |
|
||||
| `tools/release.sh -o target/relcheck-dist` (no `--cross`) | exit 0 — host pair, universal `.vsix`, `darwin-arm64` `.vsix`, `SHA256SUMS` |
|
||||
| `tools/audit_artifacts.sh dist` | **12 binaries audited, exit 0** |
|
||||
| embedded-server smoke (host `.vsix`, unzipped to `target/vsix-check/`) | `smoke: OK`, 10 messages |
|
||||
| `shasum -a 256 -c SHA256SUMS` in `dist/` | 18/18 OK |
|
||||
|
||||
**Artifacts from `tools/release.sh --cross` (lucisv 0.10.0):**
|
||||
|
||||
| `.vsix` | size | `extension/bin/` |
|
||||
|---|---|---|
|
||||
| `lucisv-0.10.0.vsix` (universal) | 487,837 | *(nothing — `unzip -Z1` reports "filename not matched")* |
|
||||
| `lucisv-0.10.0-darwin-arm64.vsix` | 2,721,294 | `lucisv-server`, `lucisv` |
|
||||
| `lucisv-0.10.0-darwin-x64.vsix` | 2,991,683 | `lucisv-server`, `lucisv` |
|
||||
| `lucisv-0.10.0-linux-x64.vsix` | 3,121,350 | `lucisv-server`, `lucisv` |
|
||||
| `lucisv-0.10.0-linux-arm64.vsix` | 2,970,545 | `lucisv-server`, `lucisv` |
|
||||
| `lucisv-0.10.0-win32-x64.vsix` | 2,906,955 | `lucisv-server.exe`, `lucisv.exe` |
|
||||
|
||||
Plus the twelve loose binaries, now including
|
||||
`lucisv-0.10.0-aarch64-unknown-linux-musl` (1,930,768) and
|
||||
`lucisv-server-0.10.0-aarch64-unknown-linux-musl` (4,022,088). `file -b` on the
|
||||
latter: `ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically
|
||||
linked, not stripped`.
|
||||
|
||||
Three things were checked beyond "it built":
|
||||
|
||||
- **The `--target` really is stamped in.** `extension.vsixmanifest` carries
|
||||
`TargetPlatform="darwin-arm64"` / `"linux-arm64"` / `"win32-x64"` in the
|
||||
respective packages, and the universal one contains no `TargetPlatform`
|
||||
attribute at all — that attribute is how VS Code picks a package.
|
||||
- **The executable bit survives packaging.** `unzip -Z` reports `-rwxr-xr-x`
|
||||
for both entries inside the packages. The client-side chmod stays anyway,
|
||||
because it is *VS Code's extraction*, not the zip, that drops the bit.
|
||||
- **The `EXIT` trap was negative-controlled**, not assumed: with an `npx` stub
|
||||
on `PATH` that fails whenever it sees `--target`, `release.sh` staged
|
||||
`editors/vscode/bin/`, failed the platform package, and exited — and
|
||||
`editors/vscode/bin/` was gone afterwards, with `git status --short
|
||||
editors/vscode` showing only the intended edits. A packaging failure cannot
|
||||
leave a binary in the tree.
|
||||
|
||||
**Not run, and why:** no package was installed into VS Code (the extension host
|
||||
is the only place `require('vscode')` resolves — unchanged limitation since
|
||||
2026-08-19), so the resolution order in `extension.js` is proven by reading and
|
||||
by the packaging assertions, not by an editor. The Linux and Windows binaries
|
||||
were not executed anywhere (no such machine in the release loop; `file`- and
|
||||
`objdump`-audited instead), which means the four non-host packages have never
|
||||
had their embedded server spawned. The marketplace's own `--target` selection
|
||||
was likewise not exercised: nothing here is published, so the check that
|
||||
`TargetPlatform` is present is as far as it goes.
|
||||
|
||||
### 2026-08-27 — lead (post-QA): chmod both bundled binaries unconditionally
|
||||
|
||||
QA's Finding 1: with a user-set `lucisv.serverPath`, the `||` chain in
|
||||
`activate` short-circuited past `bundledBinary(context, 'lucisv-server')`, so
|
||||
only the CLI got chmod'ed and `editors/vscode/README.md`'s "makes both
|
||||
executable" was one clause too strong. Fixed at the code, not the wording:
|
||||
the bundled server is now resolved into a `bundledServer` local before the
|
||||
`||` chain, so both binaries are made executable on every activation and the
|
||||
README sentence is exactly true. Two lines plus a comment; `node --check`
|
||||
clean. Lead-authored directly — the dev/QA loop would add latency, not safety
|
||||
(precedent: the 0.4.2 entry in docs/features/editor-packaging).
|
||||
|
||||
### 2026-08-27 — lead (follow-up): the release publishes the packages only
|
||||
|
||||
Owner decision, implemented in the ci-release feature (see
|
||||
docs/features/ci-release/README.md, 2026-08-27 work log entry): the release
|
||||
page now carries the six `.vsix` packages and `SHA256SUMS` only. The loose
|
||||
per-triple binaries are still built and audited — the packages are made from
|
||||
them — but no longer attached; standalone binaries are build-your-own.
|
||||
Nothing in this feature's scripts changed: `release.sh` still produces the
|
||||
full `dist/`, and the pruning lives in `release.yml` after the audit.
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-08-27 — QA agent
|
||||
|
||||
Scope: everything the dev's work log claims — gates, `--cross` and non-`--cross`
|
||||
`release.sh` runs, `.vsix` contents, `TargetPlatform`, `SHA256SUMS`,
|
||||
`audit_artifacts.sh`'s new aarch64 arm, `extension.js`'s resolution order and
|
||||
`inspect()` usage, the `EXIT` trap, and the docs. Ran everything from the real
|
||||
repo path (`/Users/guoliangchen/repo/verilogrustformatter`), never the session
|
||||
scratchpad (`docs/features/editor-packaging` QA Finding 2). All work in this
|
||||
entry; no source file was edited.
|
||||
|
||||
**Gates — all green, matching the dev's numbers exactly.**
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `bash -n tools/release.sh tools/audit_artifacts.sh` | clean |
|
||||
| `node --check editors/vscode/extension.js` | clean |
|
||||
| `python3 -c json.load` on `package.json` | valid |
|
||||
| `cargo fmt --check` | clean |
|
||||
| `cargo clippy --all-targets` (workspace) | clean, 0 warnings |
|
||||
| `cargo test -p lucisv_server` | **1015 unit + 50 e2e + 3 grammar**, 5 ignored, 0 failed — exact match |
|
||||
| `cargo test --workspace` | all green (also run, not just the dev's subset) |
|
||||
|
||||
**`tools/release.sh --cross`, re-run independently — exit 0, 18 artifacts, matching the claimed set exactly.**
|
||||
|
||||
- `dist/` after the run: 12 loose binaries (six triples × 2), 6 `.vsix`, `SHA256SUMS` — file names and sizes match the dev's table (`lucisv-server-0.10.0-aarch64-unknown-linux-musl` 4,022,088 bytes, `lucisv-0.10.0-aarch64-unknown-linux-musl` 1,930,768 — identical to the dev's numbers).
|
||||
- `shasum -a 256 -c SHA256SUMS` in `dist/`: **18/18 OK**.
|
||||
- `unzip -Z1`/`unzip -Z` on all six `.vsix`, independently: the universal package (`lucisv-0.10.0.vsix`, 324 entries) carries no `extension/bin/*` entries and no `TargetPlatform` attribute in `extension.vsixmanifest`. Each of the five platform packages (326 entries — exactly 2 more than universal) carries exactly `extension/bin/lucisv{,-server}` (`.exe` suffix on `win32-x64`), mode `-rwxr-xr-x` inside the zip, and the correct `TargetPlatform="…"` (`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64` respectively — checked all five, not just one).
|
||||
- Grepped every `.vsix`'s file list for `smoke`, `.gitignore`, `.vscodeignore`, `test`, `.git/`: nothing found in any of them — no dev-only clutter shipped.
|
||||
- `tools/audit_artifacts.sh dist`: **12 binaries audited, exit 0** — matches exactly (the six `.vsix` are correctly skipped by the pre-existing `*.vsix` case arm, not part of this round's diff).
|
||||
- Embedded smoke test ran as part of the build: `smoke: OK` against the server unzipped out of the `darwin-arm64` package, 10 messages — matches.
|
||||
|
||||
**`tools/release.sh` without `--cross`, re-run into a throwaway `-o` dir:** exactly host pair + `lucisv-0.10.0.vsix` (universal) + `lucisv-0.10.0-darwin-arm64.vsix`, 4 files total, `editors/vscode/bin/` absent afterward. Matches the "What gets built" table exactly.
|
||||
|
||||
**Breaking it, independently (not reusing the dev's own runs):**
|
||||
|
||||
1. **Ran `release.sh` twice in a row** (non-`--cross`, into two different `-o` dirs). Both exit 0, `editors/vscode/bin/` absent after each run, identical artifact name sets both times, `git status --short editors/vscode` showed only this round's four intended edits both times — no residue from run 1 leaking into run 2.
|
||||
2. **Pre-existing junk in `editors/vscode/bin/` before a run.** Created `editors/vscode/bin/lucisv-server` and `editors/vscode/bin/some-other-file` with garbage content by hand, then ran `release.sh -o /tmp/relcheck3 --no-vsix`. The script's `rm -rf "$bin_dir"` at line 53 (before the first build, unconditional on `--no-vsix`) wiped it; `bin/` was absent afterward and the run succeeded normally. A stale `bin/` from an interrupted prior run cannot contaminate the next one.
|
||||
3. **Independently re-ran the `EXIT`-trap negative control**, with my own fake `npx` (not the dev's), rather than trusting the dev's own report: a wrapper script on `PATH` that proxies to the real `npx` for everything except an invocation containing `--target`, which it fails with exit 17. Ran `release.sh -o /tmp/relcheck_fail`: the universal package built and was asserted clean (`bin/ contents ok`), then the `darwin-arm64` package's `vsce package --target darwin-arm64` hit the fake npx and failed; the script exited 17. `editors/vscode/bin/` was absent afterward and `git status --short editors/vscode` showed only the four intended edits — the trap covers a real mid-packaging failure, checked with a genuinely different negative control than the dev used, not a re-run of theirs.
|
||||
|
||||
**Audit script — the aarch64-musl arm checked adversarially.**
|
||||
|
||||
- **Unknown artifact name still fails**, confirmed on a copy: `lucisv-0.10.0-unknown-triple-xyz` (a renamed copy of the real `aarch64-apple-darwin` binary) produces `FAIL: … unrecognized artifact name — teach this script about it`, exit 1.
|
||||
- **Corrupted the aarch64-musl arm**, on a copy, never on `dist/` originals: overwrote a copy of `lucisv-server-0.10.0-aarch64-unknown-linux-musl` with `/bin/ls` (a Mach-O binary) under the same aarch64-musl-suffixed name. Audit failed it twice over — `not an aarch64 ELF: Mach-O universal binary …` and `musl build is not statically linked: …` — before even reaching the `objdump` `NEEDED` check, and exited 1 overall. This proves the arm's `file`-based architecture/static checks fire on a corrupted artifact, but it is a weaker test than I wanted: **I did not manage to isolate the `objdump -p … | grep NEEDED` line specifically** (no genuine dynamically-linked aarch64 Linux ELF was available on this Mac to substitute in — the closest available wrong-arch swap fails at the earlier `file`-based checks first, so the `NEEDED` grep is never reached in this control). The two checks are independent by construction (read separately in the source, matching the "two independent opinions" comment at `tools/audit_artifacts.sh:56`), so I read the `NEEDED` branch by inspection rather than exercising it in isolation — noting this as an honest gap in my own coverage, not a defect found.
|
||||
|
||||
**`extension.js` resolution logic, read line by line against the claims.**
|
||||
|
||||
- **`inspect()` scope order verified correct against VS Code's own documented precedence** (`SERVER_PATH_SCOPES`, `extension.js:58-65`) — not assumed from memory. VS Code's own `vscode.d.ts` doc comment for `WorkspaceConfiguration.inspect()` states the effective-value merge order, lowest to highest, as: `defaultValue`, `globalValue`, `workspaceValue`, `workspaceFolderValue`, `defaultLanguageValue`, `globalLanguageValue`, `workspaceLanguageValue`, `workspaceFolderLanguageValue`. That means *every* language-specific value outranks *every* non-language-specific one — a genuinely counter-intuitive rule (a `[verilog]`-scoped **User** setting beats a plain **workspace folder** setting) that I checked rather than trusted. Reversed and excluding the two `default*` entries (correctly excluded — see the file's own comment), the highest-to-lowest order is exactly `workspaceFolderLanguageValue, workspaceLanguageValue, globalLanguageValue, workspaceFolderValue, workspaceValue, globalValue` — which is the code's list, verbatim, in that order. The claim is correct.
|
||||
- **The bundled-CLI call is unconditional; the bundled-server call is short-circuited — worth documenting, not a bug (Finding 1 below).**
|
||||
- **`chmodSync` is in a `try { } catch { }` with no binding** (`extension.js:104-109`) — cannot throw uncaught; a read-only install or permission error is swallowed exactly as the comment says.
|
||||
- **`deactivate()`** (`extension.js:211-214`) is untouched by this round's diff (confirmed via `git diff HEAD~1`) and still calls `clearTimeout` + `client.stop()`.
|
||||
- **Windows `.exe` suffix** is handled consistently in both `bundledBinary()` (`extension.js:100`, via `process.platform === 'win32'`) and `release.sh`'s `package_vsix`/loose-binary loops (`case $triple in *windows*) exe=.exe ;;`) — same convention, both places.
|
||||
- **Activation with `bin/` absent (the universal package) does not throw**: `bundledBinary` returns `undefined` via `fs.existsSync` before any chmod attempt, and the `||` chain falls through to `'lucisv-server'` on `PATH`, exactly as before this round. `git diff HEAD~1 -- editors/vscode/extension.js` confirms the entire diff is additive (two new `require`s, two new functions, and the `activate()` server-path line) — the pre-existing behavior for the universal package's happy path is untouched code, not just untouched behavior.
|
||||
|
||||
**Finding 1 (confirmed, cosmetic, not blocking) — `editors/vscode/README.md:29`'s "makes both executable on first activation" is not quite true when a user has set `lucisv.serverPath`.**
|
||||
`extension.js:120` calls `bundledBinary(context, 'lucisv')` unconditionally, so the CLI is always chmod'ed if present. But `extension.js:124` is
|
||||
```js
|
||||
const serverPath = userServerPath() || bundledBinary(context, 'lucisv-server') || 'lucisv-server';
|
||||
```
|
||||
— plain JavaScript `||` short-circuits, so if `userServerPath()` returns a truthy value (the user set `lucisv.serverPath` in any of the six scopes `SERVER_PATH_SCOPES` checks), `bundledBinary(context, 'lucisv-server')` is **never called**, and the bundled `bin/lucisv-server` is never chmod'ed on that activation. This is not a functional bug — the binary in question is not the one being spawned in that scenario, so its mode is irrelevant — but `editors/vscode/README.md:29`'s "the extension spawns the server from there and makes both executable on first activation" states an unconditional "both" that has this one exception. The feature README's own Handshakes section is more careful — "chmods what it is about to spawn" (line 46) — which is the actually-accurate description and does not have this gap. Recommend loosening `README.md:29`'s wording to match the feature README's, or noting the exception; not fixed here since it is a one-clause doc-precision issue, not a typo, and the instructions ask QA to file rather than redesign.
|
||||
|
||||
**Pre-existing, out of scope for this round, flagged for the lead anyway — `tools/RELEASING.md:229-231` has a garbled sentence in the Appendix**, predating this round (confirmed via `git diff HEAD~1 -- tools/RELEASING.md`; the Appendix section is untouched by this diff): "that id registered with vsce by the owner\n has created in the Visual Studio Marketplace." reads as a broken edit — a clause was apparently left mid-rewrite. Not this feature's doc to fix (it's about marketplace publishing, unrelated to platform packaging), and not introduced by this round, but noted since I read the whole file.
|
||||
|
||||
**Docs cross-checked against reality, no other issues found:**
|
||||
|
||||
- `tools/RELEASING.md`'s `.vsix`-in-detail section (staging, `--target` invocation shape, `bin/` transience, the `unzip -Z1` assertion contract) matches `release.sh`'s actual code line for line.
|
||||
- `editors/vscode/README.md`'s section 0 install instructions, the `lucisv.serverPath` settings-table row, and the Troubleshooting section's "clear the setting, don't set it back to the default string" advice all match `extension.js`'s actual behavior (the last one specifically depends on the `inspect()`-not-`get()` distinction verified above — a user who explicitly sets `lucisv.serverPath` to the literal string `"lucisv-server"` does still count as "set", by design, since `inspect()` sees it in a scope, not as the manifest default).
|
||||
- The feature README's own Handshakes ("Promised to `extension.js`", "Promised to `tools/audit_artifacts.sh`") match what the code actually does, verified independently above rather than taken on the doc's word.
|
||||
- `TODO.md` was not re-checked in depth; the dev's claim that no existing checkbox needed updating was not disputed by anything found here.
|
||||
|
||||
**No BLOCKING findings.** Every claim in the dev's work log was independently reproduced with fresh runs and, where possible, fresh negative controls rather than re-trusting the dev's own — gates, both `release.sh` modes, all six `.vsix` contents (all five `TargetPlatform`s, not a sample), `SHA256SUMS`, the `EXIT` trap (with an independently-written stub), the audit script's new arm, and the `inspect()` precedence claim (checked against VS Code's own documented merge order, not memory). Finding 1 is cosmetic and already partially self-corrected by the feature README's own more careful wording elsewhere. The un-exercised `NEEDED`-check branch (audit script) is a coverage gap in this QA pass, not a defect — recorded honestly rather than papered over.
|
||||
|
||||
**Verdict: ship.**
|
||||
|
||||
## Review
|
||||
|
||||
**2026-08-27 — lead. Verdict: accepted; commits with this round.**
|
||||
|
||||
Reviewed the full diff (7 files + this README), the dev's work log against the
|
||||
scripts' actual code, and QA's independent reproduction. Points reviewed and
|
||||
accepted:
|
||||
|
||||
1. **The staging design is the right shape**: `editors/vscode/bin/` exists only
|
||||
between `mkdir` and the post-package `rm -rf`, with an `EXIT` trap both
|
||||
agents negative-controlled independently, and every package's `bin/`
|
||||
contents asserted with `unzip -Z1` rather than assumed. The failure this
|
||||
guards against — one platform's server shipping inside another platform's
|
||||
package, or inside the universal one — is a corruption-adjacent class of
|
||||
bug, and it cannot happen silently.
|
||||
2. **The resolution order in `extension.js` is correct and honestly detected**:
|
||||
`inspect()` across all six user-writable scopes, in VS Code's own merge
|
||||
order (QA verified the order against documentation, including the
|
||||
language-scoped-beats-general rule), with the manifest default deliberately
|
||||
not counting as "set". The chmod-in-try/catch matches rust-analyzer's
|
||||
long-standing practice for the same VSIX-extraction reality.
|
||||
3. **`linux-x64` shipping musl is the right call** — a static server is what an
|
||||
extension installed by a stranger needs — and the gaps are recorded rather
|
||||
than hidden: no `x86_64-unknown-linux-gnu` package, no Alpine targets
|
||||
(universal fallback covers them), four non-host packages never executed on
|
||||
their own platforms.
|
||||
4. **QA's Finding 1** (short-circuited chmod of the unused bundled server) was
|
||||
fixed at the code level by the lead — see the work log — so the user-facing
|
||||
README's "both" is now unconditionally true. **Finding 2** (garbled
|
||||
pre-existing sentence in the RELEASING.md appendix) is real, predates this
|
||||
round, and is fixed by the lead in this same round. QA's disclosed coverage
|
||||
gap (the aarch64 `NEEDED` branch never fired against a genuine dynamic
|
||||
aarch64 ELF) is accepted: the branch is nine lines, read by three agents,
|
||||
and structurally identical to the x86-64 arm that *was* mutation-tested.
|
||||
|
||||
No version bump here: the packages are cut from whatever version the tree is
|
||||
at, and the next tagged release ships all six automatically via the unchanged
|
||||
`release.yml` → `release.sh --cross` path.
|
||||
@@ -1,2 +1,5 @@
|
||||
node_modules/
|
||||
*.vsix
|
||||
# Staged by tools/release.sh, one platform at a time, and removed again after
|
||||
# each package: docs/features/editor-platform-vsix. Never checked in.
|
||||
bin/
|
||||
@@ -11,6 +11,33 @@ manifest — LSP has no channel for either. See
|
||||
`docs/features/editor-packaging/README.md` for why the extension looks like
|
||||
this, and `docs/features/editor-snippets/README.md` for the snippets.
|
||||
|
||||
## 0. The short way: install a platform package
|
||||
|
||||
A release carries **platform-specific `.vsix` packages with the binaries inside
|
||||
them** — one per machine — so there is nothing to build and nothing to put on
|
||||
`PATH`:
|
||||
|
||||
```bash
|
||||
code --install-extension lucisv-0.10.0-darwin-arm64.vsix
|
||||
```
|
||||
|
||||
Pick the one matching the machine: `darwin-arm64`, `darwin-x64`, `linux-x64`,
|
||||
`linux-arm64`, `win32-x64`. The Linux packages are statically linked (musl), so
|
||||
they run on any distro. Inside the package the two binaries live at
|
||||
`bin/lucisv-server` and `bin/lucisv` (with `.exe` on Windows) under the
|
||||
extension's install directory; the extension spawns the server from there and
|
||||
makes both executable on first activation.
|
||||
|
||||
`lucisv-<version>.vsix` — no suffix — is the **universal fallback** for any
|
||||
platform above that is not listed (Alpine, for instance, which VS Code treats as
|
||||
its own target, and every BSD). It carries no binaries and looks
|
||||
`lucisv-server` up on `PATH`, which is what sections 1–3 below describe.
|
||||
|
||||
Setting `lucisv.serverPath` overrides the bundled server in either package — use
|
||||
it to point at a `target/release` build while you are working on the server
|
||||
itself. Only a value you actually set counts; leaving the setting alone keeps
|
||||
the bundled binary.
|
||||
|
||||
## 1. Build the server
|
||||
|
||||
```bash
|
||||
@@ -73,7 +100,7 @@ if it ever happens.
|
||||
|
||||
| Setting | Default | What it does |
|
||||
|---|---|---|
|
||||
| `lucisv.serverPath` | `"lucisv-server"` | Path to the executable. A bare name is looked up on `PATH`; an absolute path is used as given. |
|
||||
| `lucisv.serverPath` | `"lucisv-server"` | Path to the executable, overriding the server bundled with the extension. A bare name is looked up on `PATH`; an absolute path is used as given. Unset, a platform package uses its own `bin/lucisv-server` and the universal package uses `PATH`. |
|
||||
| `lucisv.rainbowBeginEnd` | `true` | Colour each nesting level of `begin`/`end` and `fork`/`join` differently, and half a pair in an error colour. Takes effect immediately — no reload. |
|
||||
| `lucisv.lineLength` | unset | Maximum line width, same as `line-length` in a `lucisv.toml`. 40–400. |
|
||||
| `lucisv.indent` | unset | Indent width in spaces, same as `indent` in a `lucisv.toml`. 1–8. |
|
||||
@@ -229,8 +256,13 @@ The extension registers no formatter of its own — the server advertises
|
||||
- **Nothing happens on a `.sv` file.** Check the language mode in the status
|
||||
bar. Another Verilog extension may own the `.sv` extension with a different
|
||||
language id; this one attaches to `verilog` and `systemverilog`.
|
||||
- **"command not found" style failure on startup.** The server is not on
|
||||
`PATH`. Set `lucisv.serverPath` to an absolute path, and confirm the binary
|
||||
itself works with `node smoke.js <path>`.
|
||||
- **"command not found" style failure on startup.** You are on the universal
|
||||
package and the server is not on `PATH` — install the platform package for
|
||||
your machine instead, or set `lucisv.serverPath` to an absolute path. Confirm
|
||||
the binary itself works with `node smoke.js <path>`.
|
||||
- **A `lucisv.serverPath` you set once is still winning.** It beats the bundled
|
||||
server by design, and it beats it silently. Clear the setting (not "set it
|
||||
back to `lucisv-server`" — that is a value you set, and it sends the extension
|
||||
back to `PATH`) to fall back to the binary inside the package.
|
||||
- **See what the server is saying.** View → Output → the `lucisv` channel carries
|
||||
the client/server log, including anything the server writes to stderr.
|
||||
@@ -8,6 +8,8 @@
|
||||
// LSP has no "decorate these ranges" notification, so the painting has to be
|
||||
// driven from the client side (docs/features/editor-scopes).
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const vscode = require('vscode');
|
||||
const { LanguageClient, ProposedFeatures, TransportKind } = require('vscode-languageclient/node');
|
||||
|
||||
@@ -44,9 +46,85 @@ let rainbowEnabled = true;
|
||||
/** The pending debounced repaint, if any. */
|
||||
let repaintTimer;
|
||||
|
||||
/**
|
||||
* The `lucisv.serverPath` scopes a *user* can write to, most specific first —
|
||||
* the order VS Code's own `get()` resolves them in.
|
||||
*
|
||||
* `defaultValue` and `defaultLanguageValue` are deliberately absent: those are
|
||||
* defaults contributed by a manifest, not something anybody chose, and treating
|
||||
* them as a choice is exactly the bug this list exists to avoid (see
|
||||
* `userServerPath`).
|
||||
*/
|
||||
const SERVER_PATH_SCOPES = [
|
||||
'workspaceFolderLanguageValue',
|
||||
'workspaceLanguageValue',
|
||||
'globalLanguageValue',
|
||||
'workspaceFolderValue',
|
||||
'workspaceValue',
|
||||
'globalValue',
|
||||
];
|
||||
|
||||
/**
|
||||
* The `lucisv.serverPath` the user set, or `undefined` if they never set one.
|
||||
*
|
||||
* `inspect()` and not `get()`, and this is the whole reason the function
|
||||
* exists: `get()` answers `"lucisv-server"` for someone who has never touched
|
||||
* the setting, because that is `package.json`'s own default — so a `get()`
|
||||
* check would make the bundled server unreachable for every user who did not
|
||||
* explicitly override it. A blank value counts as unset, as it always has.
|
||||
*/
|
||||
function userServerPath() {
|
||||
const inspected = vscode.workspace.getConfiguration('lucisv').inspect('serverPath');
|
||||
if (!inspected) return undefined;
|
||||
for (const scope of SERVER_PATH_SCOPES) {
|
||||
const value = inspected[scope];
|
||||
if (typeof value === 'string' && value.trim() !== '') return value;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The path to a binary this package carries under `bin/`, or `undefined` if it
|
||||
* carries none.
|
||||
*
|
||||
* The universal `.vsix` has no `bin/` at all and the platform-specific ones
|
||||
* have both binaries, so the file's existence is the runtime test that tells
|
||||
* the two packages apart (docs/features/editor-platform-vsix). On anything but
|
||||
* Windows the executable bit is restored first: VSIX extraction does not
|
||||
* reliably preserve it — the same chmod, for the same reason, that
|
||||
* rust-analyzer's extension does — and a server that cannot be spawned looks
|
||||
* to the user exactly like a server that crashed.
|
||||
*/
|
||||
function bundledBinary(context, name) {
|
||||
const file = context.asAbsolutePath(
|
||||
path.join('bin', process.platform === 'win32' ? `${name}.exe` : name),
|
||||
);
|
||||
if (!fs.existsSync(file)) return undefined;
|
||||
if (process.platform !== 'win32') {
|
||||
try {
|
||||
fs.chmodSync(file, 0o755);
|
||||
} catch {
|
||||
// A read-only install, or a file owned by someone else. Spawning may
|
||||
// still work; if it does not, the language client says so in its own
|
||||
// output channel, which is where the user is already looking.
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
/** Spawn the server and attach it to Verilog/SystemVerilog documents. */
|
||||
function activate(context) {
|
||||
const serverPath = vscode.workspace.getConfiguration('lucisv').get('serverPath') || 'lucisv-server';
|
||||
// Nothing here spawns the bundled CLI, but the platform packages ship it so
|
||||
// that installing the extension gives you `lucisv` too — which is only true
|
||||
// if it is executable.
|
||||
bundledBinary(context, 'lucisv');
|
||||
// Resolved unconditionally, so both bundled binaries are made executable
|
||||
// even when a user setting wins the spawn below.
|
||||
const bundledServer = bundledBinary(context, 'lucisv-server');
|
||||
// A setting the user wrote, else the binary in this package, else the bare
|
||||
// name on PATH — which is what the universal package and a `cargo build`
|
||||
// install have always used.
|
||||
const serverPath = userServerPath() || bundledServer || 'lucisv-server';
|
||||
|
||||
// No arguments: `lucisv-server` takes none and speaks LSP on stdin/stdout.
|
||||
// `editors/vscode/smoke.js` spawns it exactly this way.
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "lucisv",
|
||||
"version": "0.7.2",
|
||||
"version": "0.10.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "lucisv",
|
||||
"version": "0.7.2",
|
||||
"version": "0.10.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"vscode-languageclient": "9.0.1"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "lucisv",
|
||||
"displayName": "lucisv — Verilog/SystemVerilog",
|
||||
"description": "Formatting, diagnostics, navigation and semantic highlighting for Verilog and SystemVerilog, served by the lucisv language server.",
|
||||
"version": "0.10.0",
|
||||
"version": "0.10.1",
|
||||
"publisher": "guoliangchen",
|
||||
"author": "Guoliang Chen",
|
||||
"license": "MIT",
|
||||
@@ -156,7 +156,7 @@
|
||||
"lucisv.serverPath": {
|
||||
"type": "string",
|
||||
"default": "lucisv-server",
|
||||
"description": "Path to the lucisv-server executable. A bare name is looked up on PATH."
|
||||
"description": "Path to the lucisv-server executable. Overrides the server bundled with the extension. A bare name is looked up on PATH."
|
||||
},
|
||||
"lucisv.rainbowBeginEnd": {
|
||||
"type": "boolean",
|
||||
|
||||
+74
-21
@@ -9,8 +9,9 @@ it lives in the appendix at the bottom.
|
||||
## Cross-platform builds (`--cross`)
|
||||
|
||||
`tools/release.sh --cross` adds, next to the host (Apple Silicon) pair:
|
||||
`x86_64-apple-darwin` (Intel Mac), `x86_64-unknown-linux-musl` (any x86-64
|
||||
Linux — statically linked, no glibc dependency) and `x86_64-pc-windows-gnu`
|
||||
`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
|
||||
@@ -19,8 +20,26 @@ 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. The `.vsix` is
|
||||
platform-independent JavaScript; only the binaries are per-platform.
|
||||
for shops that require a native glibc link.
|
||||
|
||||
`--cross` also turns each cross-built pair into a **platform-specific `.vsix`**
|
||||
that carries those two 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.
|
||||
|
||||
| vsce target | 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` |
|
||||
|
||||
`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 falls back to
|
||||
the universal package — an accepted gap, recorded in the feature README.
|
||||
|
||||
One-time setup on the build Mac (2026-08-25, all via Homebrew):
|
||||
|
||||
@@ -31,6 +50,10 @@ brew install messense/macos-cross-toolchains/x86_64-unknown-linux-gnu
|
||||
/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*
|
||||
@@ -95,18 +118,24 @@ tools/release.sh # or: tools/release.sh -o /some/other/dir
|
||||
|
||||
It builds `--release`, copies the two binaries into `dist/` under
|
||||
version-and-host names, smoke-tests the server binary with
|
||||
`editors/vscode/smoke.js`, packages the extension into `dist/lucisv-<version>.vsix`,
|
||||
and writes `dist/SHA256SUMS`. `dist/` is gitignored and is deleted and
|
||||
recreated on every run.
|
||||
`editors/vscode/smoke.js`, packages the extension into `dist/lucisv-<version>.vsix`
|
||||
and into the host's platform package, smoke-tests the server *unzipped out of*
|
||||
that package, and writes `dist/SHA256SUMS`. `dist/` is gitignored and is
|
||||
deleted and recreated on every run.
|
||||
|
||||
```
|
||||
dist/
|
||||
lucisv-0.7.0-aarch64-apple-darwin
|
||||
lucisv-server-0.7.0-aarch64-apple-darwin
|
||||
lucisv-0.7.0.vsix
|
||||
lucisv-0.7.0.vsix # universal: no binaries, server from PATH
|
||||
lucisv-0.7.0-darwin-arm64.vsix # the same extension with the pair inside
|
||||
SHA256SUMS
|
||||
```
|
||||
|
||||
With `--cross` the loose binaries appear for all six triples and the remaining
|
||||
four platform packages (`darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64`)
|
||||
join them — twelve binaries and six `.vsix` files, plus `SHA256SUMS`.
|
||||
|
||||
Verify the checksums the way a downloader would:
|
||||
|
||||
```bash
|
||||
@@ -127,6 +156,9 @@ The script runs, inside `editors/vscode/`:
|
||||
```bash
|
||||
npm ci # 8 packages, exact lockfile
|
||||
npx @vscode/vsce package --out ../../dist/lucisv-<version>.vsix
|
||||
# then, per platform, with the two binaries staged in editors/vscode/bin/:
|
||||
npx @vscode/vsce package --target darwin-arm64 \
|
||||
--out ../../dist/lucisv-<version>-darwin-arm64.vsix
|
||||
```
|
||||
|
||||
- **No `--skip-license`.** `vsce` requires a `LICENSE` file next to
|
||||
@@ -144,10 +176,18 @@ npx @vscode/vsce package --out ../../dist/lucisv-<version>.vsix
|
||||
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`, `.vscode/**` and `.gitignore` out of the
|
||||
package. Check that after any change to it:
|
||||
package. It must **not** exclude `bin/`, which is where the platform packages'
|
||||
binaries are staged. Check that after any change to it:
|
||||
`unzip -l dist/lucisv-<version>.vsix | grep smoke` must print nothing, and
|
||||
`unzip -l dist/lucisv-<version>.vsix | grep syntaxes` must print the grammar —
|
||||
without it, hover cards ship unhighlighted.
|
||||
- **`editors/vscode/bin/` is transient.** `release.sh` stages one platform's
|
||||
pair into it, 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 <vsix> 'extension/bin/*'`: nothing for the universal one, exactly
|
||||
`lucisv` and `lucisv-server` (`.exe` for `win32-x64`) for a platform one. A
|
||||
stale `bin/` would otherwise ship one platform's server to another's users.
|
||||
|
||||
## 5. Install / distribute
|
||||
|
||||
@@ -157,12 +197,20 @@ 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.vsix
|
||||
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
|
||||
```
|
||||
|
||||
Publishing the artifacts is a matter of attaching `dist/`'s contents plus
|
||||
`SHA256SUMS` to a git tag / release page on `git.luci.ooo`. Tag after the
|
||||
gate is green:
|
||||
The platform package is the one to hand a user: it carries `lucisv` and
|
||||
`lucisv-server` 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` — and fall back to the universal
|
||||
`lucisv-<version>.vsix` anywhere else.
|
||||
|
||||
Publishing means attaching the six `.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'
|
||||
@@ -179,9 +227,9 @@ 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
|
||||
that id registered with vsce by the owner
|
||||
has created in the Visual Studio Marketplace.
|
||||
`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.
|
||||
@@ -216,11 +264,16 @@ git push origin v<X.Y.Z>
|
||||
```
|
||||
|
||||
does the rest on the `mac-arm64` runner: `tools/release.sh --cross`, a
|
||||
tag-vs-`lucisv --version` consistency check, `tools/release_notes.sh` (a
|
||||
missing CHANGELOG section fails the release), and
|
||||
`tools/publish_release.sh`, which creates the Gitea release and attaches
|
||||
every `dist/` artifact. Ordinary pushes run fmt/clippy/test via
|
||||
`.gitea/workflows/ci.yml`.
|
||||
tag-vs-`lucisv --version` consistency check, a pruning step that keeps
|
||||
**only the six `.vsix` packages** in `dist/` (each checked by name — a
|
||||
missing platform 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 this Mac: `brew install gitea-runner`, registered
|
||||
instance-wide as `mac-arm64` (labels `macos-arm64`/`self-hosted`, host
|
||||
|
||||
@@ -7,11 +7,15 @@
|
||||
# non-macOS artifacts are never executed; this automates the audit
|
||||
# tools/RELEASING.md documented as manual, and the release fails if any
|
||||
# check does:
|
||||
# *-linux-musl ELF x86-64, statically linked (zero NEEDED entries)
|
||||
# *-linux-musl ELF (x86-64 / aarch64), statically linked
|
||||
# *-linux-gnu ELF x86-64, glibc symbol ceiling <= 2.28 (RHEL 8)
|
||||
# *-windows-gnu.exe PE32+ x86-64
|
||||
# *-apple-darwin Mach-O 64-bit (arm64 / x86_64 per triple)
|
||||
#
|
||||
# The .vsix packages (platform-specific ones included) are skipped here:
|
||||
# tools/release.sh asserts their contents as it builds them
|
||||
# (docs/features/editor-platform-vsix).
|
||||
#
|
||||
# Needs the messense x86_64-unknown-linux-gnu toolchain's objdump for the
|
||||
# ELF checks (the same toolchain the linux-gnu build itself needs).
|
||||
|
||||
@@ -45,6 +49,26 @@ for f in "$dist"/lucisv-*; do
|
||||
fail "$name: musl build has dynamic dependencies (must be static)"
|
||||
fi
|
||||
;;
|
||||
*aarch64-unknown-linux-musl)
|
||||
# Two independent opinions, because the objdump here is a binutils
|
||||
# configured for x86-64: it does parse aarch64 ELFs (verified on this
|
||||
# machine -- "file format elf64-little", program headers and all), but
|
||||
# the dynamic-section read is the one thing that would fail quietly if a
|
||||
# future binutils stopped doing so. `file` reporting "statically linked"
|
||||
# is the honest cross-check, and it also names the architecture, which
|
||||
# objdump's generic elf64-little does not.
|
||||
case $kind in
|
||||
*ELF*aarch64*) ;;
|
||||
*) fail "$name: not an aarch64 ELF: $kind" ;;
|
||||
esac
|
||||
case $kind in
|
||||
*"statically linked"*) ;;
|
||||
*) fail "$name: musl build is not statically linked: $kind" ;;
|
||||
esac
|
||||
if "$objdump" -p "$f" | grep -q NEEDED; then
|
||||
fail "$name: musl build has dynamic dependencies (must be static)"
|
||||
fi
|
||||
;;
|
||||
*x86_64-unknown-linux-gnu)
|
||||
case $kind in
|
||||
*ELF*x86-64*) ;;
|
||||
|
||||
+120
-10
@@ -5,13 +5,18 @@
|
||||
# dist/lucisv-<version>-<host-triple>
|
||||
# dist/lucisv-server-<version>-<host-triple>
|
||||
# dist/lucisv-<version>.vsix (the VS Code extension; sideload it)
|
||||
# dist/lucisv-<version>-darwin-arm64.vsix (the same extension, with the
|
||||
# host binaries inside it -- no PATH
|
||||
# setup needed; docs/features/editor-platform-vsix)
|
||||
# dist/SHA256SUMS
|
||||
#
|
||||
# Standard tooling only -- cargo, npm and shasum, nothing installed globally.
|
||||
# With --cross it also builds x86_64 macOS, static-musl Linux and Windows
|
||||
# binaries, when the toolchains are present (rustup stable + the three
|
||||
# targets, and mingw-w64 for Windows; see tools/RELEASING.md). It publishes
|
||||
# nothing anywhere.
|
||||
# Standard tooling only -- cargo, npm, shasum and unzip (the last only to
|
||||
# check what the packages ended up containing), nothing installed globally.
|
||||
# With --cross it also builds x86_64 macOS, static-musl Linux (x86-64 and
|
||||
# aarch64) and Windows binaries, when the toolchains are present (rustup
|
||||
# stable + the five targets, and mingw-w64 for Windows; see
|
||||
# tools/RELEASING.md), plus the four remaining platform-specific .vsix
|
||||
# packages. It publishes nothing anywhere.
|
||||
#
|
||||
# Usage: tools/release.sh [-o dist-dir] [--no-vsix] [--cross]
|
||||
#
|
||||
@@ -38,6 +43,15 @@ case $dist in
|
||||
*) dist=$repo_root/$dist ;;
|
||||
esac
|
||||
|
||||
# Where a platform package's binaries are staged, one target at a time. It must
|
||||
# never outlive a packaging step: a leftover bin/ would put the previous
|
||||
# target's binaries into the next package -- or into the universal one, whose
|
||||
# whole point is carrying none. The trap covers the failure and Ctrl-C paths;
|
||||
# every success path removes it explicitly as well.
|
||||
bin_dir=$repo_root/editors/vscode/bin
|
||||
trap 'rm -rf "$bin_dir"' EXIT
|
||||
rm -rf "$bin_dir"
|
||||
|
||||
echo "==> building release binaries"
|
||||
cargo build --release --manifest-path "$repo_root/Cargo.toml" \
|
||||
-p lucisv -p lucisv_server
|
||||
@@ -76,6 +90,12 @@ if [ "$want_cross" -eq 1 ]; then
|
||||
cross_build x86_64-unknown-linux-musl \
|
||||
DYLD_FALLBACK_LIBRARY_PATH="$tc/lib" \
|
||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld
|
||||
# Same recipe, other architecture: rust-lld cross-links aarch64 as happily as
|
||||
# x86-64, so this needs no C toolchain of its own -- only the rust-std
|
||||
# component (`rustup target add`, see tools/RELEASING.md).
|
||||
cross_build aarch64-unknown-linux-musl \
|
||||
DYLD_FALLBACK_LIBRARY_PATH="$tc/lib" \
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld
|
||||
if command -v x86_64-unknown-linux-gnu-gcc >/dev/null 2>&1; then
|
||||
cross_build x86_64-unknown-linux-gnu \
|
||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc
|
||||
@@ -91,7 +111,7 @@ if [ "$want_cross" -eq 1 ]; then
|
||||
echo "error: --cross needs mingw-w64 for the Windows build (brew install mingw-w64)" >&2
|
||||
exit 2
|
||||
fi
|
||||
for triple in x86_64-apple-darwin x86_64-unknown-linux-musl x86_64-unknown-linux-gnu x86_64-pc-windows-gnu; do
|
||||
for triple in x86_64-apple-darwin x86_64-unknown-linux-musl aarch64-unknown-linux-musl x86_64-unknown-linux-gnu x86_64-pc-windows-gnu; do
|
||||
case $triple in *windows*) exe=.exe ;; *) exe="" ;; esac
|
||||
cp "$repo_root/target/$triple/release/lucisv$exe" "$dist/lucisv-$version-$triple$exe"
|
||||
cp "$repo_root/target/$triple/release/lucisv-server$exe" "$dist/lucisv-server-$version-$triple$exe"
|
||||
@@ -108,6 +128,63 @@ else
|
||||
echo " note: no node on PATH, skipping the server smoke test" >&2
|
||||
fi
|
||||
|
||||
# vsce names platforms its own way and rustc names triples; this table is the
|
||||
# whole translation. An unlisted triple gets no platform package -- notably
|
||||
# x86_64-unknown-linux-gnu, because `linux-x64` ships the *musl* build: a
|
||||
# statically linked server runs on any distro, which is what an extension
|
||||
# installed by a stranger needs (docs/features/editor-platform-vsix).
|
||||
vsce_target_for() { # rust triple -> vsce target name, empty if we ship none
|
||||
case $1 in
|
||||
aarch64-apple-darwin) echo darwin-arm64 ;;
|
||||
x86_64-apple-darwin) echo darwin-x64 ;;
|
||||
x86_64-unknown-linux-musl) echo linux-x64 ;;
|
||||
aarch64-unknown-linux-musl) echo linux-arm64 ;;
|
||||
x86_64-pc-windows-gnu) echo win32-x64 ;;
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# What a package carries under bin/ is the contract extension.js resolves
|
||||
# against, so it is asserted rather than assumed: the universal package must
|
||||
# carry nothing, a platform package exactly its two binaries.
|
||||
expect_vsix_bins() { # vsix file name, then the extension/bin entries expected
|
||||
vsix=$1; shift
|
||||
got=$(unzip -Z1 "$dist/$vsix" 'extension/bin/*' 2>/dev/null | LC_ALL=C sort | tr '\n' ' ')
|
||||
if [ $# -eq 0 ]; then
|
||||
want=""
|
||||
else
|
||||
want=$(printf '%s\n' "$@" | LC_ALL=C sort | tr '\n' ' ')
|
||||
fi
|
||||
if [ "$got" != "$want" ]; then
|
||||
echo "error: $vsix carries bin/ entries [$got], expected [$want]" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo " $vsix: bin/ contents ok"
|
||||
}
|
||||
|
||||
package_vsix() { # vsce target, rust triple
|
||||
vsce_target=$1
|
||||
triple=$2
|
||||
case $triple in *windows*) exe=.exe ;; *) exe="" ;; esac
|
||||
echo "==> packaging the VS Code extension for $vsce_target ($triple)"
|
||||
# Plain names inside the package: extension.js looks for bin/lucisv-server,
|
||||
# with no version and no triple in it, on every platform.
|
||||
mkdir -p "$bin_dir"
|
||||
cp "$dist/lucisv-$version-$triple$exe" "$bin_dir/lucisv$exe"
|
||||
cp "$dist/lucisv-server-$version-$triple$exe" "$bin_dir/lucisv-server$exe"
|
||||
chmod +x "$bin_dir/lucisv$exe" "$bin_dir/lucisv-server$exe"
|
||||
(
|
||||
cd "$repo_root/editors/vscode"
|
||||
npx @vscode/vsce package --target "$vsce_target" \
|
||||
--out "$dist/lucisv-$version-$vsce_target.vsix"
|
||||
)
|
||||
rm -rf "$bin_dir"
|
||||
expect_vsix_bins "lucisv-$version-$vsce_target.vsix" \
|
||||
"extension/bin/lucisv$exe" "extension/bin/lucisv-server$exe"
|
||||
vsix_built="$vsix_built lucisv-$version-$vsce_target.vsix"
|
||||
}
|
||||
|
||||
vsix_built=""
|
||||
if [ "$want_vsix" -eq 1 ]; then
|
||||
echo "==> packaging the VS Code extension"
|
||||
# `vsce` shells out to `npm list` and globs the paths it prints back, so it
|
||||
@@ -115,18 +192,51 @@ if [ "$want_vsix" -eq 1 ]; then
|
||||
# session sandbox rewrites, it silently collects zero files and fails with
|
||||
# "Extension entrypoint(s) missing". The repo itself is such a plain path,
|
||||
# which is why this packages in place and only the output goes to -o.
|
||||
#
|
||||
# The universal package goes first, with bin/ provably gone: it is the one
|
||||
# that must never carry a binary, being the fallback for every platform we
|
||||
# do not build for.
|
||||
rm -rf "$bin_dir"
|
||||
(
|
||||
cd "$repo_root/editors/vscode"
|
||||
npm ci
|
||||
npx @vscode/vsce package --out "$dist/lucisv-$version.vsix"
|
||||
)
|
||||
expect_vsix_bins "lucisv-$version.vsix"
|
||||
vsix_built=" lucisv-$version.vsix"
|
||||
|
||||
# Without --cross only the host's binaries exist, so only the host package
|
||||
# can be built -- and it is, so that the packaging path and the embedded
|
||||
# smoke test below run on every ordinary release too.
|
||||
vsix_triples=$host
|
||||
if [ "$want_cross" -eq 1 ]; then
|
||||
vsix_triples="$host x86_64-apple-darwin x86_64-unknown-linux-musl aarch64-unknown-linux-musl x86_64-pc-windows-gnu"
|
||||
fi
|
||||
for triple in $vsix_triples; do
|
||||
vsce_target=$(vsce_target_for "$triple")
|
||||
[ -n "$vsce_target" ] || continue
|
||||
package_vsix "$vsce_target" "$triple"
|
||||
done
|
||||
|
||||
# The host package gets one more check: unzip it and drive the *embedded*
|
||||
# server through a full LSP session, so "install the extension and it works"
|
||||
# is proven against a binary that has been through the zip rather than
|
||||
# against the one in dist/. unzip does not restore the executable bit
|
||||
# reliably -- the same reason extension.js chmods what it spawns.
|
||||
host_vsce_target=$(vsce_target_for "$host")
|
||||
if [ -n "$host_vsce_target" ] && command -v node >/dev/null 2>&1; then
|
||||
echo "==> smoke-testing the server embedded in the $host_vsce_target package"
|
||||
unpacked=$repo_root/target/vsix-check
|
||||
rm -rf "$unpacked"
|
||||
unzip -q "$dist/lucisv-$version-$host_vsce_target.vsix" -d "$unpacked"
|
||||
chmod +x "$unpacked/extension/bin/lucisv" "$unpacked/extension/bin/lucisv-server"
|
||||
node "$repo_root/editors/vscode/smoke.js" "$unpacked/extension/bin/lucisv-server"
|
||||
rm -rf "$unpacked"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "==> checksums"
|
||||
artifacts="lucisv-$version-$host lucisv-server-$version-$host$cross_built"
|
||||
if [ "$want_vsix" -eq 1 ]; then
|
||||
artifacts="$artifacts lucisv-$version.vsix"
|
||||
fi
|
||||
artifacts="lucisv-$version-$host lucisv-server-$version-$host$cross_built$vsix_built"
|
||||
(
|
||||
# Relative names, so `shasum -c SHA256SUMS` works from inside dist/.
|
||||
cd "$dist"
|
||||
|
||||
Reference in new issue
Block a user