Documentation

Lake.Config.Package

@[inline]

The default buildArchive configuration for a package with name.

Equations
Instances For

    PackageConfig #

    A Package's declarative configuration.

    • manifestFile : Option System.FilePath

      This field is deprecated.

      The path of a package's manifest file, which stores the exact versions of its resolved dependencies.

      Defaults to defaultManifestFile (i.e., lake-manifest.json).

    • extraDepTargets : Array Lean.Name

      An Array of target names to build whenever the package is used.

    • precompileModules : Bool

      Whether to compile each of the package's module into a native shared library that is loaded whenever the module is imported. This speeds up evaluation of metaprograms and enables the interpreter to run functions marked @[extern].

      Defaults to false.

    • moreGlobalServerArgs : Array String

      Additional arguments to pass to the Lean language server (i.e., lean --server) launched by lake serve, both for this package and also for any packages browsed from this one in the same session.

    • The directory containing the package's Lean source files. Defaults to the package's directory.

      (This will be passed to lean as the -R option.)

    • buildDir : System.FilePath

      The directory to which Lake should output the package's build results. Defaults to defaultBuildDir (i.e., .lake/build).

    • leanLibDir : System.FilePath

      The build subdirectory to which Lake should output the package's binary Lean libraries (e.g., .olean, .ilean files). Defaults to defaultLeanLibDir (i.e., lib).

    • nativeLibDir : System.FilePath

      The build subdirectory to which Lake should output the package's native libraries (e.g., .a, .so, .dll files). Defaults to defaultNativeLibDir (i.e., lib).

    • The build subdirectory to which Lake should output the package's binary executable. Defaults to defaultBinDir (i.e., bin).

    • The build subdirectory to which Lake should output the package's intermediary results (e.g., .c and .o files). Defaults to defaultIrDir (i.e., ir).

    • releaseRepo : Option String

      The URL of the GitHub repository to upload and download releases of this package. If none (the default), for downloads, Lake uses the URL the package was download from (if it is a dependency) and for uploads, uses gh's default.

    • buildArchive : Option String

      A custom name for the build archive for the GitHub cloud release. If none (the default), Lake defaults to {(pkg-)name}-{System.Platform.target}.tar.gz.

    • preferReleaseBuild : Bool

      Whether to prefer downloading a prebuilt release (from GitHub) rather than building this package from the source when this package is used as a dependency.

    • testDriver : String

      The name of the script, executable, or library by lake test when this package is the workspace root. To point to a definition in another package, use the syntax <pkg>/<def>.

      A script driver will be run by lake test with the arguments configured in testDriverArgs followed by any specified on the CLI (e.g., via lake lint -- <args>...). An executable driver will be built and then run like a script. A library will just be built.

    • testDriverArgs : Array String

      Arguments to pass to the package's test driver. These arguments will come before those passed on the command line via lake test -- <args>....

    • lintDriver : String

      The name of the script or executable used by lake lint when this package is the workspace root. To point to a definition in another package, use the syntax <pkg>/<def>.

      A script driver will be run by lake lint with the arguments configured in lintDriverArgs followed by any specified on the CLI (e.g., via lake lint -- <args>...). An executable driver will be built and then run like a script.

    • lintDriverArgs : Array String

      Arguments to pass to the package's linter. These arguments will come before those passed on the command line via lake lint -- <args>....

    • version : StdVer

      The package version. Versions have the form:

      v!"<major>.<minor>.<patch>[-<specialDescr>]"
      

      A version with a - suffix is considered a "prerelease".

      Lake suggest the following guidelines for incrementing versions:

      • Major version increment (e.g., v1.3.0 → v2.0.0) Indicates significant breaking changes in the package. Package users are not expected to update to the new version without manual intervention.

      • Minor version increment (e.g., v1.3.0 → v1.4.0) Denotes notable changes that are expected to be generally backwards compatible. Package users are expected to update to this version automatically and should be able to fix any breakages and/or warnings easily.

      • Patch version increment (e.g., v1.3.0 → v1.3.1) Reserved for bug fixes and small touchups. Package users are expected to update automatically and should not expect significant breakage, except in the edge case of users relying on the behavior of patched bugs.

      Note that backwards-incompatible changes may occur at any version increment. The is because the current nature of Lean (e.g., transitive imports, rich metaprogramming, reducibility in proofs), makes it infeasible to define a completely stable interface for a package. Instead, the different version levels indicate a change's intended significance and how difficult migration is expected to be.

      Versions of form the 0.x.x are considered development versions prior to first official release. Like prerelease, they are not expected to closely follow the above guidelines.

      Packages without a defined version default to 0.0.0.

    • versionTags : StrPat

      Git tags of this package's repository that should be treated as versions. Package indices (e.g., Reservoir) can make use of this information to determine the Git revisions corresponding to released versions.

      Defaults to tags that are "version-like". That is, start with a v followed by a digit.

    • description : String

      A short description for the package (e.g., for Reservoir).

    • keywords : Array String

      Custom keywords associated with the package. Reservoir can make use of a package's keywords to group related packages together and make it easier for users to discover them.

      Good keywords include the domain (e.g., math, software-verification, devtool), specific subtopics (e.g., topology, cryptology), and significant implementation details (e.g., dsl, ffi, cli). For instance, Lake's keywords could be devtool, cli, dsl, package-manager, and build-system.

    • homepage : String

      A URL to information about the package.

      Reservoir will already include a link to the package's GitHub repository (if the package is sourced from there). Thus, users are advised to specify something else for this (if anything).

    • license : String

      The package's license (if one). Should be a valid SPDX License Expression.

      Reservoir requires that packages uses an OSI-approved license to be included in its index, and currently only supports single identifier SPDX expressions. For, a list of OSI-approved SPDX license identifiers, see the SPDX LIcense List.

    • licenseFiles : Array System.FilePath

      Files containing licensing information for the package.

      These should be the license files that users are expected to include when distributing package sources, which may be more then one file for some licenses. For example, the Apache 2.0 license requires the reproduction of a NOTICE file along with the license (if such a file exists).

      Defaults to #["LICENSE"].

    • readmeFile : System.FilePath

      The path to the package's README.

      A README should be a Markdown file containing an overview of the package. Reservoir displays the rendered HTML of this file on a package's page. A nonstandard location can be used to provide a different README for Reservoir and GitHub.

      Defaults to README.md.

    • reservoir : Bool

      Whether Reservoir should include the package in its index. When set to false, Reservoir will not add the package to its index and will remove it if it was already there (when Reservoir is next updated).

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      @[reducible, inline]

      The package's name.

      Equations
      Instances For

        A package declaration from a configuration written in Lean.

        Instances For

          Package #

          structure Lake.Package :

          A Lake package -- its location plus its configuration.

          • name : Lean.Name

            The name of the package.

          • The path to the package's directory.

          • The path to the package's directory relative to the workspace.

          • config : PackageConfig self.name

            The package's user-defined configuration.

          • relConfigFile : System.FilePath

            The path to the package's configuration file (relative to dir).

          • relManifestFile : System.FilePath

            The path to the package's JSON manifest of remote dependencies (relative to dir).

          • scope : String

            The package's scope (e.g., in Reservoir).

          • remoteUrl : String

            The URL to this package's Git remote.

          • depConfigs : Array Dependency

            Dependency configurations for the package.

          • targetDecls : Array (PConfigDecl self.name)

            Target configurations in the order declared by the package.

          • targetDeclMap : DNameMap (NConfigDecl self.name)

            Name-declaration map of target configurations in the package.

          • defaultTargets : Array Lean.Name

            The names of the package's targets to build by default (i.e., on a bare lake build of the package).

          • Scripts for the package.

          • defaultScripts : Array Script

            The names of the package's scripts run by default (i.e., on a bare lake run of the package).

          • postUpdateHooks : Array (OpaquePostUpdateHook self.name)

            Post-lake update hooks for the package.

          • buildArchive : String

            The package's buildArchive/buildArchive? configuration.

          • testDriver : String

            The driver used for lake test when this package is the workspace root.

          • lintDriver : String

            The driver used for lake lint when this package is the workspace root.

          Instances For
            Equations
            @[reducible, inline]
            Equations
            Instances For
              @[reducible, inline]
              Equations
              Instances For
                Equations
                @[reducible, inline]
                abbrev Lake.PostUpdateFn (pkgName : Lean.Name) :

                The type of a post-update hooks monad. IO equipped with logging ability and information about the Lake configuration.

                Equations
                Instances For
                  structure Lake.PostUpdateHook (pkgName : Lean.Name) :
                  Instances For
                    @[implemented_by Lake.OpaquePostUpdateHook.unsafeGet]
                    @[implemented_by Lake.OpaquePostUpdateHook.unsafeMk]
                    Instances For
                      @[inline]

                      The package version.

                      Equations
                      Instances For
                        @[inline]

                        The package's versionTags configuration.

                        Equations
                        Instances For
                          @[inline]

                          The package's description configuration.

                          Equations
                          Instances For
                            @[inline]

                            The package's keywords configuration.

                            Equations
                            Instances For
                              @[inline]

                              The package's homepage configuration.

                              Equations
                              Instances For
                                @[inline]

                                The package's reservoir configuration.

                                Equations
                                Instances For
                                  @[inline]

                                  The package's license configuration.

                                  Equations
                                  Instances For
                                    @[inline]

                                    The package's licenseFiles configuration.

                                    Equations
                                    Instances For
                                      @[inline]

                                      The package's dir joined with each of its relLicenseFiles.

                                      Equations
                                      Instances For
                                        @[inline]

                                        The package's readmeFile configuration.

                                        Equations
                                        Instances For
                                          @[inline]

                                          The package's dir joined with its relReadmeFile.

                                          Equations
                                          Instances For
                                            @[inline]

                                            The path to the package's Lake directory relative to dir (e.g., .lake).

                                            Equations
                                            Instances For
                                              @[inline]

                                              The full path to the package's Lake directory (i.e, dir joined with relLakeDir).

                                              Equations
                                              Instances For
                                                @[inline]

                                                The path for storing the package's remote dependencies relative to dir (i.e., packagesDir).

                                                Equations
                                                Instances For
                                                  @[inline]

                                                  The package's dir joined with its relPkgsDir.

                                                  Equations
                                                  Instances For
                                                    @[inline]

                                                    The full path to the package's configuration file.

                                                    Equations
                                                    Instances For
                                                      @[inline]

                                                      The path to the package's JSON manifest of remote dependencies.

                                                      Equations
                                                      Instances For
                                                        @[inline]

                                                        The package's dir joined with its buildDir configuration.

                                                        Equations
                                                        Instances For
                                                          @[inline]

                                                          The package's testDriverArgs configuration.

                                                          Equations
                                                          Instances For
                                                            @[inline]

                                                            The package's lintDriverArgs configuration.

                                                            Equations
                                                            Instances For
                                                              @[inline]

                                                              The package's extraDepTargets configuration.

                                                              Equations
                                                              Instances For
                                                                @[inline]

                                                                The package's platformIndependent configuration.

                                                                Equations
                                                                Instances For
                                                                  @[inline]

                                                                  The package's releaseRepo/releaseRepo? configuration.

                                                                  Equations
                                                                  Instances For
                                                                    @[inline]

                                                                    The packages remoteUrl as an Option (none if empty).

                                                                    Equations
                                                                    Instances For
                                                                      @[inline]

                                                                      The package's lakeDir joined with its buildArchive.

                                                                      Equations
                                                                      Instances For
                                                                        @[inline]

                                                                        The path where Lake stores the package's barrel (downloaded from Reservoir).

                                                                        Equations
                                                                        Instances For
                                                                          @[inline]

                                                                          The package's preferReleaseBuild configuration.

                                                                          Equations
                                                                          Instances For
                                                                            @[inline]

                                                                            The package's precompileModules configuration.

                                                                            Equations
                                                                            Instances For
                                                                              @[inline]

                                                                              The package's moreGlobalServerArgs configuration.

                                                                              Equations
                                                                              Instances For
                                                                                @[inline]

                                                                                The package's moreServerOptions configuration appended to its leanOptions configuration.

                                                                                Equations
                                                                                Instances For
                                                                                  @[inline]

                                                                                  The package's buildType configuration.

                                                                                  Equations
                                                                                  Instances For
                                                                                    @[inline]

                                                                                    The package's backend configuration.

                                                                                    Equations
                                                                                    Instances For
                                                                                      @[inline]

                                                                                      The package's dynlibs configuration.

                                                                                      Equations
                                                                                      Instances For
                                                                                        @[inline]

                                                                                        The package's plugins configuration.

                                                                                        Equations
                                                                                        Instances For
                                                                                          @[inline]

                                                                                          The package's leanOptions configuration.

                                                                                          Equations
                                                                                          Instances For
                                                                                            @[inline]

                                                                                            The package's moreLeanArgs configuration appended to its leanOptions configuration.

                                                                                            Equations
                                                                                            Instances For
                                                                                              @[inline]

                                                                                              The package's weakLeanArgs configuration.

                                                                                              Equations
                                                                                              Instances For
                                                                                                @[inline]

                                                                                                The package's moreLeancArgs configuration.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  @[inline]

                                                                                                  The package's weakLeancArgs configuration.

                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    @[inline]

                                                                                                    The package's moreLinkObjs configuration.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      @[inline]

                                                                                                      The package's moreLinkLibs configuration.

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        @[inline]

                                                                                                        The package's moreLinkArgs configuration.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          @[inline]

                                                                                                          The package's weakLinkArgs configuration.

                                                                                                          Equations
                                                                                                          Instances For
                                                                                                            @[inline]

                                                                                                            The package's dir joined with its srcDir configuration.

                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              @[inline]

                                                                                                              The package's root directory for lean (i.e., srcDir).

                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                @[inline]

                                                                                                                The package's buildDir joined with its leanLibDir configuration.

                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  @[inline]

                                                                                                                  Where static libraries for the package are located. The package's buildDir joined with its nativeLibDir configuration.

                                                                                                                  Equations
                                                                                                                  Instances For
                                                                                                                    @[inline]

                                                                                                                    Where shared libraries for the package are located. The package's buildDir joined with its nativeLibDir configuration.

                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      @[deprecated "Use staticLibDir or sharedLibDir instead." (since := "2025-03-29")]

                                                                                                                      The package's buildDir joined with its nativeLibDir configuration.

                                                                                                                      Equations
                                                                                                                      Instances For
                                                                                                                        @[inline]

                                                                                                                        The package's buildDir joined with its binDir configuration.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          @[inline]

                                                                                                                          The package's buildDir joined with its irDir configuration.

                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            Try to find a target configuration in the package with the given name.

                                                                                                                            Equations
                                                                                                                            Instances For

                                                                                                                              Whether the given module is considered local to the package.

                                                                                                                              Equations
                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                              Instances For

                                                                                                                                Whether the given module is in the package (i.e., can build it).

                                                                                                                                Equations
                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                Instances For

                                                                                                                                  Remove the package's build outputs (i.e., delete its build directory).

                                                                                                                                  Equations
                                                                                                                                  Instances For