Windows: Cygwin #873
Comments
|
Cheers It seems it is having issues building libuv, you might be interested in #810 that deals with mingw, also there is this old issue about cygwin in libuv - joyent/libuv#845 that suggests libuv does not build in cygwin due to a lack of pthread compatibility in cygwin. |
|
I do have exactly the same issue with neovim and cygwin. It would be great to find a workaround |
|
@nowox the issue above mentions another one - JuliaLang/julia#8902 that talks about cross compile (have not checked in depth). I don't have a cygwin environment here, do you have any idea if that is possible? |
|
If you can build in MSYS (1 or 2), or cross-compile from Linux to Windows using MinGW-w64, then generally you can cross-compile from Cygwin to MinGW as well - use |
|
We can cross compile from Linux to Windows with a Mingw cross compiler, I have not tested with MSYS in a while - I think the dependencies were failling to build, but this was a long time ago. |
|
Is that on master or all in #810 still? Might just try the same cross-compile recipe under Cygwin and see if it works. Also for Travis use in #810 you may find this PPA useful: https://launchpad.net/~tobydox/+archive/ubuntu/mingw-x-precise |
|
Having a cygwin (or perhaps an MSYS2) neovim package accessible to users is a huge deal, especially since "terminal vim" on Windows isn't a priority for neovim. I use cygwin vim almost exclusively (gvim on rare occaisions). My use case is that I have plugins with native components compiled under cygwin used by vim as well as using all of the terminal-related goodness you get from bash shell in POSIX environment (ie: running under tmux or connecting via ssh or using *nix tools). Would contributing to the bounty on this issue be a good way to help achieve this use case for neovim? |
|
No, sorry. If someone wants to take ownership of cygwin compatibility, it's welcome, but I don't know anyone who has interest in it. I use Windows 40 hrs/week and I can tell you that msysgit with ancient bash 3.x causes me less pain than cygwin. Neovim will certainly support
How is ssh related to cygwin-native nvim? Re: tmux, it would be better to spend efforts trying to support
You can use the cygwin unix tools via |
Seriously? When was the last time you used cygwin? It's much nicer than it used to be. In fact the "msys1 was so awful broken and unmaintained that we desperately needed a replacement" project MSYS2 is a very lightly modified fork of latest cygwin at its core. @aikeru the limiting factor is most likely libuv here. Libuv won't build on Cygwin, while the error message you get is pthread-related, that can be fixed (libuv has some workarounds for OS X and BSD which also don't have pthread_barrier) - what can't be fixed so easily is the lack of async IO in cygwin's posix layer. As I said a few months ago, generally if you can cross-compile something from Linux-to-MinGW-w64 you can cross-compile it from Cygwin with a very similar process. |
|
Frankly speaking I think that NeoVim has the huge potential to become a noble successor to Vim, but it has to be as multiplatform as Vim is. If NeoVim depends on libuv and libuv is not multiplatform this sounds like a failure of the NeoVim's implementation. In this case workarounds must be found to get an emulation layer of what NeoVim requires in libuv. Cygwin has much evolved since the begining and it is a fairly stable POSIX emulation platform now. I am using it everyday without much trouble. I really think that NeoVim has to be accessible to this platform and on any platform even the non-POSIX ones. This is what Vim is and this is what NeoVim has to be. |
At this point #810 compiles with MSVC/MSYS2/Mingw. There is no reason why you can't set the proper &shell settings to point to your Cygwin shell and tools i.e. a Neovim version built in other environment should still work with the Cygwin tools. @nowox while I understand, and agree with you (this being one of the reasons I hang around), it would be equally effective to submit patches for reintroducing Cygwin support in libuv since that also helps support other Neovim components like the lua-client.
@tkelman I took a quick glance at JuliaLang/julia, if mingw packages are available for Cygwin then one could call CMake with the same parameters as the Mingw build (and cross fingers, hoping the shell does not confuse CMake) My time around Windows boxes is limited, so I can't test for all possible combinations of compiler/environment. If anyone can give it a spin on Cygwin and let us know that would be nice |
My best shot was at tkelman/libuv@641887f - unfortunately all the epoll, inotify, etc async io syscalls are not present. You could maybe try grafting together parts of the cygwin posix API with using the native win32 IOCP API for async functionality, but it would be messy and probably ill-advised.
The cross-compilers are available. Not many libraries are though, but you can build them. It may take a few patches but it's certainly worth a shot. There's even some code in libuv that helps with distinguishing cygwin's named pipes, so you can use native console programs (like a mingw-compiled neovim, in theory) interactively in cygwin's mintty. |
Thats fine we build third-party libs statically anyway. |
|
@tkelman There are a couple of libraries I came across recently called libevent and libev http://software.schmorp.de/pkg/libev.html which abstract away from epoll etc. Sorry, I don't know if they work on Cygwin and you may have a struggle to get them accepted into libuv. |
|
The POSIX APIs that are unsupported in Cygwin can be seen here https://cygwin.com/cygwin-api/std-notimpl.html |
|
libevent is available for cygwin, though as I understand it libuv [edit: since 2012, see below] was designed as a replacement for libevent rather than to be used alongside / on top of it. libuv doesn't strictly use posix API's, it uses specific code paths for Linux vs different flavors of BSD vs Win32. |
|
Or rather, libuv formerly used libev on unix, up until 2012 - see http://nikhilm.github.io/uvbook/introduction.html#background and joyent/libuv#485 |
|
@justinmk just in case it wasn't clear, I meant, you can have a Windows machine running cygwin's sshd daemon. If you live in cygwin, *nix style paths work The Windows shell is so horribly terrible and any knowledge of *nix tooling ports over since I use Linux or Mac OS at home. I actually have a PowerShell script that download cygwin, and all the packages I need so I can just plug in and go. Libuv is also used by node.js (didn't they write that anyhow?), and I understand that the MSYS2 folks have a way to compile node.js under that. I've played with it, and if I can get NeoVim there I'd be thrilled. NeoVim's goals are hugely important to Vim's continued success and adoption. Without NeoVim, I'm forced to consider other editors with vim binding implementations, because there's just too much productivity-saving stuff out there that's difficult to achieve with vim without good async/multi-thread support - that said, there's nothing else quite like vim/cygwin or vim/MSYS2 on Windows. |
|
I also subscribe to this. NeoVim should also work on cygwin. I use cygwin pretty much in the same way as @justinmk: tmux, vifm, some python servers, vim, ssh (putty doesn't even comes close). You cannot possibily replace this with anything windows command prompt + gvim + neovim (MSVS build) has to offer. Unfortunatelly I don't have the time to contribute code to such a big project but I do contribute money to it (10$ / a month). If anybody wants to take the cygwin issue I am also willing to contribute money for this specific issue. I hope that finally we will have a cygwin native implementation of neovim. Until then, unfortunatelly I cannot do the switch from VIM (I cannot have neovim at home and on my servers and VIM at work). |
|
What's great about threads like this, I always learn something new about vim that makes me love it even more. I wish all the best to neovim, but for now I will also stick with cygwin/vim when on my Windows host. |
|
Thanks @njman for linking the libuv issue here. I did a quick test off the master branch, I can confirm libuv builds in cygwin. In fact most of our dependencies build in cygwin right of the master branch. I don't have more time right now but the biggest issues I found concerned the lua dependencies (and also jemalloc but that one is optional) More extensive notes |
|
Still no news for Cygwin? |
|
@nowos no, AFAIK no one is working on cygwin support in libuv, or in supporting async io in cygwin
Cross compile realy seems to be the best option here. At least to get a working libuv. |
|
Moving this to "todo" milestone, since libuv |
|
Then how can I build neovim in cygwin? It seems it can't build lua-related component. |
|
@sohnryang You need to post build log. And in any case I find it easier to build if you ignore top-level Makefile and install all dependencies separately, then build like any other CMake project. |
|
You'll need a recent libuv as well. |
|
See issue #7079. |
|
I think neovim can be built with cygport now. See https://github.com/cascent/neovim-cygwin |
|
Hoping that @cascent or others can share patches and/or instructions to build on cygwin. Meanwhile https://github.com/cascent/neovim-cygwin is enough to close this issue. |
|
install all dependencies the normal way, then build neovim the normal way for a random CMake application (i.e. do not use the makefile that automatically downloads and build dependencies) the cygport repo contains cygport files (like APKBUILD, PKGBUILD, etc.) for all the dependencies not available in the cygwin distribution, and describes any special commands or arguments needed to build. the cygport definitions also try to describe the required dependencies for each one. what's in my repo was built on cygwin 2.9.0. newer libuv should require slightly less patching and some ssp stuff changed in cygwin 2.10.0 so that might change things too when building neovim |
|
Would it be possible for the experts here to upload future neovim releases as binaries to the cygwin repository? |
When attempting to compile under Cygwin (64 bit, gcc 4.9.0, CMake 2.8.11.2) the "make cmake" steps fails with the following error.
Justin Keyes replied on the mailing list:
"It's unlikely to compile on cygwin, in the near term or possibly ever. It might not even be desirable, because a cygwin-compatible frontend can talk to a MinGW-compiled or MSVC-compiled backend (nvim process) over TCP."
Alas, I don't have the knowledge to fix this so there is unlikely to be much progress from me. However, I would like to point out that Cygwin currently does have its own Vim and it would be great if it could have its own neovim as well without having to jump through hoops.
There is a related issue regarding compiling under MinGW/MSVC: #696
The text was updated successfully, but these errors were encountered: