Repository navigation
CLI overhaul: command classes, upgrade, doctor, completions, build progress, COMPILER_VERSION - #286
Merged
Merged
Conversation
…hip it as share/install.sh
… strict mode, rollback only own swap
…tag/version CI check
…resh stale profiler text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A CLI overhaul in five stacked steps, delivered as one PR. Every command is now a class with declared options, the compiler can update and diagnose itself, shells get completions, and long builds report progress.
Fixes #174
Fixes #176
What changes for users
manticore upgrade [--check] [--version X]install.sh. Mandatory checksum, staged swap with rollback, previous binary kept asbin/.manticore.prev, foreign installs (package manager, container image) are refused with the likely owner named.--checkexits 0 current / 1 update available / 2 error.manticore doctor [--offline] [--no-smoke][ OK ]/[WARN]/[FAIL]per check: clang >= 15,cc, stdlib/.sig/prelude found, pcre2/openssl/zlib, a hello-world compile+run, update availability. Exit 1 only on FAIL.manticore version --checkupgrade --check.manticore completions bash|zsh|fishcompile/build--progress=auto|live|plain|json|off,--quiet,--timings,--color=auto|always|never. Live line on a terminal; piped output stays silent unlessCIis set (so existing stderr consumers are unchanged); JSON events for tools; real counters only where the total is known (files,functions,clang n/Nfor split builds). stdout is never touched.COMPILER_VERSIONbin/buildregenerates the committedsrc/Manticore/Version.phpfrom it;tools/check_version.sh(CI jobversion-source) and the release workflow enforce it. A release now means: editCOMPILER_VERSION+ docs, runbin/build, commit both.Main.phplost ~1100 lines. OneCli\Commands\*Commandclass per command, options declared viaCli\Option,--helpgenerated.Behaviour changes to be aware of
<command>: <error>(exit code still 64).-h/--helpprint help on every command;version --anythingnow exits 64 (it used to ignore its arguments);split-irarguments that start with-are rejected.install.sh: aSHA256SUMSfile with no entry for the tarball used to be accepted silently; strict mode (used byupgrade) now aborts. The plain installer's behaviour is unchanged.--quietsilences progress and timings only; analyzer advisories and errors stay.never>NO_COLORnon-empty >TERM=dumb>always> terminal, soNO_COLORwins over--color=always.How it was built and checked
Each step was implemented by a fresh agent and reviewed twice (per task, then per branch), with a golden test (
tests/cli/run.sh) pinning command behaviour before the restructure and offline mock-release tests (tools/install_smoke.sh, no network) forupgrade/version --check. The progress tests were mutation-checked: they fail whenProgress::clear()or the stats fallback is removed.Checked on macOS arm64 against the merged tree:
bin/build(twice, self-host),analyze src --only undefined.,parse.error,bash tests/cli/run.sh,bash tools/install_smoke.sh,bash tools/check_version.sh.Not run: the full AOT suite,
tools/difftest.sh, the Linux gate.bootstrap-from-pinin CI is the proof that the pinned release still builds this tree.Notes for reviewers
origin/mainwas merged in (7f2be542, Compile and serve a Symfony app natively: ownership/inference fixes, leak fixes, reflection and dispatch gaps #165): clean. Three golden checksums intests/cli/behaviour.txt(dump-mir,dump-llvm-mir,dump-llvm) were re-baselined; a pristine build oforigin/mainproduces the same values, so this is upstream codegen drift, not this PR.clang n/N; with progress off the original command strings are byte-identical. Known limitation: Ctrl-C of a progress-on split build can leave clang jobs running until they finish by themselves (no portablesetsidon macOS). Documented in the code.completionsdo not offer--helpon thecompletionscommand itself; Apple clang 14 (= LLVM 15) is reported as too old bydoctor;doctor's compile check assumes the binary file is namedmanticore; no tests fordoctor's update-check branches.cli-restructure,upgrade,cli-doctor,compiler-version,cli-progress) in order; squash-merge is fine.