-
Notifications
You must be signed in to change notification settings - Fork 395
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
feat: support Lake for building Lean core oleans #3886
Conversation
Add lakefile.toml in the right places so that working interactively on the Lean repository will have the same features WRT the language server as ordinary Lean projects. This also requires adding Lake to stage0.
(doesn't work yet, but we ran out of time pair programming)
The lakefile.toml will have to be generated by CMake to correctly heed LEAN_MAKE_OPTS/LEANC_OPTS/... |
@Kha Right now, this is just for interactive editing, not for building the binaries or shared libraries, so we do not need those options at the moment. |
Okay, I would not have expected that to be a desirable intermediate state if it forces me to redo the build in cmake whenever I want to actually run and test Lean. It also begs the question of how to opt into the current workflow when the lakefile.toml always exists. |
While it does require an additional run of CMake to run/test Lean, it does not require redoing work, as Make can successfully make use of elaboration results (as there are no relevant |
I am flummoxed by the linker errors in the CMake build of stage0 Lake. It builds successfully on my machine. |
Mathlib CI status (docs):
|
I added a It wasn't clear to me why the additional lakefile.tomls in the root and in tests/ are necessary, so I've removed them for now. |
They are necessary for the multiple roots of the VS Code workspace. Each root needs to have a lakefile for the server to make use of Lake at that root. Without them, Lake will not be used for Lean files in the root (outside |
Why is that relevant? tests/ is not a Lake project, even running the full build from src/ in it does not help as it will not actually build the executables. I'd rather have it not to work at all than stop half-way to a successful build. |
It is not for building (e.g., the executables). It is for interactively editing the tests using the modules built from |
!bench |
Here are the benchmark results for commit a25f4b4. |
@Kha What are you attempting to benchmark? Without the stage0 update, this PR has no practical effect. |
@tydeu The update-stage0 size increase but I noticed we don't actually have a benchmark for that :) . Do you know how much it was? |
This is from a
pairtriple programming session with @tydeu and @mhuisi.If stage 1 is built with
-DUSE_LAKE=ON
, the CMake run will generatelakefile.toml
files for the root,src
, andtests
. These Lake configuration files can then be used to build core oleans. While they do not yet allow Lake to be used to build the Lean binaries. they do allow Lake to be used for working interactively with the Lean source. In our preliminary experiments, this allowed updates toInit.Data.Nat
to be noticed automatically when reloading downstream files, rather than requiring a full manual compiler rebuild. This will make it easier to work on the system.As part of this change, Lake is added to stage 0. This allows Lake to function in
src
, which uses the stage 0 toolchain.