Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of toolchain detection when .elan is a symlink #66

Open
JLimperg opened this issue Jul 2, 2024 · 2 comments
Open

Failure of toolchain detection when .elan is a symlink #66

JLimperg opened this issue Jul 2, 2024 · 2 comments

Comments

@JLimperg
Copy link

JLimperg commented Jul 2, 2024

Recently, when opening files in a Lean toolchain under .elan/, lean4-mode has reliably failed to start the server, with an error message from elan complaining that no default toolchain was configured. This is true and when I configured a default toolchain, the error went away, but then this toolchain would be started instead of the one to which the file belongs.

At that point, my .elan was a symlink to ~/somedir/.elan. When I removed the symlink and renamed the latter directory to .elan, the error went away. So I suspect that the toolchain detection logic checks whether a directory is under .elan/toolchains and gets confused when this is a symlink.

VSCode doesn't seem to have this issue, so maybe their detection logic can be reused.

@mekeor
Copy link
Collaborator

mekeor commented Jul 21, 2024

It'd be interesting which command lean4-mode uses to launch the language server. You could open the problematic file, then type M-: (lean4--server-cmd) RET (default binding for eval-expression) and copy the list of strings from the *Messages* buffer (which you can open with C-h e (default binding for view-echo-area-messages)) to share it with us.

@mekeor
Copy link
Collaborator

mekeor commented Nov 25, 2024

I was not able to reproduce the error: I made ~/.elan a symlink to ~/.elan.backup. I opened a file in ~/.elan/toolchains/leanprover--lean4---.../src/....lean and it works just fine.

Can you provide a minimal reproducing example?

@mekeor mekeor added this to the 5. Features and Bugs milestone Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants