Zulip Chat Archive

Stream: lean4

Topic: lake target path


Chris Lovett (Sep 01 2022 at 00:57):

Is there a way for a lakefile.lean test script to find the target path for the lean_exe defaultTarget?

Mac (Sep 06 2022 at 15:07):

Use let exe <- findLeanExe? <name> to get the lean_exe object and exe.file to get the path.

Chris Lovett (Sep 06 2022 at 19:34):

Calling this in lake script run install yeilds:

error: .\lakefile.lean:17:20: error: failed to synthesize instance
  MonadWorkspace IO

How do I fix that?

Chris Lovett (Sep 07 2022 at 18:13):

Never mind I figured it out by looking at Actions.lean def exe:

script install (args) do
  let ws  Lake.getWorkspace
  if let some exe := ws.findLeanExe? `leanInk then
    println exe.file
  return 0

Last updated: Dec 20 2023 at 11:08 UTC