leanprover / LeanInk

LeanInk is a command line helper tool for Alectryon which aims to ease the integration of Lean 4.
Apache License 2.0
60 stars 16 forks source link

Using `Mathlib` as an import causes `leanInk` to error #56

Open femtomc opened 10 months ago

femtomc commented 10 months ago

Description

Attempting to use leanInk with a Lean file which relies on Mathlib, and following the instructions in the README.

My file has the following imports:

import Init.Prelude
import Mathlib.Data.Nat.Basic
import Lean

If I remove these, then leanInk works without failure...

❯ leanInk a ProgrammingLanguageSemantics.lean
Starting Analysis for: "ProgrammingLanguageSemantics.lean"

But I need these, obviously.

First try, no external deps:

❯ leanInk a ProgrammingLanguageSemantics.lean
Starting Analysis for: "ProgrammingLanguageSemantics.lean"
ERROR(1): ProgrammingLanguageSemantics.lean:1:0: error: unknown package 'Mathlib'

uncaught exception: Errors during import; aborting

Second try, with external deps, using a lakefile.lean:

❯ leanInk analyze ProgrammingLanguageSemantics.lean --lake lakefile.lean
Starting Analysis for: "ProgrammingLanguageSemantics.lean"
error: unknown command 'print-paths'
uncaught exception: Using lake failed! Make sure that lake is installed!

Expected behaviour

Expected it to work, as per the README.

Environment information

Note that I was able to reproduce on current stable, and by updating the toolchain in leanInk to run on stable.