refactor(cli)!: split the contributor tool out of the ludic CLI
`ludic help` ended with a section titled "contributing to the toolchain itself", listing bootstrap, reseed, docs-gen and release tasks. None of that is available to someone who installed the language — those tasks need the repository — so the shipped tool was advertising work its user cannot do, in a namespace they have to read past to find `new` and `run`. The tasks move to a second program, dev.ludic -> bin/ludic-dev, built from a checkout and excluded from every release artifact. `ludic` keeps the project and package commands and nothing else; `ludic dev …` now explains where the tasks went instead of failing as an unknown command. What this shook out: the two programs share prelude/build/project/pkg, so the helpers each had accreted in whichever file first needed them — cc(), ensure_ludicc, the string functions, title_case, cmd_version — moved to where both can see them. The argument-shift indirection added for the `dev` namespace is gone with the namespace, so commands read argv directly again. `ludic-dev test` asserts the split rather than trusting it: the staged install must build a project, and `ludic dev build` there must fail while naming ludic-dev. install.sh keeps building older tags, whose bootstrap goes through main.ludic. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
f369fbd227
commit
e175619543
46 changed files with 630 additions and 558 deletions
|
|
@ -8,13 +8,13 @@ Closes #
|
|||
|
||||
## Checklist
|
||||
|
||||
- [ ] `bin/ludic dev test` passes.
|
||||
- [ ] For compiler/runtime changes: `bin/ludic dev reseed && bin/ludic dev bootstrap-cfree`
|
||||
- [ ] `bin/ludic-dev test` passes.
|
||||
- [ ] For compiler/runtime changes: `bin/ludic-dev reseed && bin/ludic-dev bootstrap-cfree`
|
||||
still reaches the self-hosting fixpoint with no C compiler in the loop.
|
||||
- [ ] `ludic-fmt` leaves the touched files unchanged (2-space, LF, UTF-8).
|
||||
- [ ] New/changed stdlib symbols are documented under `docs/language/**` and
|
||||
registered in `tools/docgen/inventory.json`
|
||||
(`bin/ludic dev docs-gen && bin/ludic dev docs-check build/pages` passes).
|
||||
(`bin/ludic-dev docs-gen && bin/ludic-dev docs-check build/pages` passes).
|
||||
- [ ] Commits follow [Conventional Commits](https://www.conventionalcommits.org).
|
||||
- [ ] No new C / Python / JS in tooling (Ludic only), and no generated
|
||||
artifacts committed outside `build/` / `bin/`.
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ jobs:
|
|||
set -eu
|
||||
mkdir -p bin
|
||||
clang-16 tools/ci/linux_stdio_shim.ll selfhost/ludicc.seed.ll -o bin/ludicc
|
||||
bin/ludicc tools/ludic-cli/main.ludic -o bin/ludic
|
||||
bin/ludicc tools/ludic-cli/dev.ludic -o bin/ludic-dev
|
||||
|
||||
- name: Rebuild the compiler from the seed and assert byte-identity
|
||||
# `ludic dev bootstrap-cfree` assembles the seed with clang, has that seed
|
||||
# `ludic-dev bootstrap-cfree` assembles the seed with clang, has that seed
|
||||
# compiler recompile selfhost.ludic to out.ll, and `cmp`s out.ll against
|
||||
# the checked-in seed. It returns non-zero if they differ — i.e. if the
|
||||
# seed is stale relative to the compiler source.
|
||||
run: bin/ludic dev bootstrap-cfree
|
||||
run: bin/ludic-dev bootstrap-cfree
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ name: ci
|
|||
|
||||
# Build the language toolchain from its IR seed and run the regression suites on
|
||||
# every push to main and every pull request. Until this landed the only workflow
|
||||
# was docs.yml, so nothing gated a change on `ludic dev test` / `ludic dev test-tools` or on the
|
||||
# was docs.yml, so nothing gated a change on `ludic-dev test` / `ludic-dev test-tools` or on the
|
||||
# compiler even building from the seed. See also bootstrap.yml, which proves the
|
||||
# C-free self-rebuild reproduces the seed byte-for-byte.
|
||||
on:
|
||||
|
|
@ -45,7 +45,7 @@ jobs:
|
|||
# The toolchain is macOS-first; on this Linux runner it links against a
|
||||
# tiny C-free IR shim that supplies the Darwin standard-stream globals
|
||||
# (__stdoutp/__stderrp) over glibc's stdout/stderr. Injected through
|
||||
# LUDIC_CC so every clang invocation — the seed bootstrap, `ludic dev build`,
|
||||
# LUDIC_CC so every clang invocation — the seed bootstrap, `ludic-dev build`,
|
||||
# and each compiled test program — picks it up. Absolute path so it
|
||||
# still resolves if a step changes directory.
|
||||
echo "LUDIC_CC=clang-16 $(pwd)/tools/ci/linux_stdio_shim.ll" >> "$GITHUB_ENV"
|
||||
|
|
@ -60,20 +60,20 @@ jobs:
|
|||
# pre-built binaries: the language builds itself from source + seed.
|
||||
mkdir -p bin
|
||||
clang-16 tools/ci/linux_stdio_shim.ll selfhost/ludicc.seed.ll -o bin/ludicc
|
||||
bin/ludicc tools/ludic-cli/main.ludic -o bin/ludic
|
||||
bin/ludic dev build
|
||||
bin/ludicc tools/ludic-cli/dev.ludic -o bin/ludic-dev
|
||||
bin/ludic-dev build
|
||||
|
||||
- name: Regression suite (ludic dev test)
|
||||
run: bin/ludic dev test
|
||||
- name: Regression suite (ludic-dev test)
|
||||
run: bin/ludic-dev test
|
||||
|
||||
- name: Editor-toolchain suite (ludic dev test-tools)
|
||||
- name: Editor-toolchain suite (ludic-dev test-tools)
|
||||
# Grammar/lexer/vocabulary sync, ludic-fmt idempotence (the project's
|
||||
# formatting contract — hand alignment is deliberately preserved, so the
|
||||
# gate is fmt(fmt(x)) == fmt(x), not fmt(x) == x), and the JSON/XML editor
|
||||
# assets. Cross-file LSP behaviour and the golden renders are macOS-ABI
|
||||
# bound and skip here — visibly — until the runtime's directory walk and
|
||||
# windowing are portable.
|
||||
run: bin/ludic dev test-tools
|
||||
run: bin/ludic-dev test-tools
|
||||
|
||||
- name: Docs cover the implementation
|
||||
run: |
|
||||
|
|
@ -81,9 +81,9 @@ jobs:
|
|||
# The whole docs toolchain is written in Ludic and runs through x —
|
||||
# no Python anywhere. check-impl / check-vocabulary / check-docs guard
|
||||
# the sources; docs-gen builds the site and docs-check is its coverage
|
||||
# + integrity guard. (check-vocabulary also runs in `ludic dev test-tools`.)
|
||||
bin/ludic dev check-impl
|
||||
bin/ludic dev check-vocabulary
|
||||
bin/ludic dev check-docs
|
||||
bin/ludic dev docs-gen --out build/pages
|
||||
bin/ludic dev docs-check build/pages
|
||||
# + integrity guard. (check-vocabulary also runs in `ludic-dev test-tools`.)
|
||||
bin/ludic-dev check-impl
|
||||
bin/ludic-dev check-vocabulary
|
||||
bin/ludic-dev check-docs
|
||||
bin/ludic-dev docs-gen --out build/pages
|
||||
bin/ludic-dev docs-check build/pages
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ jobs:
|
|||
runs-on: docker
|
||||
# The generator is now Ludic, so this builds the toolchain from its IR seed
|
||||
# (clang assembles the seed into bin/ludicc, which compiles bin/ludic) exactly
|
||||
# like the ci workflow, then runs `ludic dev docs-gen`. node:20-bookworm carries git
|
||||
# like the ci workflow, then runs `ludic-dev docs-gen`. node:20-bookworm carries git
|
||||
# for the clone + publish; clang-16 is the only extra the bootstrap needs.
|
||||
container: node:20-bookworm
|
||||
steps:
|
||||
|
|
@ -67,9 +67,9 @@ jobs:
|
|||
export LUDIC_HOME="$(pwd)"
|
||||
mkdir -p bin
|
||||
clang-16 tools/ci/linux_stdio_shim.ll selfhost/ludicc.seed.ll -o bin/ludicc
|
||||
bin/ludicc tools/ludic-cli/main.ludic -o bin/ludic
|
||||
bin/ludic dev docs-gen --out ../public
|
||||
bin/ludic dev docs-check ../public
|
||||
bin/ludicc tools/ludic-cli/dev.ludic -o bin/ludic-dev
|
||||
bin/ludic-dev docs-gen --out ../public
|
||||
bin/ludic-dev docs-check ../public
|
||||
cd ..
|
||||
echo "--- generated files ---"
|
||||
ls -la public
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: release
|
||||
|
||||
# Cutting a release is `ludic dev release` + `git push --tags`; everything after that
|
||||
# Cutting a release is `ludic-dev release` + `git push --tags`; everything after that
|
||||
# happens here. Before this workflow existed the artifacts were built on whatever
|
||||
# machine the maintainer happened to be sitting at, from whatever was in bin/ at
|
||||
# the time, with no checksums and nothing proving the tagged tree even passed its
|
||||
|
|
@ -71,15 +71,15 @@ jobs:
|
|||
set -eu
|
||||
mkdir -p bin
|
||||
clang-16 tools/ci/linux_stdio_shim.ll selfhost/ludicc.seed.ll -o bin/ludicc
|
||||
bin/ludicc tools/ludic-cli/main.ludic -o bin/ludic
|
||||
bin/ludic dev build
|
||||
bin/ludicc tools/ludic-cli/dev.ludic -o bin/ludic-dev
|
||||
bin/ludic-dev build
|
||||
|
||||
- name: The tagged tree must pass its own suites
|
||||
run: |
|
||||
set -eu
|
||||
bin/ludic dev test
|
||||
bin/ludic dev test-tools
|
||||
bin/ludic dev bootstrap-cfree
|
||||
bin/ludic-dev test
|
||||
bin/ludic-dev test-tools
|
||||
bin/ludic-dev bootstrap-cfree
|
||||
|
||||
- name: Publish the release
|
||||
env:
|
||||
|
|
@ -91,9 +91,9 @@ jobs:
|
|||
echo "::error::No FORGEJO_TOKEN secret; cannot create the release."
|
||||
exit 1
|
||||
fi
|
||||
# ludic dev publish builds dist/ (source tarball from the tag, this host's
|
||||
# ludic-dev publish builds dist/ (source tarball from the tag, this host's
|
||||
# toolchain, SHA256SUMS), takes the notes from the CHANGELOG section,
|
||||
# and creates the release. Re-running it only adds missing assets, so
|
||||
# a maintainer can afterwards attach the macOS toolchain from a Mac
|
||||
# with the same command.
|
||||
bin/ludic dev publish "$TAG"
|
||||
bin/ludic-dev publish "$TAG"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue