TLDR; no, libuv doesn't work in Cygwin just yet, see at the bottom.
I tested using the master branch (9d3449852bd35c9283948186d0259c1bf73b8579 or later)
I installed the following in the cygwin setup
- gcc-c++ make cmake pkg-config libtool
- lua (5.2), lua-devel, lua-bit, lua-lpeg
Build third party deps
in the Neovim folder
mkdir .deps-cyg cd .deps-cyg cmake ../third-party/ -DUSE_BUNDLED_JEMALLOC=OFF -DUSE_BUNDLED_BUSTED=OFF -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_LUV=OFF -DUSE_BUNDLED_LUAROCKS=OFF make
One of the current issues is that mpack fails to build in third-party, and it also fails to build in lua 5.2 which is used in cygwin (there is a PR for that) lets build it by hand then
Here is a quick recipe for lua.5.2, that last command will prompt you for permissions
git clone https://github.com/y-stm/libmpack.git cd libmpack gcc -O2 -fPIC -I/usr/include/lua5.2 -c binding/lua/lmpack.c -o lmpack.o gcc -shared -o mpack.dll lmpack.o -llua-5.2 cygstart --action=runas cp mpack.dll /usr/lib/lua/5.2/
You can check if mpack was installed with the command
lua -e "require('mpack')"
Go back to the Neovim folder and apply the following patch (it disables the stack-protect for cygwin, since it was failing for missing symbols)
diff --git a/CMakeLists.txt b/CMakeLists.txt index 317d2a1..f5f2356 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,7 +230,7 @@ if(HAS_WVLA_FLAG) add_definitions(-Wvla) endif() -if(UNIX) +if(UNIX AND NOT CYGWIN) # -fstack-protector breaks non Unix builds even in Mingw-w64 check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG) check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
Build instructions are fairly standard
mkdir build-cyg cd build-cyg cmake .. -DDEPS_PREFIX=../.deps-cyg/usr make
Right now it fails when linking, the issue seems libuv related.
In order of importance
- no libuv support for cygwin read https://github.com/libuv/libuv/issues/832#issuecomment-216762505, TLDR https://www.cygwin.com/ml/cygwin/2015-12/msg00024.html
- Disable stack protection for cygwin?
- Fix libmpack for lua 5.2/5.3 - https://github.com/tarruda/libmpack/pull/5
- odities with luarocks. it appears to succeed but fails to install any of the rocks
- Our luajit recipe failed to build in x86_64 - this is fixed in the upcoming luajit 2.1 release
- BuildLuv needs some fixes to handle the case when USE_BUNDLED_LIBUV=OFF and USE_BUNDLED_LUAJIT=OFF
- Error building jemalloc (optional) - https://github.com/jemalloc/jemalloc/issues/285