Rename the tool to lucisv (Language Utility for Coding In SystemVerilog)
This commit is contained in:
1 parent
a284e33110
commit
eeaffafd56
188 files changed
+2825
-2802
No files matched your search
+18
-18
@@ -1,4 +1,4 @@
|
||||
# Releasing vfmt
|
||||
# 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
|
||||
@@ -16,7 +16,7 @@ Linux — statically linked, no glibc dependency) and `x86_64-pc-windows-gnu`
|
||||
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/vfmt-server-* | grep -o
|
||||
`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
|
||||
@@ -57,13 +57,13 @@ Four files, one number. Keep them identical.
|
||||
| `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: `vfmt --version` and the language
|
||||
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/vfmt --version # vfmt X.Y.Z
|
||||
target/release/lucisv --version # lucisv X.Y.Z
|
||||
```
|
||||
|
||||
## 2. Write the changelog
|
||||
@@ -95,15 +95,15 @@ 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/vfmt-<version>.vsix`,
|
||||
`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.
|
||||
|
||||
```
|
||||
dist/
|
||||
vfmt-0.7.0-aarch64-apple-darwin
|
||||
vfmt-server-0.7.0-aarch64-apple-darwin
|
||||
vfmt-0.7.0.vsix
|
||||
lucisv-0.7.0-aarch64-apple-darwin
|
||||
lucisv-server-0.7.0-aarch64-apple-darwin
|
||||
lucisv-0.7.0.vsix
|
||||
SHA256SUMS
|
||||
```
|
||||
|
||||
@@ -126,7 +126,7 @@ The script runs, inside `editors/vscode/`:
|
||||
|
||||
```bash
|
||||
npm ci # 8 packages, exact lockfile
|
||||
npx @vscode/vsce package --out ../../dist/vfmt-<version>.vsix
|
||||
npx @vscode/vsce package --out ../../dist/lucisv-<version>.vsix
|
||||
```
|
||||
|
||||
- **No `--skip-license`.** `vsce` requires a `LICENSE` file next to
|
||||
@@ -145,19 +145,19 @@ npx @vscode/vsce package --out ../../dist/vfmt-<version>.vsix
|
||||
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:
|
||||
`unzip -l dist/vfmt-<version>.vsix | grep smoke` must print nothing, and
|
||||
`unzip -l dist/vfmt-<version>.vsix | grep syntaxes` must print the grammar —
|
||||
`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.
|
||||
|
||||
## 5. Install / distribute
|
||||
|
||||
```bash
|
||||
# the CLI and the server: anywhere on PATH
|
||||
install -m 755 dist/vfmt-0.7.0-aarch64-apple-darwin ~/.local/bin/vfmt
|
||||
install -m 755 dist/vfmt-server-0.7.0-aarch64-apple-darwin ~/.local/bin/vfmt-server
|
||||
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/vfmt-0.7.0.vsix
|
||||
code --install-extension dist/lucisv-0.7.0.vsix
|
||||
```
|
||||
|
||||
Publishing the artifacts is a matter of attaching `dist/`'s contents plus
|
||||
@@ -165,13 +165,13 @@ Publishing the artifacts is a matter of attaching `dist/`'s contents plus
|
||||
gate is green:
|
||||
|
||||
```bash
|
||||
git tag -a v0.5.0 -m 'vfmt 0.5.0'
|
||||
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 vfmt has today, and
|
||||
**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.
|
||||
@@ -194,10 +194,10 @@ The commands themselves, once those exist:
|
||||
# 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/vfmt-0.7.0.vsix -p "$VSCE_TOKEN"
|
||||
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/vfmt-0.7.0.vsix -p "$OVSX_TOKEN"
|
||||
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
|
||||
|
||||
+10
-10
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run vfmt over a corpus of real-world RTL and report parse/format health.
|
||||
# Run lucisv over a corpus of real-world RTL and report parse/format health.
|
||||
#
|
||||
# This is vfmt's answer to ruff's "ecosystem check": point it at a tree of
|
||||
# This is lucisv's answer to ruff's "ecosystem check": point it at a tree of
|
||||
# third-party Verilog and it says how much of it we can parse, how much is
|
||||
# already format-clean, and which errors dominate. It never writes to the
|
||||
# corpus -- only --check is used.
|
||||
#
|
||||
# Usage: tools/corpus_check.sh [corpus-dir] [-o results.tsv] [-t TOP] [-b vfmt]
|
||||
# Usage: tools/corpus_check.sh [corpus-dir] [-o results.tsv] [-t TOP] [-b lucisv]
|
||||
#
|
||||
# Exit status: 0 if no verification errors and no crashes were seen,
|
||||
# 1 otherwise (those two outcomes are always formatter bugs).
|
||||
@@ -14,7 +14,7 @@
|
||||
set -eu
|
||||
|
||||
corpus_dir=corpus
|
||||
vfmt=target/release/vfmt
|
||||
lucisv=target/release/lucisv
|
||||
results=corpus-check-results.tsv
|
||||
top=20
|
||||
|
||||
@@ -22,22 +22,22 @@ while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-o) results=$2; shift 2 ;;
|
||||
-t) top=$2; shift 2 ;;
|
||||
-b) vfmt=$2; shift 2 ;;
|
||||
-*) echo "usage: $0 [corpus-dir] [-o out.tsv] [-t top-n] [-b vfmt-binary]" >&2; exit 2 ;;
|
||||
-b) lucisv=$2; shift 2 ;;
|
||||
-*) echo "usage: $0 [corpus-dir] [-o out.tsv] [-t top-n] [-b lucisv-binary]" >&2; exit 2 ;;
|
||||
*) corpus_dir=$1; shift ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -x "$vfmt" ] || { echo "no vfmt binary at $vfmt (cargo build --release?)" >&2; exit 2; }
|
||||
[ -x "$lucisv" ] || { echo "no lucisv binary at $lucisv (cargo build --release?)" >&2; exit 2; }
|
||||
[ -d "$corpus_dir" ] || { echo "no corpus at $corpus_dir (tools/corpus_fetch.sh?)" >&2; exit 2; }
|
||||
|
||||
# Classify one file. vfmt --check exit codes (frozen contract, see README):
|
||||
# Classify one file. lucisv --check exit codes (frozen contract, see README):
|
||||
# 0 clean, 1 would reformat, 2 error. Anything else is a crash -- a signal
|
||||
# death (128+n) or an abort the per-file catch_unwind could not contain.
|
||||
check_one() {
|
||||
file=$1
|
||||
status=0
|
||||
out=$("$vfmt" --check "$file" 2>&1) || status=$?
|
||||
out=$("$lucisv" --check "$file" 2>&1) || status=$?
|
||||
msg=$(printf '%s\n' "$out" | grep '^error: ' | head -1)
|
||||
msg=${msg#error: }
|
||||
msg=${msg#"$file": }
|
||||
@@ -63,7 +63,7 @@ check_one() {
|
||||
printf '%s\t%s\t%s\n' "$outcome" "$file" "$msg"
|
||||
}
|
||||
|
||||
echo "vfmt: $vfmt"
|
||||
echo "lucisv: $lucisv"
|
||||
echo "corpus: $corpus_dir"
|
||||
echo
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Clone pinned revisions of permissively-licensed open-source RTL into a
|
||||
# local corpus directory, for tools/corpus_check.sh to run vfmt over.
|
||||
# local corpus directory, for tools/corpus_check.sh to run lucisv over.
|
||||
#
|
||||
# Every repo is pinned to an exact commit and fetched shallow (--depth 1);
|
||||
# nothing here ever tracks a moving branch, so corpus numbers recorded in
|
||||
@@ -32,7 +32,7 @@ fetch_one() {
|
||||
commit=$3
|
||||
sparse=$4
|
||||
dest="$corpus_dir/$name"
|
||||
stamp="$dest/.vfmt-corpus-rev"
|
||||
stamp="$dest/.lucisv-corpus-rev"
|
||||
|
||||
if [ -f "$stamp" ] && [ "$(cat "$stamp")" = "$commit" ]; then
|
||||
echo "== $name: already at $commit, skipping"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Format only the lines a git diff touched — vfmt's answer to Verible's
|
||||
# Format only the lines a git diff touched — lucisv's answer to Verible's
|
||||
# `git-verible-verilog-format.sh`.
|
||||
#
|
||||
# This is what makes vfmt adoptable in a dirty legacy tree: your patch comes
|
||||
# This is what makes lucisv adoptable in a dirty legacy tree: your patch comes
|
||||
# out formatted, and not one byte outside it moves, so review sees the change
|
||||
# you made rather than a reflow of the whole file.
|
||||
#
|
||||
# Usage: tools/vfmt-changed.sh [--check|--diff] [<rev>] [-- <pathspec>...]
|
||||
# Usage: tools/lucisv-changed.sh [--check|--diff] [<rev>] [-- <pathspec>...]
|
||||
#
|
||||
# <rev> what to diff against; default: unstaged+staged work, i.e. HEAD.
|
||||
# `tools/vfmt-changed.sh origin/main` formats a whole branch.
|
||||
# --check / --diff are passed through to vfmt, so this works in CI.
|
||||
# `tools/lucisv-changed.sh origin/main` formats a whole branch.
|
||||
# --check / --diff are passed through to lucisv, so this works in CI.
|
||||
#
|
||||
# Exit status is vfmt's, per the frozen contract: 0 nothing to do, 1
|
||||
# Exit status is lucisv's, per the frozen contract: 0 nothing to do, 1
|
||||
# --check/--diff found changes, 2 an error (that file was left untouched).
|
||||
#
|
||||
# Only *added* lines are formatted: `git diff -U0` hunk headers give
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
set -eu
|
||||
|
||||
vfmt=${VFMT:-target/release/vfmt}
|
||||
lucisv=${LUCISV:-target/release/lucisv}
|
||||
mode=""
|
||||
rev="HEAD"
|
||||
have_rev=0
|
||||
@@ -36,8 +36,8 @@ while [ $# -gt 0 ]; do
|
||||
done
|
||||
[ "$have_rev" = 1 ] || rev=HEAD
|
||||
|
||||
command -v "$vfmt" >/dev/null 2>&1 || [ -x "$vfmt" ] || {
|
||||
echo "no vfmt binary at $vfmt (cargo build --release? or set VFMT=)" >&2
|
||||
command -v "$lucisv" >/dev/null 2>&1 || [ -x "$lucisv" ] || {
|
||||
echo "no lucisv binary at $lucisv (cargo build --release? or set LUCISV=)" >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ for file in $files; do
|
||||
| awk '{ count = ($2 == "" ? 1 : $2); if (count > 0) printf "%s%d-%d", sep, $1, $1 + count - 1; sep = "," }')
|
||||
[ -n "$ranges" ] || continue
|
||||
# shellcheck disable=SC2086 # $mode is one optional flag, deliberately split.
|
||||
"$vfmt" $mode --lines "$ranges" "$file" || status=$?
|
||||
"$lucisv" $mode --lines "$ranges" "$file" || status=$?
|
||||
done
|
||||
|
||||
exit $status
|
||||
+18
-18
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build vfmt's release artifacts into dist/ and checksum them.
|
||||
# Build lucisv's release artifacts into dist/ and checksum them.
|
||||
#
|
||||
# Produces, for the machine it runs on:
|
||||
# dist/vfmt-<version>-<host-triple>
|
||||
# dist/vfmt-server-<version>-<host-triple>
|
||||
# dist/vfmt-<version>.vsix (the VS Code extension; sideload it)
|
||||
# dist/lucisv-<version>-<host-triple>
|
||||
# dist/lucisv-server-<version>-<host-triple>
|
||||
# dist/lucisv-<version>.vsix (the VS Code extension; sideload it)
|
||||
# dist/SHA256SUMS
|
||||
#
|
||||
# Standard tooling only -- cargo, npm and shasum, nothing installed globally.
|
||||
@@ -40,18 +40,18 @@ esac
|
||||
|
||||
echo "==> building release binaries"
|
||||
cargo build --release --manifest-path "$repo_root/Cargo.toml" \
|
||||
-p vfmt -p vfmt_server
|
||||
-p lucisv -p lucisv_server
|
||||
|
||||
# The binaries themselves are the authority on the version, not Cargo.toml:
|
||||
# `vfmt --version` is what a user will quote in a bug report.
|
||||
version=$("$repo_root/target/release/vfmt" --version | awk '{print $2}')
|
||||
# `lucisv --version` is what a user will quote in a bug report.
|
||||
version=$("$repo_root/target/release/lucisv" --version | awk '{print $2}')
|
||||
host=$(rustc -vV | awk '/^host:/{print $2}')
|
||||
echo " vfmt $version, host $host"
|
||||
echo " lucisv $version, host $host"
|
||||
|
||||
rm -rf "$dist"
|
||||
mkdir -p "$dist"
|
||||
cp "$repo_root/target/release/vfmt" "$dist/vfmt-$version-$host"
|
||||
cp "$repo_root/target/release/vfmt-server" "$dist/vfmt-server-$version-$host"
|
||||
cp "$repo_root/target/release/lucisv" "$dist/lucisv-$version-$host"
|
||||
cp "$repo_root/target/release/lucisv-server" "$dist/lucisv-server-$version-$host"
|
||||
|
||||
# Cross targets: each built only if its toolchain is available, each an
|
||||
# explicit failure otherwise -- a release with silently missing platforms is
|
||||
@@ -69,7 +69,7 @@ if [ "$want_cross" -eq 1 ]; then
|
||||
echo "==> building for $triple"
|
||||
env RUSTC="$tc/bin/rustc" "$@" \
|
||||
"$tc/bin/cargo" build --release --manifest-path "$repo_root/Cargo.toml" \
|
||||
--target "$triple" -p vfmt -p vfmt_server
|
||||
--target "$triple" -p lucisv -p lucisv_server
|
||||
}
|
||||
exe=""
|
||||
cross_build x86_64-apple-darwin
|
||||
@@ -93,9 +93,9 @@ if [ "$want_cross" -eq 1 ]; then
|
||||
fi
|
||||
for triple in x86_64-apple-darwin x86_64-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/vfmt$exe" "$dist/vfmt-$version-$triple$exe"
|
||||
cp "$repo_root/target/$triple/release/vfmt-server$exe" "$dist/vfmt-server-$version-$triple$exe"
|
||||
cross_built="$cross_built vfmt-$version-$triple$exe vfmt-server-$version-$triple$exe"
|
||||
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"
|
||||
cross_built="$cross_built lucisv-$version-$triple$exe lucisv-server-$version-$triple$exe"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -103,7 +103,7 @@ fi
|
||||
# `smoke.js` is plain node with no dependencies, so this runs before `npm ci`.
|
||||
if command -v node >/dev/null 2>&1; then
|
||||
echo "==> smoke-testing the server binary"
|
||||
node "$repo_root/editors/vscode/smoke.js" "$dist/vfmt-server-$version-$host"
|
||||
node "$repo_root/editors/vscode/smoke.js" "$dist/lucisv-server-$version-$host"
|
||||
else
|
||||
echo " note: no node on PATH, skipping the server smoke test" >&2
|
||||
fi
|
||||
@@ -118,14 +118,14 @@ if [ "$want_vsix" -eq 1 ]; then
|
||||
(
|
||||
cd "$repo_root/editors/vscode"
|
||||
npm ci
|
||||
npx @vscode/vsce package --out "$dist/vfmt-$version.vsix"
|
||||
npx @vscode/vsce package --out "$dist/lucisv-$version.vsix"
|
||||
)
|
||||
fi
|
||||
|
||||
echo "==> checksums"
|
||||
artifacts="vfmt-$version-$host vfmt-server-$version-$host$cross_built"
|
||||
artifacts="lucisv-$version-$host lucisv-server-$version-$host$cross_built"
|
||||
if [ "$want_vsix" -eq 1 ]; then
|
||||
artifacts="$artifacts vfmt-$version.vsix"
|
||||
artifacts="$artifacts lucisv-$version.vsix"
|
||||
fi
|
||||
(
|
||||
# Relative names, so `shasum -c SHA256SUMS` works from inside dist/.
|
||||
|
||||
Reference in new issue
Block a user