Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit 88dc993

Browse files
committed
fix: use Lake install's olean files over LEAN_PATH
1 parent d0896b3 commit 88dc993

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: Lake/Config/SearchPath.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def setupLeanSearchPath
3333
(leanInstall? : Option LeanInstall) (lakeInstall? : Option LakeInstall)
3434
: IO Unit := do
3535
let mut sp : SearchPath := []
36+
sp ← Lean.addSearchPathFromEnv sp
3637
if let some leanInstall := leanInstall? then
3738
sp := leanInstall.oleanDir :: sp
3839
if let some lakeInstall := lakeInstall? then
3940
sp := lakeInstall.oleanDir :: sp
40-
sp ← Lean.addSearchPathFromEnv sp
4141
Lean.searchPathRef.set sp

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,4 @@ The `lake` executable needs to know where to find the `.olean` files for the mod
280280

281281
Specifically, if Lake is co-located with `lean` (i.e., there is `lean` executable in the same directory as itself), it will assume it was installed with Lean and that both Lean and Lake are located in `<lean-home>/bin` with Lean's `.olean` files at `<lean-home/lib/lean` and Lake's `.olean` files at `<lean-home/lib/lean`. Otherwise, it will run `lean --print-prefix` to find Lean's home and assume that its `.olean` files are at `<lean-home>/lib/lean` and that `lake` is at `<lake-home>/bin/lake` with its `.olean` files at `<lake-home>/lib`.
282282

283-
This search path can be augmented by including other directories of `.olean` files in the `LEAN_PATH` environment variable. Such directories will take precedence over the initial search path, so `LEAN_PATH` can also be used to correct Lake's search if the `.olean` files for Lean (or Lake itself) are in non-standard locations.
283+
This search path can be augmented by including other directories of `.olean` files in the `LEAN_PATH` environment variable, allowing the user to correct Lake's search if the `.olean` files for Lean (or Lake itself) are in non-standard locations. However, such directories will *not* take precedence over the initial search path. This is important in development, as it prevents the Lake version being used to build Lake from using the Lake version being built's `.olean` files to elaborate Lake's `lakefile.lean` (which can lead to all kinds of errors).

0 commit comments

Comments
 (0)