Skip to content

Add lsp-gunzip function to decompress gzipped files #2400

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

Merged
merged 5 commits into from
Dec 11, 2020

Conversation

lukel97
Copy link
Contributor

@lukel97 lukel97 commented Dec 11, 2020

Also add the :decompress argument to lsp-download-install so that dependencies can decompress themselves.
My main use case is to be able to download binaries for lsp-haskell.el, which has the binaries compressed with gzip. This way we can use dependencies like:

(lsp-dependency
 'haskell-language-server-wrapper
 '(:system "haskell-language-server-wrapper")
 `(:download :url ,(concat lsp-haskell-language-server-github-releases-url
			  (format "haskell-language-server-wrapper-%s.gz"
				  (lsp-haskell--github-system-type-suffix)))
	     :store-path ,(f-join lsp-server-install-dir "haskell" "haskell-language-server-wrapper")
	     :decompress :gzip
	     :set-executable? t))

So far I haven't add a script for windows Powershell yet, as I don't have a windows machine to test this on.

Also add decompress key to lsp-download-install so that dependencies can
decompress themselves with lsp-unzip/lsp-gunzip
@nbfalcon
Copy link
Member

Otherwise, LGTM. Perhaps @yyoncho might have some more comments.

Thank you for contributing!

@yyoncho
Copy link
Member

yyoncho commented Dec 11, 2020

So far I haven't add a script for windows Powershell yet, as I don't have a windows machine to test this on.

@kiennq - can you help with this?

@yyoncho
Copy link
Member

yyoncho commented Dec 11, 2020

So far I haven't add a script for windows Powershell yet, as I don't have a windows machine to test this on.

@kiennq - can you help with this?

Actually, I just realized that PowerShell works on linux as well. I will come up with a proposal.

@nbfalcon
Copy link
Member

There is Expand-Archive.

Co-authored-by: Nikita Bloshchanevich <[email protected]>
Co-authored-by: Nikita Bloshchanevich <[email protected]>
@nbfalcon
Copy link
Member

Expand-Archive won't work because it only supports zip, not gzip.

@lukel97
Copy link
Contributor Author

lukel97 commented Dec 11, 2020

@yyoncho
Copy link
Member

yyoncho commented Dec 11, 2020

Code looks good to me. The only thing that is missing is the windows scripts. I found this - https://scatteredcode.net/download-and-extract-gzip-tar-with-powershell/ which has gzip script but it seems like it can be used only on windows since it depends on .net(might be wrong). I think that we can merge it as it is if we change the error message: (error "Unable to find gzip' on the path, please customize lsp-gunzip-script'") to something like:

Unable to ... , please either customize ... or unzip manually path-to-arch(to location ...).

This way the user can continue the installation manually.

@@ -40,6 +40,7 @@
(require 'ht)
(require 'imenu)
(require 'inline)
(require 'jka-compr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover

@yyoncho yyoncho merged commit 261b8bc into emacs-lsp:master Dec 11, 2020
@yyoncho
Copy link
Member

yyoncho commented Dec 11, 2020

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants