Lake configuration file
lakefile.toml, the .toml configuration file for Lake, the package manager of the Lean programming language and theorem prover
| Type | object |
|---|---|
| File match |
lakefile.toml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/lake-configuration-file/latest.json |
| Source | https://raw.githubusercontent.com/leanprover/lean4/refs/heads/master/src/lake/schemas/lakefile-toml-schema.json |
Validate with Lintel
npx @lintel/lintel check
Configuration file for Lean's build system, Lake
All of
Definitions
A set_option string / boolean / natural number configuration value.
The mode in which the modules should be built.
Additional set_option options to pass to both the Lean language server launched by lake serve and to lean when compiling a module's Lean source files.
{}
Additional set_option options to pass only to the Lean language server (i.e., lean --server) launched by lake serve.
{}
Additional command-line arguments to pass to lean when compiling a module's Lean source files.
[]
Additional command-line arguments to pass to lean when compiling a module's Lean source files.
Unlike moreLeanArgs, these arguments do not affect the trace of the build result, so they can be changed without triggering a rebuild.
They come before moreLeanArgs.
[]
Additional command-line arguments to pass to leanc when compiling a module's C source files generated by lean.
Lake already passes some flags based on the buildType, but you can change this by, for example, adding -O0 and -UNDEBUG.
[]
Additional command-line arguments to pass to leanc when compiling a module's C source files generated by lean.
Unlike moreLeancArgs, these arguments do not affect the trace of the build result, so they can be changed without triggering a rebuild.
They come before moreLeancArgs.
[]
Build key identifiers of additional target objects to use when linking (both static and shared).
Format: <target>[:<facet>]*, where:
<target>is of the form@<package>,@<package>/<targetName>, +or@/+ `, <package>may be empty to reference the default package,<facet>is the name of a target facet.
Build key identifiers come after the paths of native facets.
[]
Build key identifiers of additional target libraries to pass to leanc when linking (e.g., for shared libraries or binary executables).
Format: <target>[:<facet>]*, where:
<target>is of the form@<package>,@<package>/<targetName>, +or@/+ `, <package>may be empty to reference the default package,<facet>is the name of a target facet.
These come after the paths of other link objects.
[]
Additional command-line arguments to pass to leanc when linking (e.g., for shared libraries or binary executables). These come after the paths of the linked objects.
[]
Additional command-line arguments to pass to leanc when linking (e.g., for shared libraries or binary executables). These come after the paths of the linked objects.
Unlike moreLinkArgs, these arguments do not affect the trace of the build result, so they can be changed without triggering a rebuild.
They come before moreLinkArgs.
[]
Compiler backend that modules should be built with (C or LLVM). default corresponds to C.
Asserts whether Lake should assume Lean modules are platform-independent.
-
If
false, Lake will addSystem.Platform.targetto the module traces within the code unit (e.g., package or library). This will force Lean code to be re-elaborated on different platforms. -
If
true, Lake will exclude platform-dependent elements (e.g., precompiled modules, external libraries) from a module's trace, preventing re-elaboration on different platforms. Note that this will not effect modules outside the code unit in question. For example, a platform-independent package which depends on a platform-dependent library will still be platform-dependent. -
If not set, Lake will construct traces as natural. That is, it will include platform-dependent artifacts in the trace if they module depends on them, but otherwise not force modules to be platform-dependent.
There is no check for correctness here, so a configuration can lie and Lake will not catch it.
Build key identifiers of dynamic library targets to load during the elaboration of a module (via lean --load-dynlib).
Format: <target>[:<facet>]*, where:
<target>is of the form@<package>,@<package>/<targetName>, +or@/+ `, <package>may be empty to reference the default package,<facet>is the name of a target facet.
[]
Build key identifiers of Lean plugin targets to load during the elaboration of a module (via lean --plugin).
Format: <target>[:<facet>]*, where:
<target>is of the form@<package>,@<package>/<targetName>, +or@/+ `, <package>may be empty to reference the default package,<facet>is the name of a target facet.
[]
The name of the input file.
The path to the input file (relative to the package root).
Defaults to the name of the target.
Whether this is a text file. If so, Lake normalize line endings for its trace. This avoids rebuilds across platforms with different line endings.
The name of the input directory.
The path to the input directory (relative to the package root).
Defaults to the name of the target.
Whether the directory is composed of text files. If so, Lake normalize line endings for their traces. This avoids rebuilds across platforms with different line endings.
Includes only the files from the directory whose paths satisfy this pattern.
Format: Either "*", or a recursive object with one of the following properties at every layer:
path: String pattern matching the path.extension: String pattern matching the extension of the file in the path.fileName: String pattern matching the name of the file in the path.not: Negate a path pattern.any: Match any of an array of path patterns.all: Match all of an array of path patterns.
String patterns have the following format: Either "*", an array of all strings that are a match, or a recursive object with one of the following properties at every layer:
startsWith: Denotes a prefix string of all strings that are a match.endsWith: Denotes a suffix string of all strings that are a match.not: Negate a string pattern.any: Match any of an array of string patterns.all: Match all of an array of string patterns.
The package name of the dependency. This name must match the one declared in its configuration file, as that name is used to index its target data types. For this reason, the package name must also be unique across packages in the dependency graph.
A dependency on the local filesystem, specified by its path.
A dependency in a Git repository, specified by its URL.
The subdirectory of a Git repository (as specified by git) that contains the package's source code.
For Git dependencies, this field specifies the Git revision, which may be a branch name, a tag name, or a specific hash.
An additional qualifier used to distinguish packages of the same name in a Lake registry. On Reservoir, this is the package owner.