Equations
- Lean.realPathNormalized p = do let a ← IO.FS.realPath p pure (System.FilePath.normalize a)
Equations
- Lean.modToFilePath base mod ext = System.FilePath.withExtension (Lean.modToFilePath.go base mod) ext
Equations
- Lean.modToFilePath.go base (Lean.Name.str p h a) = Lean.modToFilePath.go base p / { toString := h }
- Lean.modToFilePath.go base Lean.Name.anonymous = base
- Lean.modToFilePath.go base (Lean.Name.num a a_1 a_2) = panicWithPosWithDecl "Lean.Util.Path" "Lean.modToFilePath.go" 25 22 "ill-formed import"
A `.olean' search path.
Equations
If the package of mod
can be found in sp
, return the path with extension
ext
(lean
or olean
) corresponding to mod
. Otherwise, return none
. Does
not check whether the returned path exists.
Equations
- One or more equations did not get rendered due to their size.
Like findWithExt
, but ensures the returned path exists.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.getBuildDir = do let a ← IO.appDir pure (Option.get! (System.FilePath.parent a))
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.getBuiltinSearchPath leanSysroot = do let a ← Lean.getLibDir leanSysroot pure [a]
Equations
- Lean.addSearchPathFromEnv sp = do let val ← liftM (IO.getEnv "LEAN_PATH") match val with | none => pure sp | some val => pure (System.SearchPath.parse val ++ sp)
Initialize Lean's search path given Lean's system root and an initial search path.
The system root can be obtained via getBuildDir
(for internal use) or
findSysroot
(for external users).
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Infer module name of source file name.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Find the system root of the given lean
command
by calling lean --print-prefix
and returning the path it prints.
Defaults to trying the lean
in PATH
.
If set, the LEAN_SYSROOT
environment variable takes precedence.
Note that the called lean
binary might not be part of the system root,
e.g. in the case of elan
's proxy binary.
Users internal to Lean should use Lean.getBuildDir
instead.
Equations
- One or more equations did not get rendered due to their size.