Zulip Chat Archive

Stream: lean4

Topic: best practice for running `lake` in a subdirectory.


Scott Morrison (Sep 21 2023 at 03:18):

I'm currently doing some benchmarking, where it feels natural to work deep in some subdirectory, but to be able to run lean files there.

Currently I have to jump back out to the main project directory, then run lake env lean path/to/my/file.lean.

Is there a way to stay in that directory, but either point lake to the right project root, or have it automatically walk up the directory hierarchy until it finds one? ( :ping_pong: @Mac Malone)

Mario Carneiro (Sep 21 2023 at 03:19):

does either lake env lean path/to/my/file.lean or lake env lean file.lean work when the cwd is path/to/my/?

Mario Carneiro (Sep 21 2023 at 03:20):

also lake -d=../../.. env lean file.lean

Scott Morrison (Sep 21 2023 at 03:21):

That last one works, thanks!

Scott Morrison (Sep 21 2023 at 03:21):

(The first two don't.)

Scott Morrison (Sep 21 2023 at 03:21):

Automatically walking up would be lovely, if it doesn't cause problems.

Mario Carneiro (Sep 21 2023 at 03:22):

I agree that it should walk up by default (according to the "what would rust do" principle)

Mac Malone (Sep 21 2023 at 03:39):

@Scott Morrison Feel to post walking up as a feature request issue. Seems like a nice to have.


Last updated: Dec 20 2023 at 11:08 UTC