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
This PR adds two new configuration options that are subsets of
`precompileModules`: `precompileLibrary` for `lean_lib` targets and
`precompileImports` for all Lean configurations (e.g., settable on
`package`, `lean_lib`, or `lean_exe`). `precompileImports` compiles a
module's imports but not the module itself. `precompileLibrary` compiles
the whole library for importers, but the library's modules do not
compile their own imports during elaboration.
Closes#2757 with the finer-grain `precompileLibrary` instead of the
more general `precompilePackage`.
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/lake/schemas/lakefile-toml-schema.json
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,11 @@
132
132
"type": "boolean",
133
133
"description": "Asserts whether Lake should assume Lean modules are platform-independent.\n\n* If `false`, Lake will add `System.Platform.target` to the module traces within the code unit (e.g., package or library). This will force Lean code to be re-elaborated on different platforms.\n\n* If `true`, Lake will exclude platform-dependent elements (e.g., precompiled modules, external libraries) from a module's trace, preventing re-elaboration on different platforms. Note that this will not effect modules outside the code unit in question. For example, a platform-independent package which depends on a platform-dependent library will still be platform-dependent.\n\n* If not set, Lake will construct traces as natural. That is, it will include platform-dependent artifacts in the trace if they module depends on them, but otherwise not force modules to be platform-dependent.\n\nThere is no check for correctness here, so a configuration can lie and Lake will not catch it."
134
134
},
135
+
"precompileImports": {
136
+
"type": "boolean",
137
+
"default": false,
138
+
"description": "Whether to compile the imports of modules into native shared libraries that are loaded when the module is built. This speeds up evaluation of metaprograms and enables the interpreter to run functions marked `@[extern]`."
139
+
},
135
140
"dynlibs": {
136
141
"type": "array",
137
142
"items": {
@@ -217,10 +222,15 @@
217
222
"default": [],
218
223
"description": "Build target identifiers of targets to build before the library's modules.\n\nFormat: `<target>[:<facet>]*`, where:\n- `<target>` is of the form `@<package>`, `@<package>/<targetName>`, +<module>` or `@<package>/+<module>`,\n- `<package>` may be empty to reference the default package,\n- `<facet>` is the name of a target facet."
219
224
},
225
+
"precompileLibrary": {
226
+
"type": "boolean",
227
+
"default": false,
228
+
"description": "Whether to compile the library into a native shared library that is loaded whenever one of its modules is imported by a module outside the library. This speeds up evaluation of metaprograms and enables the interpreter to run functions marked `@[extern]`."
229
+
},
220
230
"precompileModules": {
221
231
"type": "boolean",
222
232
"default": false,
223
-
"description": "Whether to compile each of the library's modules 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]`."
233
+
"description": "Whether to compile each of the library's modules 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]`.\n\nThis implies `precompileImports` and `precompileLibrary`."
0 commit comments