-
-
Notifications
You must be signed in to change notification settings - Fork 25
Support MSVC compiler #126
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
Conversation
9143216 to
9956401
Compare
I originally tested the Windows version on a local installation of the MinGW-based OCaml for Windows, and then I set up building but not testing of it in GitHub Actions.
As I recall, many tests failed, mainly because the tests themselves assumed a more Unix-like system and features that libuv itself does not implement on Windows. Are you able to install the MinGW OCaml for Windows to run the tests and get a report? Alternatively, you should be able to modify the CI workflow by adding - run: opam exec -- dune runtestor similar, after this line: Line 32 in e5b1096
and get a log. |
|
Okay; thanks! I should be able to get a baseline from what you mentioned. I'll post it to this PR; probably in a week or so. |
9956401 to
53a0c09
Compare
e1e45b5 to
68cfc58
Compare
|
Ok. Completed the baselining and rebased. Results
There are some failures in both MinGW and MSVC that shouldn't be there:
And one failure on MSVC ( Conclusions
|
Have you verified this, or is this based on the tests? Many of the tests themselves currently make assumptions about running on a Unix-like platform, and I did not port them to Windows or to being cross-platform. If this statement is based on the tests, it would require looking in detail at each test and API instead. |
| -I '%{lib:ctypes:.}' \ | ||
| -I %{ocaml_where} \ | ||
| |}^ i_option ^{| -o %{targets}; \ | ||
| fi"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell at first glance, only this change and the change to src/c/windows_version.h are necessary for Luv itself. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. The rest is regression test apparatus for Windows. If you want, I can split the PR when I get back in next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please. In the long term (not in this PR), the test suite should be made compatible by porting more of it to Windows, and then it can be run directly from the CI without intervening scripts. So I prefer not to merge the scripts, but keep them in a branch for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Branch with test scripts is https://github.com/jonahbeckford/luv/tree/0.5.11-msvctesting
- Did a force push that removes test scripts.
Sorry for the delay (still OOO). I have not seen any failures in the Luv APIs I am using internally, so I understand the point you are making. So please consider that "problem" closed. FYI: If you can point to the lines of code you think is not cross-platform, I may come back to it later and submit a PR to fix it. But as you implied that is low priority. |
68cfc58 to
b69250e
Compare
|
Thanks! Would you like a speedy release of this? |
Thanks. I don't recall and can't immediately get time to find these lines. But they concern such issues as I have the test suite deliberately assume that a |
It would be nice to have a release so I can remove the patches from the DKML Windows Opam repository, but it is not urgent since the patches are available already. So please do a release whenever it is most convenient for you. Thanks! |
Context: I'm distributing a MSVC-compiled distribution of OCaml for Windows. I am using an unreleased port of
ctypesfor MSVC which passesctypesown (large) internal test suite. I'd like to use libuv a) to test ctypes before releasing it and b) to include/recommend for the Windows distribution.This PR gets the
luvcode to compile with:/tmp/libuv), with all 400+ libuv tests passing exceptwatcher_cross_stopLUV_USE_SYSTEM_LIBUV=yes INCLUDE="$(cygpath -aw /tmp/libuv/include);$INCLUDE" LIB="$(cygpath -aw /tmp/libuv/build/Debug);$LIB" make buildThe
luvtests also build (LUV_USE_SYSTEM_LIBUV=yes INCLUDE="$(cygpath -aw /tmp/libuv/include);$INCLUDE" LIB="$(cygpath -aw /tmp/libuv/build/Debug);$LIB" PATH="/tmp/libuv/build/Debug:$PATH" make test) but there are failures during test execution:TCPtests hungfilefs_event(change)dns(getnameinfo)My immediate problem is I can't get the ordinary (GCC-compiled) Windows version of luv to build using the "official" OCaml CI image ... which means I don't have a baseline to resolve any test failures:
So ... how did you test the Windows version? Did all of your tests pass when you did?
Thanks! Jonah