chore: update toolchain

main
Henrik Böving 2023-09-18 22:03:27 +02:00
parent 19568c0659
commit 7e89b462f0
7 changed files with 13 additions and 13 deletions

View File

@ -19,7 +19,7 @@ the Lean search path with the path to the proper compiler from lean-toolchain
as well as all the dependencies. as well as all the dependencies.
-/ -/
def lakeSetup : IO (Except UInt32 Lake.Workspace) := do def lakeSetup : IO (Except UInt32 Lake.Workspace) := do
let (leanInstall?, lakeInstall?) ← Lake.findInstall? let (_, leanInstall?, lakeInstall?) ← Lake.findInstall?
let config := Lake.mkLoadConfig.{0} {leanInstall?, lakeInstall?} let config := Lake.mkLoadConfig.{0} {leanInstall?, lakeInstall?}
match ←(EIO.toIO' config) with match ←(EIO.toIO' config) with
| .ok config => | .ok config =>
@ -30,10 +30,10 @@ def lakeSetup : IO (Except UInt32 Lake.Workspace) := do
| .error err => | .error err =>
throw <| IO.userError err.toString throw <| IO.userError err.toString
def envOfImports (imports : List Name) : IO Environment := do def envOfImports (imports : Array Name) : IO Environment := do
importModules (imports.map (Import.mk · false)) Options.empty importModules (imports.map (Import.mk · false)) Options.empty
def loadInit (imports : List Name) : IO Hierarchy := do def loadInit (imports : Array Name) : IO Hierarchy := do
let env ← envOfImports imports let env ← envOfImports imports
pure <| Hierarchy.fromArray env.header.moduleNames pure <| Hierarchy.fromArray env.header.moduleNames
@ -55,6 +55,6 @@ def load (task : Process.AnalyzeTask) : IO (Process.AnalyzerResult × Hierarchy)
Prod.fst <$> Meta.MetaM.toIO (Process.process task) config { env := env } {} {} Prod.fst <$> Meta.MetaM.toIO (Process.process task) config { env := env } {} {}
def loadCore : IO (Process.AnalyzerResult × Hierarchy) := do def loadCore : IO (Process.AnalyzerResult × Hierarchy) := do
load <| .loadAll [`Init, `Lean, `Lake] load <| .loadAll #[`Init, `Lean, `Lake]
end DocGen4 end DocGen4

View File

@ -72,7 +72,7 @@ def sourceLinker (ws : Lake.Workspace) : IO (Name → Option DeclarationRange
let manifest ← Lake.Manifest.loadOrEmpty ws.root.manifestFile let manifest ← Lake.Manifest.loadOrEmpty ws.root.manifestFile
|>.run (Lake.MonadLog.eio .normal) |>.run (Lake.MonadLog.eio .normal)
|>.toIO (fun _ => IO.userError "Failed to load lake manifest") |>.toIO (fun _ => IO.userError "Failed to load lake manifest")
for pkg in manifest.entryArray do for pkg in manifest.packages do
match pkg with match pkg with
| .git _ _ _ url rev .. => gitMap := gitMap.insert pkg.name (getGithubBaseUrl url, rev) | .git _ _ _ url rev .. => gitMap := gitMap.insert pkg.name (getGithubBaseUrl url, rev)
| .path _ _ _ path => | .path _ _ _ path =>
@ -89,7 +89,7 @@ def sourceLinker (ws : Lake.Workspace) : IO (Name → Option DeclarationRange
else if root == `Lake then else if root == `Lake then
s!"https://github.com/leanprover/lean4/blob/{leanHash}/src/lake/{path}.lean" s!"https://github.com/leanprover/lean4/blob/{leanHash}/src/lake/{path}.lean"
else else
match ws.packageArray.find? (·.isLocalModule module) with match ws.packages.find? (·.isLocalModule module) with
| some pkg => | some pkg =>
match gitMap.find? pkg.name with match gitMap.find? pkg.name with
| some (baseUrl, commit) => s!"{baseUrl}/blob/{commit}/{path}.lean" | some (baseUrl, commit) => s!"{baseUrl}/blob/{commit}/{path}.lean"

View File

@ -84,10 +84,10 @@ def shouldRender : ModuleMember → Bool
end ModuleMember end ModuleMember
inductive AnalyzeTask where inductive AnalyzeTask where
| loadAll (load : List Name) : AnalyzeTask | loadAll (load : Array Name) : AnalyzeTask
| loadAllLimitAnalysis (analyze : List Name) : AnalyzeTask | loadAllLimitAnalysis (analyze : Array Name) : AnalyzeTask
def AnalyzeTask.getLoad : AnalyzeTask → List Name def AnalyzeTask.getLoad : AnalyzeTask → Array Name
| loadAll load => load | loadAll load => load
| loadAllLimitAnalysis load => load | loadAllLimitAnalysis load => load
@ -110,7 +110,7 @@ def process (task : AnalyzeTask) : MetaM (AnalyzerResult × Hierarchy) := do
let env ← getEnv let env ← getEnv
let relevantModules := match task with let relevantModules := match task with
| .loadAll _ => HashSet.fromArray env.header.moduleNames | .loadAll _ => HashSet.fromArray env.header.moduleNames
| .loadAllLimitAnalysis analysis => HashSet.fromArray analysis.toArray | .loadAllLimitAnalysis analysis => HashSet.fromArray analysis
let allModules := env.header.moduleNames let allModules := env.header.moduleNames
let mut res ← getAllModuleDocs relevantModules.toArray let mut res ← getAllModuleDocs relevantModules.toArray

View File

@ -11,7 +11,7 @@ def getTopLevelModules (p : Parsed) : IO (List String) := do
return topLevelModules return topLevelModules
def runSingleCmd (p : Parsed) : IO UInt32 := do def runSingleCmd (p : Parsed) : IO UInt32 := do
let relevantModules := [p.positionalArg! "module" |>.as! String |> String.toName] let relevantModules := #[p.positionalArg! "module" |>.as! String |> String.toName]
let res ← lakeSetup let res ← lakeSetup
match res with match res with
| Except.ok ws => | Except.ok ws =>

View File

@ -27,7 +27,7 @@ module_facet docs (mod) : FilePath := do
let some docGen4 ← findLeanExe? `«doc-gen4» let some docGen4 ← findLeanExe? `«doc-gen4»
| error "no doc-gen4 executable configuration found in workspace" | error "no doc-gen4 executable configuration found in workspace"
let exeJob ← docGen4.exe.fetch let exeJob ← docGen4.exe.fetch
let modJob ← mod.leanBin.fetch let modJob ← mod.leanArts.fetch
let buildDir := (← getWorkspace).root.buildDir let buildDir := (← getWorkspace).root.buildDir
let docFile := mod.filePath (buildDir / "doc") "html" let docFile := mod.filePath (buildDir / "doc") "html"
exeJob.bindAsync fun exeFile exeTrace => do exeJob.bindAsync fun exeFile exeTrace => do

BIN
lakefile.olean Normal file

Binary file not shown.

View File

@ -1 +1 @@
leanprover/lean4:v4.0.0 leanprover/lean4:v4.1.0-rc1