Skip to content

Commit 144c919

Browse files
chore: bump to 2025-02-20 (#787)
1 parent 3826953 commit 144c919

6 files changed

Lines changed: 145 additions & 57 deletions

File tree

Manual/BuildTools/Lake/CLI.lean

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ COMMANDS:
11141114
get [<mappings>] download artifacts into the local Lake cache
11151115
put <mappings> upload artifacts to a remote cache
11161116
clean removes ALL froms the local Lake cache
1117+
services print configured remote cache services
11171118

11181119
See `lake cache help <command>` for more information on a specific command.
11191120
```
@@ -1133,13 +1134,9 @@ OPTIONS:
11331134
--scope=<remote-scope> scope for a custom endpoint
11341135

11351136
Downloads artifacts for packages in the workspace from a remote cache service.
1136-
The cache service used can be configured via the environment variables:
1137-
1138-
LAKE_CACHE_SERVICE identifier recorded in ouptuts
1139-
LAKE_CACHE_ARTIFACT_ENDPOINT base URL for artifact downloads
1140-
LAKE_CACHE_REVISION_ENDPOINT base URL for the mapping download
1141-
1142-
If neither endpoint is set, Lake will use Reservoir.
1137+
The cache service used can be specifed via the `--service` option. Otherwise,
1138+
Lake will the system default, or, if none is configured, Reservoir. See
1139+
`lake cache services` for more information on how to configure services.
11431140

11441141
If an input-to-outputs mappings file, `--scope`, or `--repo` is provided,
11451142
Lake will download artifacts for the root package. Otherwise, it will use
@@ -1171,9 +1168,9 @@ if any download failed, Lake will exit with a nonzero status code.
11711168

11721169
:::lake cache get "[mappings] [\"--max-revs=\" cn] [\"--rev=\" «commit-hash»] [\"--repo=\" «github-repo»] [\"--platform=\" «target-triple»] [\"--toolchain=\"«name»] [\"--scope=\" «remote-scope»]"
11731170
Downloads artifacts for packages in the workspace from a remote cache service to the local Lake {tech (key:="local cache")}[artifact cache].
1174-
The remote cache service used can be configured using {envVar}`LAKE_CACHE_ARTIFACT_ENDPOINT` and {envVar}`LAKE_CACHE_REVISION_ENDPOINT`.
1175-
If neither of these are set, Lake will use Reservoir instead.
1176-
The variable {envVar}`LAKE_CACHE_SERVICE` can be used to provide an identifier to be recorded in outputs.
1171+
The cache service used can be specified via the {lakeOpt}`--service` option.
1172+
Otherwise, Lake will use the system default, or, if none is configured, Reservoir.
1173+
See {lake}`cache services` for more information on how to configure services.
11771174

11781175
If an input-to-outputs {lakeMeta}`mappings` file, a {lakeMeta}`remote-scope`, or a {lakeMeta}`github-repo` is provided, Lake will download artifacts for the root package.
11791176
Otherwise, it will download artifacts for each package in the root's dependency tree in order (using Reservoir).
@@ -1202,18 +1199,17 @@ USAGE:
12021199

12031200
Uploads the input-to-outputs mappings contained in the specified file along
12041201
with the corresponding output artifacts to a remote cache. The cache service
1205-
used is configured via the environment variables:
1206-
1207-
LAKE_CACHE_KEY authentication key for requests
1208-
LAKE_CACHE_ARTIFACT_ENDPOINT base URL for artifact uploads
1209-
LAKE_CACHE_REVISION_ENDPOINT base URL for the mapping upload
1202+
used via be specified via `--service` option. If not specifed, Lake will used
1203+
the system default, or error if none is configured. See `lake cache services`
1204+
for more information on how to configure services.
12101205

12111206
Files are uploaded using the AWS Signature Version 4 authentication protocol
1212-
via `curl`. Thus, the service should generally be an S3-compatible bucket.
1207+
via `curl`. Thus, the service should generally be an S3-compatible bucket. The
1208+
authentication key is set via the `LAKE_CACHE_KEY` environment variable.
12131209

12141210
Since Lake does not currently use cryptographically secure hashes for
12151211
artifacts and outputs, uploads to the cache are prefixed with a scope to avoid
1216-
clashes. This scoped is configured with the following options:
1212+
clashes. This scope is configured with the following options:
12171213

12181214
--scope=<remote-scope> sets a fixed scope
12191215
--repo=<github-repo> uses the repository + toolchain & platform
@@ -1235,9 +1231,13 @@ has changes.
12351231

12361232
::::lake cache put "mappings «scope-option»"
12371233
Uploads the input-to-outputs mappings contained in the specified file along with the corresponding output artifacts to a remote cache.
1238-
The remote cache service used can be configured using {envVar}`LAKE_CACHE_KEY`, {envVar}`LAKE_CACHE_ARTIFACT_ENDPOINT` and {envVar}`LAKE_CACHE_REVISION_ENDPOINT`.
1234+
The cache service used can be specified via the {lakeOpt}`--service` option.
1235+
If not specified, Lake will use the system default, or error if none is configured.
1236+
See {lake}`cache services` for more information on how to configure services.
12391237

1240-
Files are uploaded using the AWS Signature Version 4 authentication protocol via `curl`. Thus, the service should generally be an S3-compatible bucket.
1238+
Files are uploaded using the AWS Signature Version 4 authentication protocol via `curl`.
1239+
Thus, the service should generally be an S3-compatible bucket.
1240+
The authentication key is set via the {envVar}`LAKE_CACHE_KEY` environment variable.
12411241

12421242
Since Lake does not currently use cryptographically secure hashes for
12431243
artifacts and outputs, uploads to the cache are prefixed with a scope to avoid
@@ -1284,6 +1284,51 @@ If a workspace configuration exists, this will delete the cache directory it use
12841284
Otherwise, it will delete the default Lake cache directory for the system.
12851285
:::
12861286

1287+
```lakeCacheHelp services
1288+
Print configured remote cache services
1289+
1290+
USAGE:
1291+
lake cache services
1292+
1293+
Prints the name of each configured remote cache services (one per line).
1294+
Additional services can be added by modifying the system Lake configuration.
1295+
The exact location of the this configuration file is system dependent and can
1296+
be set by `LAKE_CONFIG`, but it is usually located at `~/.lake/config.toml`.
1297+
1298+
The configuration of the system cache could look something like the following:
1299+
1300+
cache.defaultService = "my-s3"
1301+
cache.defaultUploadService = "my-s3"
1302+
1303+
[[cache.service]]
1304+
name = "my-s3"
1305+
kind = "s3"
1306+
artifactEndpoint = "https://my-s3.com/a0"
1307+
revisionEndpoint = "https://my-s3.com/r0"
1308+
1309+
If no `cache.defaultService` is configured, Lake will use Reservoir by default.
1310+
```
1311+
1312+
::::lake cache services
1313+
Prints the name of each configured remote cache service (one per line).
1314+
Additional services can be added by modifying the system Lake configuration file, which is usually located at `~/.lake/config.toml` but can be set via the {envVar}`LAKE_CONFIG` environment variable.
1315+
1316+
:::paragraph
1317+
The configuration of the system cache could look something like the following:
1318+
```toml -link
1319+
cache.defaultService = "my-s3"
1320+
cache.defaultUploadService = "my-s3"
1321+
1322+
[[cache.service]]
1323+
name = "my-s3"
1324+
kind = "s3"
1325+
artifactEndpoint = "https://my-s3.com/a0"
1326+
revisionEndpoint = "https://my-s3.com/r0"
1327+
```
1328+
If no `cache.defaultService` is configured, Lake will use Reservoir by default.
1329+
:::
1330+
::::
1331+
12871332

12881333
# Configuration Files
12891334

Manual/Language/InductiveTypes/Structures.lean

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,63 @@ tag := "structure-fields"
6565
%%%
6666

6767
Each field of a structure declaration corresponds to a parameter of the constructor.
68+
69+
::::example "Inferring Universes"
70+
71+
The structure {lean}`MyProd` is the same as {lean}`Prod`.
72+
```lean
73+
structure MyProd (α β : Type _) where
74+
fst : α
75+
snd : β
76+
```
77+
The two parameters and the two fields are constructor parameters:
78+
```signature
79+
MyProd.mk.{u, v}
80+
{α : Type u}
81+
{β : Type v}
82+
(fst : α)
83+
(snd : β)
84+
: MyProd.{u, v} α β
85+
```
86+
Additionally, the constructor is {tech (key := "universe polymorphism")}[universe polymorphic]; the type constructor {name}`MyProd` takes two universe parameters:
87+
```signature
88+
MyProd.{u, v} (α : Type u) (β : Type v) : Type (max u v)
89+
```
90+
91+
```lean -show
92+
universe u v
93+
```
94+
The universe level of each type of each field must be less than or equal to the universe level of the structure.
95+
Lean infers that {lean}`Type (max u v)` is the least universe that can accommodate both {lean}`Type u` and {lean}`Type v`.
96+
97+
::::
98+
6899
Auto-implicit arguments are inserted in each field separately, even if their names coincide, and the fields become constructor parameters that quantify over types.
69100

70-
:::: example "Auto-implicit parameters in structure fields"
101+
::::example "Auto-Implicit Parameters in Structure Fields"
71102

72-
The structure {lean}`MyStructure` contains a field whose type is an auto-implicit parameter:
103+
The structure {lean}`MyStructure` contains fields whose types have auto-implicit parameters:
73104

74105
```lean
75106
structure MyStructure where
76-
field1 : α
77-
field2 : α
107+
field1 : Fin n
108+
field2 : Fin n
109+
```
110+
```lean -show
111+
variable {n : Nat}
78112
```
79-
The type constructor {name}`MyStructure` takes two universe parameters:
113+
Each fields in the constructor {name}`MyStructure.mk` takes its own implicit parameter {lean}`n` of type {lean}`Nat`:
80114
```signature
81-
MyStructure.{u, v} : Type (max u v)
115+
MyStructure.mk
116+
(field1 : {n : Nat} → Fin n)
117+
(field2 : {n : Nat} → Fin n)
118+
: MyStructure
82119
```
83-
The resulting type is in `Type` rather than `Sort` because the constructor fields quantify over types in `Sort`. In particular, both fields in its constructor {name}`MyStructure.mk` take an implicit type parameter:
120+
The type constructor {name}`MyStructure` takes no universe parameters, and the resulting type is in `Type`,
121+
which is the universe for {name}`Nat` and {lean}`Fin n`:
84122
```signature
85-
MyStructure.mk.{u, v}
86-
(field1 : {α : Sort u} → α)
87-
(field2 : {α : Sort v} → α)
88-
: MyStructure.{u,v}
123+
MyStructure : Type
89124
```
90-
91125
::::
92126

93127

Manual/Meta/LakeToml/Toml.lean

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -296,23 +296,27 @@ def configPaths : Std.HashMap (List String) Name := Std.HashMap.ofList [
296296
]
297297

298298
open Verso Output Html in
299-
partial def Highlighted.toHtml (tableLink : Name → Option String) (keyLink : Name → Name → Option String) : Highlighted -> Html
299+
partial def Highlighted.toHtml (tableLink : Name → Option String) (keyLink : Name → Name → Option String) (urlLinks : Bool := true) : Highlighted -> Html
300300
| .token t s =>
301301
match t with
302302
| .bool _ => {{<span class="bool">{{s}}</span>}}
303303
| .string _ => {{<span class="string">{{s}}</span>}}
304304
| .num _ => {{<span class="num">{{s}}</span>}}
305305
| .tableHeader hl =>
306-
{{<span class="table-header">{{hl.toHtml tableLink keyLink}}</span>}}
306+
{{<span class="table-header">{{hl.toHtml tableLink keyLink urlLinks}}</span>}}
307307
| .tableName n hl =>
308308
let tableName := n.map (·.splitOn ".") >>= (configPaths[·]?)
309309
if let some dest := tableName >>= tableLink then
310-
{{<a href={{dest}}>{{hl.toHtml tableLink keyLink}}</a>}}
310+
{{<a href={{dest}}>{{hl.toHtml tableLink keyLink urlLinks}}</a>}}
311311
else
312-
hl.toHtml tableLink keyLink
313-
| .tableDelim hl => {{<span class="table-delimiter">{{hl.toHtml tableLink keyLink}}</span>}}
314-
| .concat hls => .seq (hls.map (toHtml tableLink keyLink))
315-
| .link url hl => {{<a href={{url}}>{{hl.toHtml tableLink keyLink}}</a>}}
312+
hl.toHtml tableLink keyLink urlLinks
313+
| .tableDelim hl => {{<span class="table-delimiter">{{hl.toHtml tableLink keyLink urlLinks}}</span>}}
314+
| .concat hls => .seq (hls.map (toHtml tableLink keyLink urlLinks))
315+
| .link url hl =>
316+
if urlLinks then
317+
{{<a href={{url}}>{{hl.toHtml tableLink keyLink urlLinks}}</a>}}
318+
else
319+
hl.toHtml tableLink keyLink urlLinks
316320
| .text s => s
317321
| .ws s =>
318322
let comment := s.find (· == '#')
@@ -321,7 +325,7 @@ partial def Highlighted.toHtml (tableLink : Name → Option String) (keyLink : N
321325
{{ {{s.extract s.startPos comment}} {{commentHtml}} }}
322326
| .key none k => {{
323327
<span class="key">
324-
{{k.toHtml tableLink keyLink}}
328+
{{k.toHtml tableLink keyLink urlLinks}}
325329
</span>
326330
}}
327331
| .key (some p) k =>
@@ -335,18 +339,18 @@ partial def Highlighted.toHtml (tableLink : Name → Option String) (keyLink : N
335339

336340
{{ <span class="key" data-toml-key={{p}}>
337341
{{ if let some url := dest then {{
338-
<a href={{url}}>{{k.toHtml tableLink keyLink}}</a>
339-
}} else k.toHtml tableLink keyLink }}
342+
<a href={{url}}>{{k.toHtml tableLink keyLink urlLinks}}</a>
343+
}} else k.toHtml tableLink keyLink urlLinks }}
340344
</span>
341345
}}
342346

343347

344348

345349
end Toml
346350

347-
def Block.toml (highlighted : Toml.Highlighted) : Block where
351+
def Block.toml (highlighted : Toml.Highlighted) (link : Bool := true) : Block where
348352
name := `Manual.Block.toml
349-
data := toJson highlighted
353+
data := toJson (highlighted, link)
350354

351355
def Inline.toml (highlighted : Toml.Highlighted) : Inline where
352356
name := `Manual.Inline.toml
@@ -438,13 +442,18 @@ pre.toml {
438442
}
439443
"#
440444

445+
structure TomlParams where
446+
link : Bool := true
447+
448+
instance : FromArgs TomlParams m where
449+
fromArgs := TomlParams.mk <$> ArgParse.flag `link true
450+
441451
open Lean.Parser in
442-
@[code_block_expander toml]
443-
def toml : CodeBlockExpander
444-
| args, str => do
445-
ArgParse.done.run args
452+
@[code_block]
453+
def toml : CodeBlockExpanderOf TomlParams
454+
| { link }, str => do
446455
let hl ← tomlContent str
447-
pure #[← ``(Block.other (Block.toml $(quote hl)) #[Block.code $(quote str.getString)])]
456+
``(Block.other (Block.toml $(quote hl) $(quote link)) #[Block.code $(quote str.getString)])
448457

449458
open Lean.Parser in
450459
@[role_expander toml]
@@ -473,14 +482,14 @@ def Block.toml.descr : BlockDescr where
473482
toHtml := some <| fun _goI _ _ info _ =>
474483
open Verso.Doc.Html in
475484
open Verso.Output Html in do
476-
let .ok hl := FromJson.fromJson? (α := Toml.Highlighted) info
485+
let .ok (hl, link) := FromJson.fromJson? (α := Toml.Highlighted × Bool) info
477486
| do Verso.Doc.Html.HtmlT.logError "Failed to deserialize highlighted TOML data"; pure .empty
478487

479488
let xref := (← read).traverseState
480489

481490
return {{
482491
<pre class="toml">
483-
{{hl.toHtml (Toml.tableLink xref) (Toml.fieldLink xref)}}
492+
{{hl.toHtml (Toml.tableLink xref) (Toml.fieldLink xref) link}}
484493
</pre>
485494
}}
486495

Tutorial/VCGen.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,11 +891,11 @@ instance Result.instWPMonad : WPMonad Result (.except Error .pure) where
891891
wp_pure := by
892892
intros
893893
ext
894-
simp [wp]
894+
simp [wp, ExceptT.run, Id.run, pure, Except.pure, throwThe]
895895
wp_bind x f := by
896896
dsimp only [wp, bind]
897897
ext
898-
cases x <;> simp
898+
cases x <;> simp [ExceptT.run, Id.run, pure, Except.pure, throwThe]
899899
```
900900
:::
901901

lake-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"inputRev": "main",
1212
"inherited": false,
1313
"configFile": "lakefile.lean"},
14-
{"url": "https://github.com/leanprover/verso",
14+
{"url": "https://github.com/leanprover/verso.git",
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "",
18-
"rev": "e39d5bd403d9b5cf5d2c321306aadcc55c1656fa",
18+
"rev": "f060e2aea70e777b3559cb077183ccad4ebbccd7",
1919
"name": "verso",
2020
"manifestFile": "lake-manifest.json",
21-
"inputRev": "main",
22-
"inherited": true,
21+
"inputRev": "nightly-testing",
22+
"inherited": false,
2323
"configFile": "lakefile.lean"},
2424
{"url": "https://github.com/leanprover/subverso",
2525
"type": "git",

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:nightly-2026-02-16
1+
leanprover/lean4:nightly-2026-02-20

0 commit comments

Comments
 (0)