Skip to content

Commit 7f7aaaa

Browse files
kim-emgithub-actions[bot]david-christiansendatokratjcreedcmu
authored
chore: bump toolchain to v4.30.0-rc1 (#824)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: David Thrane Christiansen <david@lean-fro.org> Co-authored-by: Paul Reichert <6992158+datokrat@users.noreply.github.com> Co-authored-by: jcreedcmu <jcreed@gmail.com> Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk> Co-authored-by: Sebastian Graf <sgraf1337@gmail.com> Co-authored-by: Robert J. Simmons <442315+robsimmons@users.noreply.github.com> Co-authored-by: Pim Otte <otte.pim@gmail.com> Co-authored-by: Phil Nguyen <pcn@cs.umd.edu> Co-authored-by: Violetta Sim <38787503+eyihluyc@users.noreply.github.com> Co-authored-by: Markus Himmel <markus@himmel-villmar.de> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com> Co-authored-by: euprunin <178733547+euprunin@users.noreply.github.com> Co-authored-by: u <u@h> Co-authored-by: Pablo Graubner <2234137+pgraubner@users.noreply.github.com> Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: Marc Huisinga <mhuisi@protonmail.com> Co-authored-by: Joachim Breitner <mail@joachim-breitner.de> Co-authored-by: jrr6 <7482866+jrr6@users.noreply.github.com> Co-authored-by: Leonardo de Moura <leomoura@amazon.com> Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch> Co-authored-by: Violetta Sim <38787503+viol37@users.noreply.github.com> Co-authored-by: Rob Simmons <rob@lean-fro.org> Co-authored-by: leanprover-bot <leanprover-bot@lean-fro.org> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Wojciech Różowski <wojciech@lean-fro.org> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Richard Davison <richard.neil.davison@gmail.com> Co-authored-by: Chris Su <102528557+chrissuu@users.noreply.github.com> Co-authored-by: ericrbg-harmonic <eric@harmonic.fun> Co-authored-by: Mac Malone <tydeu@hatpress.net> Co-authored-by: Garmelon <joscha@plugh.de>
1 parent a9f5717 commit 7f7aaaa

21 files changed

Lines changed: 828 additions & 186 deletions

File tree

.vale/styles/config/ignore/terms.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ bitvectors
1818
bitwise
1919
booleans
2020
callout
21+
cbv
2122
checkpointing
2223
codomain
2324
codomain's
@@ -29,6 +30,7 @@ conv
2930
cumulative
3031
cumulativity
3132
cutsat
33+
decide_cbv
3234
deallocate
3335
deallocated
3436
deallocates
@@ -216,6 +218,7 @@ unexpander
216218
unexpanders
217219
unexpanders
218220
unexpansion
221+
unfoldings
219222
uninstantiated
220223
unknownIdentifier
221224
unparenthesized

Manual/BasicTypes/Subtype.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def s2 : NonEmptyString where
7676
val := "equal"
7777
property :=
7878
fun h =>
79-
List.cons_ne_nil _ _ (String.data_eq_of_eq h)
79+
List.cons_ne_nil _ _ (String.ext_iff.mp h)
8080

8181
theorem s1_eq_s2 : s1 = s2 := by rfl
8282
```
@@ -98,7 +98,7 @@ def s2 : NonEmptyString where
9898
val := "equal"
9999
property :=
100100
fun h =>
101-
List.cons_ne_nil _ _ (String.data_eq_of_eq h)
101+
List.cons_ne_nil _ _ (String.ext_iff.mp h)
102102

103103
theorem s1_eq_s2 : s1 = s2 := by
104104
ext

Manual/BuildTools/Lake.lean

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ That tool's {tech}[manifest] thus looks something like this:
161161

162162
```lakeManifest
163163
{
164-
"version": "1.1.0",
164+
"version": "1.2.0",
165165
"packagesDir": ".lake/packages",
166166
"packages": [{
167167
"url": "https://github.com/leanprover/lean4-cli",
@@ -176,7 +176,8 @@ That tool's {tech}[manifest] thus looks something like this:
176176
"configFile": "lakefile.toml"
177177
}],
178178
"name": "myTool",
179-
"lakeDir": ".lake"
179+
"lakeDir": ".lake",
180+
"fixedToolchain": false
180181
}
181182
```
182183

@@ -186,7 +187,7 @@ This can be done with the following {tech}[package overrides] file:
186187

187188
```lakePackageOverrides
188189
{
189-
"version": "1.1.0",
190+
"version": "1.2.0",
190191
"packages": [{
191192
"type": "path",
192193
"dir": "/etc/lean-packages/Cli",
@@ -449,6 +450,7 @@ module.input
449450
module.ir
450451
module.lean
451452
module.leanArts
453+
module.ltar
452454
module.o
453455
module.o.export
454456
module.o.noexport
@@ -551,6 +553,10 @@ The facets available for modules are:
551553

552554
A shared library (e.g., for the Lean option `--load-dynlib`){TODO}[Document Lean command line options, and cross-reference from here].
553555

556+
: `ltar`
557+
558+
A compressed archive (produced via `leantar`) of the module's build artifacts. {TODO}[Document `leantar` in the manual as well]
559+
554560
:::
555561

556562

Manual/BuildTools/Lake/CLI.lean

Lines changed: 145 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,12 +1097,12 @@ If {lakeMeta}`archive.tgz` is not specified, the package's `buildArchive` settin
10971097

10981098
# Local Caches
10991099

1100-
{lake}`cache get` and {lake}`cache put` are used to interact with remote cache servers.
1100+
{lake}`cache get`, {lake}`cache put`, and {lake}`cache add` are used to interact with remote cache servers.
11011101
These commands are *experimental*, and are only useful if the {ref "lake-cache"}[local cache] is enabled.
11021102

1103-
Both commands can be configured to use a {deftech}[cache scope], which is a server-specific identifier for a set of artifacts for a package.
1103+
These commands can be configured to use a {deftech}[cache scope], which is a server-specific identifier for a set of build outputs for a package.
11041104
On Reservoir, scopes are currently identical with GitHub repositories, but may include toolchain and platform information in the future.
1105-
Other remote artifact caches may use any scope scheme that they want.
1105+
Other remote caches may use any scope scheme that they want.
11061106
Cache scopes are specified using the {lakeOptDef option}`--scope=` option.
11071107
Cache scopes are not identical to the scopes used to require packages from Reservoir.
11081108

@@ -1113,47 +1113,56 @@ USAGE:
11131113
lake cache <COMMAND>
11141114

11151115
COMMANDS:
1116-
get [<mappings>] download artifacts into the local Lake cache
1117-
put <mappings> upload artifacts to a remote cache
1116+
get [<mappings>] download build outputs into the local Lake cache
1117+
put <mappings> upload build ouptuts to a remote cache
1118+
add <mappings> add input-to-output mappings to the Lake cache
11181119
clean removes ALL froms the local Lake cache
11191120
services print configured remote cache services
11201121

1122+
STAGING COMMANDS:
1123+
stage <map> <dir> copy build outputs from the cache to a directory
1124+
unstage <dir> cache build outputs from a staging directory
1125+
put-staged <dir> upload build outputs from a staging directory
1126+
11211127
See `lake cache help <command>` for more information on a specific command.
11221128
```
11231129

11241130
```lakeCacheHelp get
1125-
Download artifacts from a remote service into the Lake cache
1131+
Download build outputs from a remote service into the Lake cache
11261132

11271133
USAGE:
11281134
lake cache get [<mappings>]
11291135

11301136
OPTIONS:
11311137
--max-revs=<n> backtrack up to n revisions (default: 100)
11321138
--rev=<commit-hash> uses this exact revision to lookup artifacts
1139+
--service=<name> cache service to fetch from
11331140
--repo=<github-repo> GitHub repository of the package or a fork
11341141
--platform=<target-triple> with Reservoir or --repo, sets the platform
11351142
--toolchain=<name> with Reservoir or --repo, sets the toolchain
11361143
--scope=<remote-scope> scope for a custom endpoint
1144+
--mappings-only only download mappings, delay artifacts
1145+
--force-download redownload existing files
11371146

1138-
Downloads artifacts for packages in the workspace from a remote cache service.
1139-
The cache service used can be specifed via the `--service` option. Otherwise,
1140-
Lake will the system default, or, if none is configured, Reservoir. See
1141-
`lake cache services` for more information on how to configure services.
1147+
Downloads build outputs for packages in the workspace from a remote cache
1148+
service. The cache service used can be specified via the `--service` option.
1149+
Otherwise, Lake will the system default, or, if none is configured, Reservoir.
1150+
See `lake cache services` for more information on how to configure services.
11421151

11431152
If an input-to-outputs mappings file, `--scope`, or `--repo` is provided,
1144-
Lake will download artifacts for the root package. Otherwise, it will use
1145-
Reservoir to download artifacts for each dependency in workspace (in order).
1153+
Lake will download build outputs for the root package. Otherwise, it will use
1154+
Reservoir to download outputs for each dependency in the workspace (in order).
11461155
Non-Reservoir dependencies will be skipped.
11471156

1148-
To determine the artifacts to download, Lake searches for input-to-output
1149-
mappings for a given build of the package via the cache service. This mapping
1150-
is identified by a Git revision and prefixed with a scope derived from the
1151-
package's name, GitHub repository, Lean toolchain, and current platform.
1152-
The exact configuration can be customized using options.
1157+
To determine what to download, Lake searches for input-to-output mappings for
1158+
a given build of the package via the cache service. This mapping is identified
1159+
by a Git revision and prefixed with a scope derived from the package's name,
1160+
GitHub repository, Lean toolchain, and current platform. The exact configuration
1161+
can be customized using options.
11531162

1154-
For Reservoir, setting `--repo` will make Lake lookup artifacts for the root
1163+
For Reservoir, setting `--repo` will cause Lake to lookup outputs for the root
11551164
package by a repository name, rather than the package's. This can be used to
1156-
download artifacts for a fork of the Reservoir package (if such artifacts are
1165+
download outputs for a fork of the Reservoir package (if such artifacts are
11571166
available). The `--platform` and `--toolchain` options can be used to download
11581167
artifacts for a different platform/toolchain configuration than Lake detects.
11591168
For a custom endpoint, the full prefix Lake uses can be set via `--scope`.
@@ -1163,23 +1172,27 @@ artifacts. If no mappings are found, Lake will backtrack the Git history up to
11631172
`--max-revs`, looking for a revision with mappings. If `--max-revs` is 0, Lake
11641173
will search the repository's entire history (or as far as Git will allow).
11651174

1175+
By default, Lake will download both the input-to-output mappings and the
1176+
output artifacts for a package. By using `--mappings-onlys`, Lake will only
1177+
download the mappings abd delay downloading artifacts until they are needed.
1178+
11661179
If a download for an artifact fails or the download process for a whole
11671180
package fails, Lake will report this and continue on to the next. Once done,
11681181
if any download failed, Lake will exit with a nonzero status code.
11691182
```
11701183

1171-
:::lake cache get "[mappings] [\"--max-revs=\" cn] [\"--rev=\" «commit-hash»] [\"--repo=\" «github-repo»] [\"--platform=\" «target-triple»] [\"--toolchain=\"«name»] [\"--scope=\" «remote-scope»]"
1172-
Downloads artifacts for packages in the workspace from a remote cache service to the local Lake {tech (key:="local cache")}[artifact cache].
1184+
:::lake cache get "[mappings] [\"--max-revs=\" cn] [\"--rev=\" «commit-hash»] [\"--service=\" «name»] [\"--repo=\" «github-repo»] [\"--platform=\" «target-triple»] [\"--toolchain=\"«name»] [\"--scope=\" «remote-scope»] [\"--mappings-only\"] [\"--force-download\"]"
1185+
Downloads build outputs for packages in the workspace from a remote cache service to the local Lake {tech (key:="local cache")}[artifact cache].
11731186
The cache service used can be specified via the {lakeOpt}`--service` option.
11741187
Otherwise, Lake will use the system default, or, if none is configured, Reservoir.
11751188
See {lake}`cache services` for more information on how to configure services.
11761189

1177-
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.
1178-
Otherwise, it will download artifacts for each package in the root's dependency tree in order (using Reservoir).
1190+
If an input-to-outputs {lakeMeta}`mappings` file, a {lakeMeta}`remote-scope`, or a {lakeMeta}`github-repo` is provided, Lake will download build outputs for the root package.
1191+
Otherwise, it will download outputs for each package in the root's dependency tree in order (using Reservoir).
11791192
Non-Reservoir dependencies will be skipped.
11801193

1181-
For Reservoir, setting {lakeOpt}`--repo` will make Lake lookup artifacts for the root package by a repository name, rather than the package's.
1182-
This can be used to download artifacts for a fork of the Reservoir package (if such artifacts are available).
1194+
For Reservoir, setting {lakeOpt}`--repo` will cause Lake to look up outputs for the root package by a repository name, rather than the package's.
1195+
This can be used to download outputs for a fork of the Reservoir package (if such artifacts are available).
11831196
The {lakeOpt}`--platform` and {lakeOpt}`--toolchain` options can be used to download artifacts for a different platform/toolchain configuration than Lake detects.
11841197
For a custom endpoint, the full prefix Lake uses can be set via {lakeOpt}`--scope`.
11851198

@@ -1188,22 +1201,26 @@ Lake will download the artifacts for the most recent commit with available mappi
11881201
It will backtrack up to {lakeOptDef option}`--max-revs`, which defaults to 100.
11891202
If set to 0, Lake will search the repository's whole history, or as far back as Git will allow.
11901203

1204+
By default, Lake will download both the input-to-output mappings and the output artifacts for packages.
1205+
Using {lakeOptDef option}`--mappings-only` will cause Lake to only download the mappings and delay downloading artifacts until they are needed.
1206+
Using {lakeOptDef option}`--force-download` will redownload existing files.
1207+
11911208
While downloading, Lake will continue on when a download for an artifact fails or if the download process for a whole package fails.
11921209
However, it will report this and exit with a nonzero status code in such cases.
11931210
:::
11941211

11951212

11961213
```lakeCacheHelp put
1197-
Upload artifacts from the Lake cache to a remote service
1214+
Upload build outputs from the Lake cache to a remote service
11981215

11991216
USAGE:
12001217
lake cache put <mappings> <scope-option>
12011218

1202-
Uploads the input-to-outputs mappings contained in the specified file along
1219+
Uploads the input-to-output mappings contained in the specified file along
12031220
with the corresponding output artifacts to a remote cache. The cache service
1204-
used via be specified via `--service` option. If not specifed, Lake will used
1205-
the system default, or error if none is configured. See `lake cache services`
1206-
for more information on how to configure services.
1221+
used can be specified via the `--service` option. If not specified, Lake will use
1222+
the system default, or error if none is configured. See the help page of
1223+
`lake cache services` for more information on how to configure services.
12071224

12081225
Files are uploaded using the AWS Signature Version 4 authentication protocol
12091226
via `curl`. Thus, the service should generally be an S3-compatible bucket. The
@@ -1269,6 +1286,40 @@ The mappings file is uploaded to the revision endpoint with a file name derived
12691286
As such, the command will warn if the work tree currently has changes.
12701287
::::
12711288

1289+
```lakeCacheHelp add
1290+
Add input-to-output mappings to the Lake cache
1291+
1292+
USAGE:
1293+
lake cache add <mappings>
1294+
1295+
OPTIONS:
1296+
--service=<name> cache service to fetch from on demand
1297+
--scope=<remote-scope> the prefix of artifacts within the service
1298+
--repo=<github-repo> for Reservoir, a GitHub repository scope
1299+
1300+
Reads a list of input-to-output mapppings from the provided file and adds
1301+
them to the local Lake cache. If `--service` is provided, the output artifacts
1302+
can then be fetched lazily from that service during a Lake build. The service
1303+
must either be `reservoir` or be configured through the Lake system
1304+
configuration (see the help page of `lake cache services` for details).
1305+
1306+
Since Lake does not currently use cryptographically secure hashes for
1307+
artifacts and outputs, artifacts in a cache service are prefixed with a scope
1308+
to avoid clashes. For Reservoir, this scope can either be a package (set via
1309+
`--scope`) or a repository (set via `--repo`). For S3 services, both options
1310+
are synonymous.
1311+
```
1312+
1313+
::::lake cache add "mappings [\"--service=\" «name»] [\"--scope=\" «remote-scope»] [\"--repo=\" «github-repo»]"
1314+
Reads a list of input-to-output mappings from the provided file and adds them to the local Lake cache.
1315+
If {lakeOpt}`--service` is provided, the output artifacts can then be fetched lazily from that service during a Lake build.
1316+
The service must either be `reservoir` or be configured through the Lake system configuration (see {lake}`cache services` for details).
1317+
1318+
Since Lake does not currently use cryptographically secure hashes for artifacts and outputs, artifacts in a cache service are prefixed with a scope to avoid clashes.
1319+
For Reservoir, this scope can either be a package (set via {lakeOpt}`--scope`) or a repository (set via {lakeOpt}`--repo`).
1320+
For S3 services, both options are synonymous.
1321+
::::
1322+
12721323
```lakeCacheHelp clean
12731324
Removes ALL files from the local Lake cache
12741325

@@ -1331,6 +1382,70 @@ If no `cache.defaultService` is configured, Lake will use Reservoir by default.
13311382
:::
13321383
::::
13331384

1385+
```lakeCacheHelp stage
1386+
Copy build outputs from the cache to a staging directory
1387+
1388+
USAGE:
1389+
lake cache stage <mappings> <staging-directory>
1390+
1391+
Creates the staging directory and copies the mappings file to it. Then, it
1392+
copies all artifacts described within the mappings file from the cache to the
1393+
staging directory. Errors if any of the artifacts described cannot be found in
1394+
the cache.
1395+
```
1396+
1397+
::::lake cache stage "mappings «staging-directory»"
1398+
Creates {lakeMeta}`staging-directory` and copies the {lakeMeta}`mappings` file to it.
1399+
After this, it copies all artifacts described within the mappings file from the cache to the
1400+
staging directory.
1401+
It is an error if any of the artifacts described cannot be found in the cache.
1402+
::::
1403+
1404+
```lakeCacheHelp unstage
1405+
Cache build outputs from a staging directory
1406+
1407+
USAGE:
1408+
lake cache unstage <staging-directory>
1409+
1410+
Copies the mappings and artifacts stored in staging directory (e.g., via
1411+
`lake cache stage`) back into the cache.
1412+
1413+
Reads the mappings file located at `outputs.jsonl` within the staging
1414+
directory and writes the mappings to the Lake cache. Then, it copies the
1415+
described artifacts from the staging directory into the cache.
1416+
```
1417+
1418+
::::lake cache unstage "«staging-directory»"
1419+
1420+
Copies the mappings and artifacts stored in {lakeMeta}`staging-directory` (e.g., via {lake}`cache stage`) back into the cache.
1421+
1422+
Reads the mappings file located at `outputs.jsonl` within the staging
1423+
directory and writes the mappings to the Lake cache. Then, it copies the
1424+
described artifacts from the staging directory into the cache.
1425+
::::
1426+
1427+
1428+
```lakeCacheHelp "put-stage"
1429+
Manage the Lake cache
1430+
1431+
USAGE:
1432+
lake cache <COMMAND>
1433+
1434+
COMMANDS:
1435+
get [<mappings>] download build outputs into the local Lake cache
1436+
put <mappings> upload build ouptuts to a remote cache
1437+
add <mappings> add input-to-output mappings to the Lake cache
1438+
clean removes ALL froms the local Lake cache
1439+
services print configured remote cache services
1440+
1441+
STAGING COMMANDS:
1442+
stage <map> <dir> copy build outputs from the cache to a directory
1443+
unstage <dir> cache build outputs from a staging directory
1444+
put-staged <dir> upload build outputs from a staging directory
1445+
1446+
See `lake cache help <command>` for more information on a specific command.
1447+
```
1448+
13341449

13351450
# Configuration Files
13361451

0 commit comments

Comments
 (0)