Documentation

Lake.Build.Info

Build Info #

This module defines the Lake build info type and related utilities. Build info is what is the data passed to a Lake build function to facilitate the build.

inductive Lake.BuildInfo :

The type of Lake's build info.

Instances For

Build Info & Keys #

Build Key Helper Constructors #

@[reducible, inline]
Equations
@[reducible, inline, deprecated Lake.Module.key (since := "2025-03-28")]
Equations
@[reducible, inline, deprecated Lake.BuildKey.facet (since := "2025-03-28")]
Equations
@[reducible, inline]
Equations
@[reducible, inline, deprecated Lake.Package.key (since := "2025-03-28")]
Equations
@[reducible, inline, deprecated Lake.BuildKey.facet (since := "2025-03-28")]
Equations
@[reducible, inline]
abbrev Lake.Package.targetKey (target : Lean.Name) (self : Package) :
Equations
@[reducible, inline, deprecated Lake.Package.targetKey (since := "2025-03-28")]
Equations
@[reducible, inline]
abbrev Lake.ConfigTarget.key {kind : Lean.Name} (self : ConfigTarget kind) :
Equations
@[reducible, inline, deprecated Lake.ConfigTarget.key (since := "2025-03-28")]
Equations
@[reducible, inline, deprecated Lake.BuildKey.facet (since := "2025-03-28")]
Equations

Build Info to Key #

Instances for deducing data types of BuildInfo keys #

Build Info & Facets #

Complex Builtin Facet Declarations #

Additional builtin facets missing from Build.Facets. These are defined here because they need configuration definitions (e.g., Module), whereas the facets there are needed by the configuration definitions.

@[reducible]

The direct local imports of the Lean module.

Equations
@[simp]
@[reducible]

The transitive local imports of the Lean module.

Equations
@[reducible]

The transitive local imports of the Lean module.

Equations
@[simp]
@[reducible]

Shared library for --load-dynlib.

Equations
@[simp]
@[reducible]

A Lean library's Lean modules.

Equations
@[reducible]

The package's array of dependencies.

Equations
@[reducible]

The package's complete array of transitive dependencies.

Equations

Facet Build Info Helper Constructors #

Definitions to easily construct BuildInfo values for module, package, and target facets.

Module Infos #

@[reducible, inline]
abbrev Lake.Module.facetCore (facet : Lean.Name) (self : Module) :

Build info for applying the specified facet to the module. It is the user's obiligation to ensure the facet in question is a module facet.

Equations
@[reducible, inline]
abbrev Lake.Module.facet (facet : Lean.Name) (self : Module) :

Build info for a module facet.

Equations
@[reducible, inline, deprecated Lake.Module.facetCore (since := "2025-03-04")]
Equations
@[reducible, inline]

The module's processed Lean source file. Combines tracing the file with parsing its header.

Equations
@[reducible, inline]

The module's Lean source file.

Equations
@[reducible, inline]

The parsed module header of the module's source file.

Equations
@[reducible, inline]

The direct local imports of the Lean module.

Equations
@[reducible, inline]

The transitive local imports of the Lean module.

Equations
@[reducible, inline]

The transitive local imports of the Lean module.

Equations
@[reducible, inline]

The facet which builds all of a module's dependencies (i.e., transitive local imports and --load-dynlib shared libraries). Returns the list of shared libraries to load along with their search path.

Equations
@[reducible, inline]

The facet which builds all of a module's dependencies (i.e., transitive local imports and --load-dynlib shared libraries). Returns the list of shared libraries to load along with their search path.

Equations
@[reducible, inline]

The core build facet of a Lean file. Elaborates the Lean file via lean and produces all the Lean artifacts of the module (i.e., olean, ilean, c). Its trace just includes its dependencies.

Equations
@[reducible, inline]

The olean file produced by lean.

Equations
@[reducible, inline]

The olean.server file produced by lean (with the module system enabled).

Equations
@[reducible, inline]

The olean.private file produced by lean (with the module system enabled).

Equations
@[reducible, inline]

The ilean file produced by lean.

Equations
@[reducible, inline]
abbrev Lake.Module.c (self : Module) :

The C file built from the Lean file via lean.

Equations
@[reducible, inline]

The C file built from the Lean file via lean.

Equations
@[reducible, inline]
abbrev Lake.Module.o (self : Module) :

