Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocq CLI #19927

Merged
merged 34 commits into from
Dec 18, 2024
Merged

Rocq CLI #19927

merged 34 commits into from
Dec 18, 2024

Conversation

SkySkimmer
Copy link
Contributor

@SkySkimmer SkySkimmer commented Dec 12, 2024

Replace #19764 to drop the history of pushes in the github interface

summary:

| size in master | current         | how to call in rocq 9                      |
|----------------+-----------------+--------------------------------------------|
| 29M            | coqc            | rocq compile + rocq c                      |
| 43M            | coqc.byte       | delete? only exists for debugger AFAICT,   |
|                |                 | it can call the worker directly            |
| 12M            | coqchk          | rocq check + rocqchk                       |
| 4.8M           | coqdep          | rocq dep                                   |
| 4.5M           | coqdoc          | rocq doc                                   |
| 12M            | coqnative       | rocq native-precompile                     |
| 2.6M           | coqpp           | rocq preprocess-mlg + rocq pp-mlg          |
| 29M            | coqtop          | rocq top + rocq repl                       |
| 67M            | coqtop.byte     | rocq top-with-drop + rocq repl-with-drop   |
|                |                 | (only exists for Drop and debugger AFAICT) |
| 1.9M           | coqwc           | rocq wc                                    |
| 2.8M           | coqworkmgr      | rocq workmgr                               |
| 2.2M           | coq-tex         | rocq tex                                   |
| 4.5M           | coq_makefile    | rocq makefile                              |
| 4.4M           | votour          | rocq votour + votour                       |
| 3.5M           | coqtimelog2html | rocq timelog2html                          |
| 29M            | coqworker.opt   | tool only (findlib rocq-core/coqworker),   |
|                |                 | also gets byte version for debugger        |
| 4.1M           | csdpcert        | unchanged                                  |
| 2.8M           | ocamllibdep     | unchanged                                  |

plan for a followup PR

| 13M | coqide         | standalone rocqide                            |
| 43M | coqidetop.byte | delete                                        |
| 30M | coqidetop.opt  | tool only (findlib rocqide-server/rocqidetop) |

Under the hood, the smaller subcommands are statically linked in rocq, and compile/repl/repl-with-drop/native-precompile use separate workers.
This mostly works out to anything needing the kernel being split to a separate executable.

rocqchk and votour can be accessed both through rocq (rocq check and rocq votour respectively) and as separate executables (rocq just calls the separate exe).
For rocqchk this is particularly meaningful since it means we don't need to inspect rocq (including all the subcommands statically linked in) to trust it.
For votour it's mostly because the executable name doesn't conflict with rocq. We could move it to a private exe called through rocq votour or keep it public and drop the rocq votour subcommand if we wanted.

rocq is in package rocq-runtime. coq-core still exists and contains compat binaries coqc etc (the compat binaries use the rocq-runtime worker if there is one).

Todo in followup PRs:

  • coqide -> rocqide
  • man page for rocq
  • get the stdlib to not depend on the coq-core compat package
  • rename env variables and rocq makefile variables (COQBIN COQLIB etc), BTW note that in this PR COQCORELIB should point to the rocq-runtime installation not the coq-core installation despite the variable's name.

Overlays:

Executable `rocq` can be called as `rocq compile args` (also `rocq c
args`) and will in turn call `coqworker --kind=compile
args`. (coqworker will be renamed later)

coqc has also been modified to call coqworker.

The design where `rocq` calls the worker executable instead of being
itself the worker executable is so that `rocq check` can work without
involving the main worker code.

We could also consider not having `rocq` handle `rocqchk` ie keeping
it completely separate.

TODO:

- make rocq handle coqtop mode
- make coqtop use the worker
- make rocq handle coqnative mode
- make coqnative use the worker(?)
- make rocq handle coqchk mode(?)
- make rocq handle misc modes (makefile, dep, doc, maybe tex, workmgr, votour?)
- make rocq handle coqidetop mode(?)
- make coqidetop use the worker(?) this would mean the worker depends
  on the xml protocol
- make rocq handle coqide mode(?)

Issues to be solved:

- (if coqtop.byte is to use the worker): figure out how to support
  coqtop.byte's extensions (dependency on coq-core.dev for printers,
  compiler-libs, findlib.top) without impacting worker.byte in non-coqtop
  modes
…ore`

Not sure if `chdir %{project_root}` is correct or if it should be
`%{workspace_root}` (this only matters for error messages).
doc/sphinx/language/cic.rst Outdated Show resolved Hide resolved
doc/sphinx/language/core/basic.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
doc/sphinx/practical-tools/coq-commands.rst Outdated Show resolved Hide resolved
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Dec 13, 2024
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Dec 13, 2024
@coqbot-app coqbot-app bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Dec 13, 2024
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Dec 13, 2024
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Dec 13, 2024
@SkySkimmer SkySkimmer added the request: full CI Use this label when you want your next push to trigger a full CI. label Dec 13, 2024
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Dec 13, 2024
ejgallego added a commit to SkySkimmer/coq-lsp that referenced this pull request Dec 13, 2024
@ppedrot ppedrot self-assigned this Dec 18, 2024
Copy link
Member

@ppedrot ppedrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a superficial review and haven't seen anything suspect. Since we agreed to merge this in its current state yesterday, I think we should go forward.

@ppedrot
Copy link
Member

ppedrot commented Dec 18, 2024

@coqbot merge now

@coqbot-app coqbot-app bot merged commit ccaa8d9 into coq:master Dec 18, 2024
6 of 8 checks passed
Copy link
Contributor

coqbot-app bot commented Dec 18, 2024

@ppedrot: Please take care of the following overlays:

  • 19764-SkySkimmer-rocq-cli.sh

SkySkimmer added a commit to ejgallego/coq-lsp that referenced this pull request Dec 18, 2024
Adapt to coq/coq#19927 (coq-core renamed to rocq-runtime)
SkySkimmer added a commit to coq-community/coq-dpdgraph that referenced this pull request Dec 18, 2024
Adapt to coq/coq#19927 (coq-core renamed to rocq-runtime)
@SkySkimmer SkySkimmer deleted the rocq-cli branch December 18, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New user-facing feature request or implementation. kind: infrastructure CI, build tools, development tools. kind: redesign The same functionality is being re-implemented in a different way. priority: blocker The next release should be delayed if this is not fixed.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants