Skip to content

Commit

Permalink
Invoke elan, not lake
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Apr 17, 2024
1 parent 4a075f4 commit 9a171ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/examples/SubVerso/Examples.lean
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ partial def loadExamples (leanProject : FilePath) : IO (NameMap (NameMap Example
let lakefile := projectDir / "lakefile.lean"
if !(← lakefile.pathExists) then
throw <| .userError s!"File {lakefile} doesn't exist, couldn't load project"
let toolchainfile := projectDir / "lean-toolchain"
if !(← toolchainfile.pathExists) then
throw <| .userError s!"File {toolchainfile} doesn't exist, couldn't load project"
let toolchain := ← IO.FS.readFile toolchainfile

-- Kludge: remove variables introduced by Lake. Clearing out DYLD_LIBRARY_PATH and
-- LD_LIBRARY_PATH is useful so the version selected by Elan doesn't get the wrong shared
Expand All @@ -164,8 +168,8 @@ partial def loadExamples (leanProject : FilePath) : IO (NameMap (NameMap Example
"LEAN_SYSROOT", "LEAN_AR", "LEAN_PATH", "LEAN_SRC_PATH",
"ELAN_TOOLCHAIN", "DYLD_LIBRARY_PATH", "LD_LIBRARY_PATH"]

let cmd := "lake"
let args := #["build", ":examples"]
let cmd := "elan"
let args := #["run", toolchain, "lake", "build", ":examples"]

-- Build the facet
let res ← IO.Process.output {
Expand Down

0 comments on commit 9a171ef

Please sign in to comment.