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

lsp-fsharp: failure when installing client #3022

Open
2 of 3 tasks
Tarmil opened this issue Jul 28, 2021 · 3 comments
Open
2 of 3 tasks

lsp-fsharp: failure when installing client #3022

Tarmil opened this issue Jul 28, 2021 · 3 comments
Labels

Comments

@Tarmil
Copy link

Tarmil commented Jul 28, 2021

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command
emacs -q -l lsp-start-plain.el

where lsp-start-plain.el can be downloaded here.

Bug description

On a Windows system that has an unzip command in the PATH, the fsautocomplete client doesn't install properly.

Steps to reproduce

On Windows:

  • Put unzip.exe somewhere in the PATH.
  • Try to install lsp-fsharp.

Expected behavior

fsautocomplete installs properly.

Which Language Server did you use?

lsp-fsharp

OS

Windows

Error callstack

Contacting host: api.github.com:443
Contacting host: github.com:443
Wrote c:/Users/LDENUZ~1/AppData/Local/Temp/fsautocompleterj0Xsa.zip
The syntax of the command is incorrect.
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-c:/Users/ldenuziere/.emacs.d/.cache/lsp/fsautocomplete/fsautocomplete.dll does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Anything else?

The problem is that when unzip is present, the install function assumes that it's on a Unix system and runs a command intended for sh; but on Windows, it is misinterpreted by cmd. A possible fix would be to switch the conditions here to use powershell in priority if present:

(unzip-script (cond ((executable-find "unzip") (format "mkdir -p %s && unzip -qq %s -d %s" install-dir-full temp-file install-dir-full))
((executable-find "powershell") (format "powershell -noprofile -noninteractive -nologo -ex bypass Expand-Archive -path '%s' -dest '%s'" temp-file install-dir-full))
(t (user-error (format "Unable to unzip server - file %s cannot be extracted, please extract it manually" temp-file)))))

@Tarmil Tarmil added the bug label Jul 28, 2021
@razzmatazz
Copy link
Collaborator

On linux, at least, there is also an issue that the server installed had no permissions on the files (probably due to faulty .zip archive or unzip params?) -- I need to do chmod +rwx -R * on the extracted directory

@s-kostyaev
Copy link
Contributor

Fixed now

@Horrih
Copy link
Contributor

Horrih commented Jun 8, 2024

Hello,
Any news on this issue ?
I encountered it just today, OP's solution seems reasonable to me.

Horrih added a commit to Horrih/lsp-mode that referenced this issue Jun 9, 2024
It caused issues on windows if unzip was found on the PATH
Horrih added a commit to Horrih/lsp-mode that referenced this issue Jun 9, 2024
It caused issues on windows if unzip was found on the PATH
Horrih added a commit to Horrih/lsp-mode that referenced this issue Jun 10, 2024
It caused issues on windows if unzip was found on the PATH
Horrih added a commit to Horrih/lsp-mode that referenced this issue Jun 10, 2024
It caused issues on windows if unzip was found on the PATH
jcs090218 added a commit that referenced this issue Sep 30, 2024
It caused issues on windows if unzip was found on the PATH

Co-authored-by: Jen-Chieh Shen <jcs090218@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants