lean4-htt/tests/pkg/setup
Mac Malone dd64678f07
feat: server support for new module setup (#8699)
This PR adds support to the server for the new module setup process by
changing how `lake setup-file` is used.

In the new server setup, `lake setup-file` is invoked with the file name
of the edited module passed as a CLI argument and with the parsed header
passed to standard input in JSON form. Standard input is used to avoid
potentially exceeding the CLI length limits on Windows. Lake will build
the module's imports along with any other dependencies and then return
the module's workspace configuration via JSON (now in the form of
`ModuleSetup`). The server then post-processes this configuration a bit
and returns it back to the Lean language processor.

The server's header is currently only fully respected by Lake for
external modules (files that are not part of any workspace library). For
workspace modules, the saved module header is currently used to build
imports (as has been done since #7909). A follow-up Lake PR will align
both cases to follow the server's header.

Lean search paths (e.g., `LEAN_PATH`, `LEAN_SRC_PATH`) are no longer
negotiated between the server and Lake. These environment variables are
already configured during sever setup by `lake serve` and do not change
on a per-file basis. Lake can also pre-resolve the `.olean` files of
imports via the `importArts` field of `ModuleSetup`, limiting the
potential utility of communicating `LEAN_PATH`.
2025-06-23 18:00:14 +00:00
..
clean.sh feat: lean --setup (#8024) 2025-05-03 23:57:37 +00:00
Dep.lean feat: lean --setup (#8024) 2025-05-03 23:57:37 +00:00
setup.json feat: server support for new module setup (#8699) 2025-06-23 18:00:14 +00:00
Test.lean feat: lean --setup (#8024) 2025-05-03 23:57:37 +00:00
test.sh feat: lean --setup (#8024) 2025-05-03 23:57:37 +00:00