This is from a ~~pair~~triple programming session with @tydeu and
@mhuisi.
If stage 1 is built with `-DUSE_LAKE=ON`, the CMake run will generate
`lakefile.toml` files for the root, `src`, and `tests`. 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 to `Init.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.
---------
Co-authored-by: Mac Malone <tydeu@hatpress.net>
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
@Kha
I was having several errors of the form
```
224: /Users/leonardodemoura/projects/lean4/build/release/stage0.5/bin/../include/lean/runtime/exception.h:23:13: error: exception specification of overriding function is more lax than base version
224: virtual ~throwable() noexcept;
224: ^
224: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:102:13: note: overridden virtual function is here
224: virtual ~exception() _NOEXCEPT;
224: ^
224: In file included from myfuns.cpp:1:
```
As far as I can tell, the error ocurrs because my compiler uses an old
C++ standard if the option `-std` is not used.
I guess `-std=c++11` would also works, but I decided to use the same
standard we used to compile Lean.
@dselsam @kha
I did not have to create a new shared library.
The main limitation of this approach is that the new `extern`
functions are only available in compile code. That is, we cannot use
them with `#eval`.