Skip to content

Commit

Permalink
more info
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Mar 5, 2024
1 parent 8ce1318 commit 0ddab02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/examples/SubVerso/Examples.lean
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ def findElanLake : IO String := do

open System in
partial def loadExamples (leanProject : FilePath) : IO (NameMap (NameMap Example)) := do
let projectDir := ((← IO.currentDir) / leanProject).normalize
-- Validate that the path is really a Lean project
let lakefile := leanProject / "lakefile.lean"
let lakefile := projectDir / "lakefile.lean"
if !(← lakefile.pathExists) then
throw <| .userError s!"File {lakefile} doesn't exist, couldn't load project"

Expand All @@ -122,14 +123,14 @@ partial def loadExamples (leanProject : FilePath) : IO (NameMap (NameMap Example
let res ← IO.Process.output {
cmd := lake
args := #["build", ":examples"]
cwd := leanProject
cwd := projectDir
-- Unset Lake's environment variables
env := #["LAKE", "LAKE_HOME", "LAKE_PKG_URL_MAP", "LEAN_SYSROOT", "LEAN_AR", "LEAN_PATH", "LEAN_SRC_PATH", "ELAN_TOOLCHAIN"].map (·, none)
}
if res.exitCode != 0 then
IO.eprintln <|
"Build process failed." ++
"\nCWD: " ++ leanProject.toString ++
"\nCWD: " ++ projectDir.toString ++
"\nCommand: " ++ lake ++
decorateOut "stdout" res.stdout ++
decorateOut "stderr" res.stderr
Expand Down

0 comments on commit 0ddab02

Please sign in to comment.