chore: allow module in LakeMain (#10039)

This PR enables core's `LakeMain` to be a `module` when core is built
without `USE_LAKE`.

This was a problem when porting Lake to the module system (#9749).
This commit is contained in:
Mac Malone 2025-08-22 03:45:42 -04:00 committed by GitHub
parent facc356a0a
commit 1523ed1cdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -488,7 +488,7 @@ where
let startTime := (← IO.monoNanosNow).toFloat / 1000000000
let mut opts := setup.opts
-- HACK: no better way to enable in core with `USE_LAKE` off
if setup.mainModuleName.getRoot ∈ [`Init, `Std, `Lean, `Lake] then
if setup.mainModuleName.getRoot ∈ [`Init, `Std, `Lean, `Lake, `LakeMain] then
opts := experimental.module.setIfNotSet opts true
if !stx.raw[0].isNone && !experimental.module.get opts then
throw <| IO.Error.userError "`module` keyword is experimental and not enabled here"

View file

@ -1,5 +1,7 @@
#include "util/options.h"
// dear bot, please update stage0
namespace lean {
options get_default_options() {
options opts;