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
[WIP] Compiling under Windows #810
Conversation
If you did anything special to compile libuv on mingw, maybe you could send them a PR? I think we should still aim to support MSVC 2013 also. |
I'm not giving up on MSVC just yet, but we might have to wait for a bit. |
Once we manage to build on mingw, the build will be integrated with travis |
I agree, extremely valuable. It would give us a way to check we're not using too many undue UNIXisms and get our types straight (travis), as well as deliver a working windows binaries to all those who need to work with windows. It would be very cool. Of course MSVC 2013 (or even 2014 if/when it's released and if it's easier, but it doesn't look like it) is also still a goal. Very nice work. |
Also @equalsraf those casts to |
Speaking of unixsms any idea if we still need to include the sys/select.h in vim.h? |
@aktau You are correct that path is the wrong one. I need to get libintl/gettext for mingw, in order to avoid it |
On a slighty different note it seems MSYS2 has a package for libuv(along with gettext and ncurses) - that might be the easiest way to go. |
Looking at os_unix_defs.h there are a bunch of defines that seem to be system independant (FILETYPE_FILE, INDENT_FILE, etc), we should probably move those into a separate header. |
Some real issues seem to be going on at fileio.c, the buf_write code for windows was likely removed and vim_tmpname seems to be event worse.
|
This is strange, the preceding code is: #if defined(UNIX)
perm = -1;
FileInfo file_info_old;
if (!os_get_file_info((char *)fname, &file_info_old)) {
newfile = TRUE;
} else {
// ...
} So, |
Also, sadly |
@aktau UNIX is undefined in my branch, that is why it is throwing the undeclared error. The code under the UNIX check should be ok for buf_write since it uses libuv anyway (at least it builds if UNIX == 1). The remainder code should probably be removed since it lacks the proper declarations anyway. I've defined TEMPNAMELEN/BASENAMELEN as 256 since that seems to be MAX_PATH for windows (as far as I can tell from stackoverflow and libuv pipes). vim_tempname is the bigger problem here, should I create a new issue for it? |
If UNIX is undefined, then it shouldn't have tried compiling the We can probably remove a lot of code, as you said. This is one more reason why the windows build is a good thing, it will allow us to notice what's superfluous and slim down the codebase even more.
Indeed, these are things that can be pretty OS-specific and I don't see a good reason for limiting all OS's to the same path length. We should probably move those defines to a platform file that CMake includes based on the OS on which it is compiling. Any input @jszakmeister?
Definitely. |
@aktau the call to os_get_file_info does not get compiled but there is second call in the #else branch that uses the same (undeclared) var name. Line numbers may differ, declaration happens at
undeclared use happens later in the #else clause of UNIX (:2583)
|
I see. That explains it ;). I notice that, for example, |
Separate issues would be better yes. In any case there are a lot of commits in this branch that are just testing glue - I will have to rebase anyway. See also sys/select.h and FILETYPE/INDENT comments above. |
Pretty sure we shouldn't need |
Moving forward a bit, it turns out the UNIX code for vim_tempnam() might work with Mingw (with a different TEMPDIRNAMES and minus mkdtemp). ''' |
There is a bunch of stuff in if_cscope.c that does not seem to be ported to libuv, same goes for filesystem bits like IS_LNK, etc |
Using a cross compiler toolchain to build this on Linux saves me a lot of trouble of having to deal with dependencies in Windows like luajit/luarocks. Following the same strategy as in #696 I've added dummy mch_* functions to try to get to the linking phase. Remember this is cross compiled I cannot be sure it actually runs yet - but here are some promising results:
The linking errors are almost the same as in #696. Next steps rebase against master and start merging the code with #696. |
@equalsraf thank you for this amazing contribution 👍 |
@timofonic no problem, you might want keep track of #5229, I will be removing this PR as soon as one or two more patches make it into master. |
The 64bit check for the libuv recipe worked for the VS generator but not for NMake.
Look for runtime dependencies diff.exe and win32yank.exe (and recursively for DLL dependencies) and install them with nvim.exe. If a dependency is missing a warning will be issued.
Winpty has x86/x64 binary builds, download them when building Neovim.
- vim-patch:0
In Windows we cannot rely on absolute install paths to point to the location of the runtime. Vim used the path of the current binary as a possible location for the runtime folder. In Neovim the install locations places the runtime folder in ../share/nvim/runtime.
This commit implements clipboard support for windows, using win32yank.
FFI unittests require header preprocessing. Previously the headers in tests/include/pre/ were preprocessed by CMake, and the Neovim/ system headers were preprocessed by lua in preprocess.lua. This commit moves all header preprocessing into CMake. The following headers are processed: 1. All headers under src/nvim/ with the exception of os/unix_defs.h and os/win_defs.h. 2. All headers under test/unit/fixtures/ 2. All headers under test/includes/pre/ Generated headers go into <builddir>/test/include/ffi-headers/.
Handling of process exit is still broken. It detects the moment when the child process exits, then quickly stops polling for process output. It should continue polling for output until the agent has scraped all of the process' output. This problem is easy to noticed by running a command like "dir && exit", but even typing "exit<ENTER>" can manifest the problem -- the "t" might not appear. winpty's Cygwin adapter handles shutdown by waiting for the agent to close the CONOUT pipe, which it does after it has scraped the child's last output. AFAIK, neovim doesn't do anything interesting when winpty closes the CONOUT pipe.
kvec.h uses "restrict" which is not defined in MSVC, but there is a definition in win_defs.h
The master branch should now have feature parity with this, closing. Keep track of windows support in #5229. I'm updating the wiki links accordingly. |
Same as here: neomake/neomake#532 I was able to get airline support only when enabled %E in error format And it's related to neomake/neomake#336
If there's an autocmd for BufReadPost that jumps to the last position, searching for the tag location sometimes results in vim printing the wrapscan warning and then requires hit-enter. Execute the search silently to suppress the warning (errors are still visible!).
Windows support is now tracked in #5229, check the wiki for Installation instructions and Build instructions
This PR is rebased for convinience, but it will be closed as soon as clipboard support goes into master.