omnisharp-emacs
omnisharp-emacs copied to clipboard
Automatic installation of server binaries
At least VS Code and Atom do this.
The code isn't pretty but its here https://github.com/OmniSharp/omnisharp-node-client/blob/0fa4cfbff6782420057ef731fbf4311fc376061e/lib/helpers/runtime.ts
TODO list:
- [x] installation on mac (PR #324)
- [x] someone to confirm it works (@razzmatazz) (PR #324)
- [x] sometimes wrapper script doesn't find mono on $PATH, #327 (PR #331)
- [x] installation on linux (PR #324)
- [x] someone to confirm it works
- [ ] check if we might need .net core also?
- reported by @Wozar in https://github.com/OmniSharp/omnisharp-emacs/issues/262
- [x] installation on windows (PR #330)
- [x] initial installation code
- [ ] do a
(executable-find "unzip")first before falling back to powershell for unzipping - [ ] add a check to see if .net fx is installed
- [ ] someone to confirm it works
- [ ] installation on windows (cygwin)
- [ ] someone to check if it works
Definitely :+1: Installation has always been a pain in the ass.
Just a thought: we basically do some kind of installation already, I mean for our travis build. I wonder if we could port that logic to elisp, and then the travis build could work basically the same way. But then we'd have the benefit of having an automatic installation as well.
And it would continuously get tested too, which is a huge thing!
Partially implemented, works on macOS (for me). Should be OK for Linux too. Needs little work on Windows.
Didn't apear to be THAT hard to implement as I feared, actually.
And yes, we should do the same thing on travis build. Definitely next on the list (with Windows implementation) @sp3ctum
Actually extracting a zip on emacs/windows installation appears to be problematic, unless you expect the user to download and extract unzip.exe to a known location... I'd wish to implement something that would work automatically, w/o any involvement of a user, even on Windows....
- http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00292.html
really don't want to write a pkzip parser in elisp, unless thats the last resort..
Would it work if the installation first downloaded unzip and then the server package?
On Jul 15, 2017 14:32, "Saulius Menkevičius" [email protected] wrote:
really don't want to write pkzip parser in elisp, unless thats the last resort..
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OmniSharp/omnisharp-emacs/issues/275#issuecomment-315528300, or mute the thread https://github.com/notifications/unsubscribe-auth/AASW95Yl0kOoh8uDNmIIfOJ4oc3gPxCtks5sOKNHgaJpZM4MDbJo .
@sp3ctum yes, I think it would, but I was a little bit worried that:
- I couldn't find naked unzip.exe on the net over HTTPS (yet);
- some sites do allow to download
unzip.exe, but only inside a .zip, which kind induces a chicken-n-egg problem for us :)
- some sites do allow to download
- downloading an executable over the internet from third party site injects untrusted executable from an untrusted site into user's machine..
- granted, we download omnisharp.exe inside omnisharp-roslyn-x86.zip but this is the part we can trust somewhat..
- a binary on a third-party url could go away any time, it is outside our control, thus we'd get broken functionality;
- licensing could be problem—not sure if we can download and use those .exes w/o breaking any license for them;
In other words, I am slight worried because of security implications..
I think we could:
- find some unzip.exe, maybe from gnu win32 tools page and
- host it on github releases page on our site..
this would be over https and I think GPL allows for downloading the binaries over the net and using those w/o doing any kind of linking with the app (emacs).. and emacs is in GPL, so .. don't know..
Windows has a decent shell in Powershell (which is included by default). If it would be acceptable to only support Powershell version 5 and up, you could simply run powershell -command "Expand-Archive c:\a.zip -DestinationPath c:\a".
The powershell version can be checked by running:
(substring
(shell-command-to-string "powershell -command \"(Get-Host).Version.Major\"")
0 -1)
If the the user has a version below the threshold, simply display a message that they need to extract the zip file themselves.
There are other ways to extract zip files in powershell using .NET, but checking the installed .NET version could be more trouble than it's worth.
@kimgronqvist thanks! I think using powershell will be something that will work here; also, I found a way not to require powershell v5, by using powershell script that references system.io.compression.fs directly:
- https://stackoverflow.com/a/27768628/535154
will try to implement this now
Nice! I think it would also be worthwhile to run (executable-find "unzip") first, since this will be installed on some Windows systems that use Emacs.
Some users will have unzip in their path when installing Git for Windows (which includes msys2), and some will have installed msys2 manually since many Emacs commands depends on tools like find, grep, and diff.
@kimgronqvist another good idea!
Great stuff, guys! I'm really glad you brought Powershell up Kim.
On Jul 17, 2017 16:18, "Saulius Menkevičius" [email protected] wrote:
@kimgronqvist https://github.com/kimgronqvist another good idea!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OmniSharp/omnisharp-emacs/issues/275#issuecomment-315752540, or mute the thread https://github.com/notifications/unsubscribe-auth/AASW99xqLkVTVWA3Mvb3LRPHtYTvROosks5sO17WgaJpZM4MDbJo .