The object file built from c/bc. On Windows with the C backend, no Lean symbols are exported. On every other configuration, symbols are exported.

Equations
@[reducible, inline]

The object file built from c/bc (with Lean symbols exported).

Equations
@[reducible, inline]

The object file built from c/bc (without Lean symbols exported).

Equations
@[reducible, inline]

The object file .c.o built from c. On Windows, this is c.o.noexport, on other systems it is c.o.export).

Equations
@[reducible, inline]

The object file .c.o.export built from c (with -DLEAN_EXPORTING).

Equations
@[reducible, inline]

The object file .c.o.noexport built from c (without -DLEAN_EXPORTING).

Equations
@[reducible, inline]

The object file .bc.o built from bc.

Equations
@[reducible, inline]

Shared library for --load-dynlib.

Equations

Package Infos #

@[reducible, inline]
abbrev Lake.Package.target (target : Lean.Name) (self : Package) :

Build info for a package target (e.g., a library, executable, or custom target).

Equations
@[reducible, inline]
Equations
@[reducible, inline]
abbrev Lake.Package.facet (facet : Lean.Name) (self : Package) :

Build info for a package facet.

Equations
@[reducible, inline, deprecated Lake.Package.facetCore (since := "2025-03-04")]
Equations
@[reducible, inline]

A package's cached build archive (e.g., from Reservoir or GitHub). Will cause the whole build to fail if the archive cannot be fetched.

Equations
@[reducible, inline]

A package's optional cached build archive (e.g., from Reservoir or GitHub). Will NOT cause the whole build to fail if the archive cannot be fetched.

Equations
@[reducible, inline]

A package's Reservoir build archive from Reservoir. Will cause the whole build to fail if the barrel cannot be fetched.

Equations
@[reducible, inline]

A package's optional build archive from Reservoir. Will NOT cause the whole build to fail if the barrel cannot be fetched.

Equations
@[reducible, inline]

A package's build archive from a GitHub release. Will cause the whole build to fail if the release cannot be fetched.

Equations
@[reducible, inline]

A package's optional build archive from a GitHub release. Will NOT cause the whole build to fail if the release cannot be fetched.

Equations
@[reducible, inline]

A package's extraDepTargets mixed with its transitive dependencies'.

Equations
@[reducible, inline]

The package's array of dependencies.

Equations
@[reducible, inline]

The package's complete array of transitive dependencies.

Equations

Lean Library Infos #

@[reducible, inline]
abbrev Lake.LeanLib.facet (facet : Lean.Name) (self : LeanLib) :

Build info for a facet of a Lean library.

Equations
@[reducible, inline, deprecated Lake.LeanLib.facetCore (since := "2025-03-04")]
Equations
@[reducible, inline]

A Lean library's Lean modules.

Equations
@[reducible, inline]

A Lean library's Lean artifacts (i.e., olean, ilean, c).

Equations
@[reducible, inline]

A Lean library's static artifact.

Equations
@[reducible, inline]

A Lean library's static artifact (with exported symbols).

Static libraries with explicit exports are built as thin libraries. Such libraries are usually used as part of the local build process of some shared artifact and not publicly distributed. Standard static libraries are much better for distribution.

Equations
@[reducible, inline]

A Lean library's shared artifact.

Equations
@[reducible, inline]

A Lean library's extraDepTargets mixed with its package's.

Equations

Lean Executable Infos #

@[reducible, inline]

Build info of the Lean executable.

Equations
@[reducible, inline, deprecated Lake.LeanExe.exe (since := "2025-03-04")]
Equations

External Library Infos #

@[reducible, inline]

Build info of the external library's static binary.

Equations
@[reducible, inline, deprecated Lake.ExternLib.static (since := "2025-03-04")]
Equations
@[reducible, inline]

Build info of the external library's shared binary.

Equations
@[reducible, inline, deprecated Lake.ExternLib.shared (since := "2025-03-04")]
Equations
@[reducible, inline]

Build info of the external library's dynlib.

Equations
@[reducible, inline, deprecated Lake.ExternLib.dynlib (since := "2025-03-04")]
Equations

Input File & Directory Infos #

@[reducible, inline]

Build info of the input file's default facet.

Equations
@[reducible, inline]

Build info of the input directory's default facet.

Equations