You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lake/README.md
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -337,7 +337,7 @@ For theorem proving packages which depend on `mathlib`, you can also run `lake n
337
337
338
338
**NOTE:** For mathlib in particular, you should run `lake exe cache get` prior to a `lake build` after adding or updating a mathlib dependency. Otherwise, it will be rebuilt from scratch (which can take hours). For more information, see mathlib's [wiki page](https://github.com/leanprover-community/mathlib4/wiki/Using-mathlib4-as-a-dependency) on using it as a dependency.
339
339
340
-
## Lean `require`
340
+
###Lean `require`
341
341
342
342
The `require` command in Lean Lake configuration follows the general syntax:
The `from` clause tells Lake where to locate the dependency.
350
-
Without a `from` clause, Lake will lookup the package in the default registry (i.e., [Reservoir](https://reservoir.lean-lang.org/@lean-dojo/LeanCopilot)) and use the information there to download the package at the specified `version`. The optional `scope` is used to disambiguate which package with `pkg-name` to lookup. In Reservoir, this scope is the package owner (e.g., `leanprover` of [@leanprover/doc-gen4](https://reservoir.lean-lang.org/@leanprover/doc-gen4)).
350
+
Without a `from` clause, Lake will lookup the package in the default registry (i.e., [Reservoir](https://reservoir.lean-lang.org)) and use the information there to download the package at the requested `version`. To specify a Git revision, use the syntax `@ git <rev>`.
351
+
352
+
The `scope` is used to disambiguate between packages in the registry with the same `pkg-name`. In Reservoir, this scope is the package owner (e.g., `leanprover` of [@leanprover/doc-gen4](https://reservoir.lean-lang.org/@leanprover/doc-gen4)).
353
+
351
354
352
355
The `with` clause specifies a `NameMap String` of Lake options used to configure the dependency. This is equivalent to passing `-K` options to the dependency on the command line.
353
356
354
-
## Supported Sources
357
+
###Supported Sources
355
358
356
359
Lake supports the following types of dependencies as sources in a `from` clause.
357
360
358
-
### Path Dependencies
361
+
####Path Dependencies
359
362
360
363
```
361
364
from <path>
362
365
```
363
366
364
367
Lake loads the package located a fixed `path` relative to the requiring package's directory.
365
368
366
-
### Git Dependencies
369
+
####Git Dependencies
367
370
368
371
```
369
372
from git <url> [@ <rev>] [/ <subDir>]
370
373
```
371
374
372
375
Lake clones the Git repository available at the specified fixed Git `url`, and checks out the specified revision `rev`. The revision can be a commit hash, branch, or tag. If none is provided, Lake defaults to `master`. After checkout, Lake loads the package located in `subDir` (or the repository root if no subdirectory is specified).
373
376
374
-
## TOML `require`
377
+
###TOML `require`
375
378
376
379
To `require` a package in a TOML configuration, the parallel syntax for the above examples is:
0 commit comments