Skip to content

Commit

Permalink
chore: more informative failure
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Mar 5, 2024
1 parent 07957a2 commit 8ce1318
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/examples/SubVerso/Examples.lean
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,24 @@ partial def loadExamples (leanProject : FilePath) : IO (NameMap (NameMap Example
if !(← lakefile.pathExists) then
throw <| .userError s!"File {lakefile} doesn't exist, couldn't load project"

let lake ← findElanLake

-- Build the facet
let res ← IO.Process.output {
cmd := ← findElanLake
cmd := lake
args := #["build", ":examples"]
cwd := leanProject
-- 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 ++
"\nCommand: " ++ lake ++
decorateOut "stdout" res.stdout ++
decorateOut "stderr" res.stderr

throw <| .userError <|
"Build process failed." ++
decorateOut "stdout" res.stdout ++
Expand Down

0 comments on commit 8ce1318

Please sign in to comment.