LeanCopilot icon indicating copy to clipboard operation
LeanCopilot copied to clipboard

Windows Support

Open yangky11 opened this issue 1 year ago • 5 comments

I'm not sure how important it is to support Windows (how many Lean users actually use Windows?)

yangky11 avatar Nov 29 '23 03:11 yangky11

Is it difficult to support? I just got a Windows laptop with 4060 (8GB VRAM) GPU last night, and have successfully run 4bit-quantized Mistral 7B via https://github.com/oobabooga/text-generation-webui#one-click-installers and also via https://github.com/LostRuins/koboldcpp#windows-usage, so I can certainly help testing.

alreadydone avatar Nov 29 '23 03:11 alreadydone

Currently, the main non-Windows-compatible part is when we want a system function that's not supported by Lean (e.g., to count the number of CPUs, or check if the system is ARM64 or X64), we use some Unix-specific workaround (e.g., uname -m). It should definitely be possible to implement a separate version for Windows.

Thanks for offering to test it. We'll work on it and post updates here.

yangky11 avatar Nov 29 '23 04:11 yangky11

BTW, Windows with WSL has already been tested to work.

yangky11 avatar Nov 29 '23 04:11 yangky11

I managed to get Copilot working on Windows (WSL) after about two hours of effort, in large part because I missed the very important acronym "WSL" in the list of requirements. My workflow ended up being as follows:

  • Create a new Lean project
  • Diagnose, then find a workaround for, an unrelated bug in lake update for Windows (see https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/.60lake.20update.60.20broken.20on.20Windows.20.28.3F.29 )
  • Work out how to add a "package configuration option" to lakefile.lean
  • Install Git LFS
  • Attempt to install LeanCopilot
  • Manually fix two lines of code in the LeanCopilot lakefile.lean to make it run
  • Realize that LeanCopilot does not actually support Windows, but rather Windows WSL
  • Install Windows WSL
  • Install Lean for Ubuntu
  • Install VSCode for Ubuntu
  • Work out how to iteratively install dependencies in Ubuntu to complete VSCode installation
  • Install Lean plugin for VSCode
  • Create a new Lean project in Ubuntu
  • Delete (or move to cloud) multiple files due to low disk space
  • Attempt to install LeanCopilot
  • Install Git LFS for Ubuntu
  • Finally get LeanCopilot to install
  • Uninstall Lean plugin (as it was for Lean 3); install Lean 4 plugin instead

I think it would help users who are not already experienced in installing open source software to (a) clarify exactly how to add a package configuration option to lakefile.lean (viz., by placing it inside the "package {...}" fragment of that lean file), and (b) emphasizing that the software does not directly run in Windows itself (it took me about an hour of trying to "debug" the lean file (which was not reporting a "run_io" feature) until finally hitting the "panic! "Windows is not supported"" error message).

teorth avatar Mar 24 '24 15:03 teorth

Hi @teorth,

Thank you for your valuable suggestions. I have incorporated them into the current README.

LeanCopilot doesn't support native Windows because Lean didn't have cross-platform implementations for some features we need, so we resorted to workarounds that are Unix-specific. However, maybe that's no longer the case with the most recent version of Lean. If so, it may make sense to support Windows directly. @Peiyang-Song Can you take a look when you get a chance?

yangky11 avatar Mar 25 '24 13:03 yangky11

Windows support has been added in PR #152, primarily authored by @durant42040. Relevant instructions have been updated in the README. Thank you everyone!

Peiyang-Song avatar Apr 09 '25 09:04 Peiyang-Song