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

Elan installation fails on Windows #562

Closed
Timmmm opened this issue Dec 28, 2024 · 5 comments
Closed

Elan installation fails on Windows #562

Timmmm opened this issue Dec 28, 2024 · 5 comments

Comments

@Timmmm
Copy link

Timmmm commented Dec 28, 2024

Using Windows 10, if I install the Lean VSCode extension and click to install the Lean version manager I get some nonsense code signing error:

image

For google:

File C:\program files\powershell\7\Modules\PSReadline\PSReadLine.format.ps1xml is published by CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
@Timmmm
Copy link
Author

Timmmm commented Dec 28, 2024

Following the manual instructions I get this error:

> powershell -ExecutionPolicy Bypass -f elan-init.ps1
info: downloading installer to C:\Users\Tim\AppData\Local\Temp\
Download failed for https://github.com/leanprover/elan/releases/latest/download/elan-x86_64-pc-windows-msvc.zip
1

@Timmmm
Copy link
Author

Timmmm commented Dec 28, 2024

The error message can be improved via Write-Host $_ (PR). Then this turns out to give the same error as #349.

Download failed for https://github.com/leanprover/elan/releases/latest/download/elan-x86_64-pc-windows-msvc.zip
Object reference not set to an instance of an object.
1

@mhuisi mhuisi transferred this issue from leanprover/vscode-lean Jan 7, 2025
@mhuisi
Copy link
Collaborator

mhuisi commented Jan 7, 2025

There seem to be three separate issues in this report:

  1. PowerShell can sometimes ask for input when running the installation script in VS Code, causing it to fail. I believe that this issue is ultimately a duplicate of installation fails if a startup script in the terminal asks for input #558. The specific instance of this problem in your case seems to be caused by a strange system setup: why is PSReadLine, an auto-loaded script by Microsoft, not trusted on your system? It seems like your PowerShell installation is also very old, since it prompts about PowerShell Core 6.0, which was released in 2016.
  2. Downloading Elan from https://github.com/leanprover/elan/releases/latest/download/elan-x86_64-pc-windows-msvc.zip appears to fail when running the installer manually. If the issue still occurs with an up-to-date Windows 10 and PowerShell version (e.g. PowerShell 7 - please confirm this before making a report, it's unlikely that someone will work on this issue if it is caused by your system being outdated since before 2016), you should report this over at leanprover/elan.
  3. The error message when the manual installer fails is bad.

@Timmmm
Copy link
Author

Timmmm commented Jan 7, 2025

If the issue still occurs with an up-to-date Windows 10 and PowerShell version (e.g. PowerShell 7 - please confirm this before making a report, it's unlikely that someone will work on this issue if it is caused by your system being outdated since before 2016)

Yeah I'm on an up-to-date Windows 10 with PowerShell 7.

This PR fixes the download failure: leanprover/elan#155

This PR fixes the bad error message: leanprover/elan#153

I guess technically this issue should be in the elan repo since the fixes are there.

@mhuisi
Copy link
Collaborator

mhuisi commented Jan 7, 2025

Thanks :-)

Since you have essentially already reported issue 2 and 3 at the Elan repository and issue 1 is a duplicate of #558, do you agree that this issue in vscode-lean4 can be closed?

@Timmmm Timmmm closed this as completed Jan 7, 2025
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