Commit graph

205 commits

Author SHA1 Message Date
Sebastian Ullrich
582877d2d3
feat: environment extension data can be split into .olean.server (#7914)
This PR adds a function hook `PersistentEnvExtension.saveEntriesFn` that
can be used to store server-only metadata such as position information
and docstrings that should not affect (re)builds.
2025-04-11 13:06:19 +00:00
Sebastian Ullrich
69536808ca
feat: read/writeModuleDataParts API for serialization with cross-file sharing (#7854)
This PR introduces fundamental API to distribute module data across
multiple files in preparation for the module system.
2025-04-10 13:32:24 +00:00
Eric Wieser
0d7e126a01
chore: re-land "perf: use C23's free_sized when available" (#6844)
Unreverts #6598

I'll combine #6825 into this before merging.
2025-02-04 12:43:56 +00:00
Sebastian Ullrich
a35bf7ee4c
chore: revert "perf: use C23's free_sized when available" (#6841)
Reverts leanprover/lean4#6598, which broke Windows CI
2025-01-29 09:11:23 +00:00
Eric Wieser
6aa6407af1
perf: use C23's free_sized when available (#6598)
See https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2699.htm for an
explanation of this feature.

---------

Co-authored-by: Chris Kennelly <ckennelly@google.com>
2025-01-28 10:17:15 +00:00
Sebastian Ullrich
3770808b58
feat: split Lean.Kernel.Environment from Lean.Environment (#5145)
This PR splits the environment used by the kernel from that used by the
elaborator, providing the foundation for tracking of asynchronously
elaborated declarations, which will exist as a concept only in the
latter.

Minor changes:
* kernel diagnostics are moved from an environment extension to a direct
environment as they are the only extension used directly by the kernel
* `initQuot` is moved from an environment header field to a direct
environment as it is the only header field used by the kernel; this also
makes the remaining header immutable after import
2025-01-18 18:42:57 +00:00
Sebastian Ullrich
345ecd20c9
chore: tag prerelease builds with -pre (#5943) 2024-11-06 14:47:52 +00:00
Sebastian Ullrich
fd08c92060 chore: update src/library/module.cpp after update stage0
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Update src/library/module.cpp

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
2024-11-01 22:48:49 +11:00
Sebastian Ullrich
c723ae7f97 chore: CI: build 64-bit platforms consistently with GMP
fix

arm64?

try different fix

`uses_gmp` .olean bit, bump .olean version

add lean_version

make sure to use cache gmp on x86 Linux
2024-11-01 22:48:49 +11:00
Sebastian Ullrich
79251f5fa2
feat: embed and check githash in .olean (#2766)
This is an additional safety net on top of #2749: it protects users that
circumvent the build system (e.g. with `lake env`) as well as obviates
the need for TOCTOU-like race condition checks in the build system.

The check is activated by `CHECK_OLEAN_VERSION=ON`, which now defaults
to `OFF` as the sensible default for local development. When activated,
`USE_GITHASH=ON` is also force-enabled for stage 0 in order to make sure
that stage 1 can load its own core library.
2023-11-27 10:24:43 +00:00
Alexander Bentkamp
7dc1618ca5
feat: Web Assembly Build (#2599)
Co-authored-by: Rujia Liu <rujialiu@user.noreply.github.com>
2023-10-04 09:04:20 +02:00
Sebastian Ullrich
636afc654a fix: avoid mapping .oleans in the way of the stack 2022-12-13 22:11:41 +01:00
Sebastian Ullrich
b13d3e6ca5 fix: dllexport functions not already annotated in header 2021-09-20 18:41:46 +02:00
Leonardo de Moura
c8406a301d chore: reduce src/include/lean 2021-09-07 08:24:54 -07:00
Leonardo de Moura
14b611af96 refactor: move buffer.h and *_ref.h files to runtime 2021-08-16 15:39:38 -07:00
Sebastian Ullrich
4b87e69ff5 fix: deletion on Windows for real 2021-08-04 16:40:57 +02:00
Sebastian Ullrich
7e2cf59aaf chore: deleting open .olean files on Windows 2021-08-04 16:40:57 +02:00
Sebastian Ullrich
3c91c9e874 feat: try memory-mapping .olean files on Windows 2021-08-04 16:40:57 +02:00
Sebastian Ullrich
0aaab9e024 chore: remove file_lock.h 2021-08-04 16:40:57 +02:00
Sebastian Ullrich
e4ef665c54 feat: atomically (re-)create .olean files 2021-08-04 16:40:57 +02:00
Sebastian Ullrich
4766ee0b5e feat: try to mmap() .olean files on Linux & macOS 2021-08-04 16:40:57 +02:00
Sebastian Ullrich
a00674fcba feat: compute .olean base address from module name 2021-08-04 16:40:57 +02:00
Leonardo de Moura
bad6233389 chore: remove legacy support for modification objects 2020-10-26 08:10:51 -07:00
Leonardo de Moura
e54a207986 refactor: provide Options to lean_eval_const
add `ImportM` monad for `addImportedFn`

cc @Kha
2020-10-19 10:21:38 -07:00
Sebastian Ullrich
2d501ea980 chore: temporarily ignore regions leaks until we fix the server design 2020-08-31 06:50:01 -07:00
Sebastian Ullrich
c88784ef9d refactor: consistent io_result_mk* naming
/cc @leodemoura
2020-08-31 11:08:57 +02:00
Sebastian Ullrich
c38f4fe837 feat: unsafe functions for freeing compacted regions 2020-07-10 07:42:26 -07:00
Sebastian Ullrich
ebd72d200f fix: alloc/free mismatch detected by asan 2020-07-10 07:42:26 -07:00
Leonardo de Moura
7c76a19885 chore: fix includes 2020-05-22 14:17:25 -07:00
Leonardo de Moura
8bdca35282 chore: use #include <lean/runtime/...> for runtime .h files 2020-05-18 11:30:07 -07:00
Sebastian Ullrich
f6973be5e3 refactor: replace C++ import parser with Lean one
imports are now completely opaque to C++
2019-11-21 15:52:01 +01:00
Sebastian Ullrich
3dcd4febd9 feat: make LEAN_PATH a mapping from package names to root dirs, remove C++ impl 2019-11-20 16:39:53 +01:00
Leonardo de Moura
30571f12d4 chore: adjust runtime to new EState 2019-10-21 17:05:16 -07:00
Leonardo de Moura
dcd15f3424 refactor(runtime): C backend 2019-08-24 07:40:38 -07:00
Leonardo de Moura
a5c97e21bf chore(library/init/lean): export as C functions 2019-08-16 20:15:30 -07:00
Sebastian Ullrich
d09c512784 chore(library/module): lsan: ignore module objects 2019-07-30 17:52:43 -07:00
Leonardo de Moura
ff6b868440 chore(library/module): remove dead code 2019-07-27 19:03:07 -07:00
Sebastian Ullrich
7b18bc94fd fix(library/module): make sure header length preserves alignment 2019-07-26 12:39:35 -07:00
Sebastian Ullrich
53a26b94ff chore(util/lean_path): remove leanpkg.path support
Because Lean 4 will not compile dependencies by itself, there is not much of a
point in it resolving them by itself either. The build tool that ensures that
all dependencies have been built should call `lean` with the `LEAN_PATH`
environment variable set accordingly.
2019-07-25 17:46:40 -07:00
Leonardo de Moura
cf8daf4b24 feat(library/init/lean/elaborator): process header
TODO:
- improve/fix `setSearchPath`
- add `IO.getEnv`
- add support for relative imports at `absolutizeModuleName`
2019-07-24 07:37:33 -07:00
Leonardo de Moura
fd29b7e45d feat(util/io): add helper functions for consuming IO results in C++ 2019-06-05 13:53:38 -07:00
Leonardo de Moura
aa138fe686 chore(*): get_obj_arg => to_obj_arg 2019-05-16 14:42:02 -07:00
Leonardo de Moura
5df0b05cc7 chore(library/init/lean/environment): remove get_modifications_core 2019-05-14 11:26:04 -07:00
Leonardo de Moura
7696c28fe1 feat(library/module): module manager in Lean is alive 2019-05-14 11:10:49 -07:00
Leonardo de Moura
642c4c59bd feat(library/init/lean/environment): support for serializing/performing legacy modification objects 2019-05-14 10:08:31 -07:00
Leonardo de Moura
67d14705b0 chore(library/module): simplify write_module 2019-05-14 08:08:09 -07:00
Leonardo de Moura
427852d759 feat(library/init/lean/environment): add findOLean 2019-05-14 08:02:26 -07:00
Leonardo de Moura
e616def866 chore(library/module): remove dead declaration 2019-05-14 07:53:44 -07:00
Leonardo de Moura
22d2848d21 chore(library/module): store search_path in a global variable
Remark: I will use it to expose the following primitive in Lean
```
constant findOLean : Name -> IO String
```
2019-05-14 07:49:00 -07:00
Leonardo de Moura
1a610607b1 chore(library/module): remove old comment 2019-05-14 07:37:20 -07:00