Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR introduces a local artifact cache for Lake. When enabled, Lake will shared build artifacts (built files) across different instances of the same package using an input- and content-addressed cache. To enable support for the local cache, packages must set `enableArtifactCache := true` in their package configuration. The reason for this is twofold. This feature is new and experimental, so it should be opt-in. Also, some packages may need to disable it as the cache entails that artifacts are no longer necessarily available within the build directory, which can break custom build scripts. The cache location is determined by the system configuration. Lake's first preference is to store it under the Lean toolchain in a `lake/cache` directory. If Elan is not available, Lake will store it in common system location (e.g., `$XDG_CACHE_HOME/lake`, or `~/.cache/lake`). On an exotic system where neither of these exist, the cache will be disabled. Users can override this location through the `LAKE_CACHE_DIR` environment variable. If set to empty, caching will be disabled. The cache is both input and content-addressed. Mappings from input hash to output content hash(es) are stored in a per-package JSON Lines file (e.g., `<cache-dir>/inputs/<pkg-name>.jsonl`). Thus, mappings are shared across different instances of a package, but not between packages. The output content hashes are also now stored in trace files in a new `outputs` field. The value of this field can be either a single hash or an object of multiple content hashes for targets which produce multiple artifacts (e.g., Lean module builds). Separately, artifacts are stored in a single flat content-addressed cache (e.g., `<cache-dir>/artifacts/<hash>.art`. Artifacts are therefore shared across all cache-enabled packages. Module `*.olean` and and `*.ilean` artifacts are cached. However, each package will still copy the files to their build directory, as Lean and the server currently expect them to be at a specific path. This will be changed for `*.olean` files when the performance issues with pre-resolving modules in Lake for `lean --setup` are solved. |
||
|---|---|---|
| .github | ||
| doc | ||
| images | ||
| nix | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| lean.code-workspace | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Setting Up Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.