Skip to content
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

Provide minimal support for Windows (fix #146) #198

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

arteymix
Copy link
Member

@arteymix arteymix commented Oct 30, 2016

Here's what's remaining:

  • setup Travis CI to perform cross-compilation and run tests with Wine
  • find or build a DLL for libfcgi
  • dist the framework for Windows
  • find an alternative to Server.fork
  • find an alternative for graceful shutdown

@arteymix arteymix force-pushed the wip/build-on-windows branch 6 times, most recently from 9d52ea2 to 4562c01 Compare October 30, 2016 20:14
@arteymix arteymix modified the milestone: 0.4.0 Nov 18, 2016
@arteymix arteymix force-pushed the wip/build-on-windows branch 3 times, most recently from d2a88aa to 677e752 Compare February 19, 2017 20:49
@codecov-io
Copy link

Codecov Report

Merging #198 into master will increase coverage by 0.66%.
The diff coverage is 80%.

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
+ Coverage   62.39%   63.06%   +0.66%     
==========================================
  Files          40       40              
  Lines        1367     1359       -8     
  Branches      170      166       -4     
==========================================
+ Hits          853      857       +4     
+ Misses        446      436      -10     
+ Partials       68       66       -2
Impacted Files Coverage Δ
src/vsgi/vsgi-server.vala 70% <ø> (ø)
src/vsgi/vsgi-socket-server.vala 81.81% <100%> (+3.03%)
src/vsgi/vsgi-application.vala 31.7% <75%> (+6.15%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f175e83...677e752. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Feb 19, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@2731149). Click here to learn what that means.
The diff coverage is 20%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #198   +/-   ##
=========================================
  Coverage          ?   61.32%           
=========================================
  Files             ?       44           
  Lines             ?     1453           
  Branches          ?      177           
=========================================
  Hits              ?      891           
  Misses            ?      499           
  Partials          ?       63
Impacted Files Coverage Δ
src/vsgi/vsgi-server.vala 73.33% <ø> (ø)
src/vsgi/vsgi-application.vala 0% <0%> (ø)
src/vsgi/vsgi-socket-server.vala 81.81% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2731149...43c4de8. Read the comment docs.

@arteymix arteymix mentioned this pull request Mar 20, 2017
@arteymix arteymix force-pushed the wip/build-on-windows branch 3 times, most recently from 74621b2 to 10170c6 Compare March 20, 2017 13:50
Make both platform-dependant 'gio-unix-2.0' and 'gio-windows-2.0'
dependencies optional and use features accordingly via 'GIO_UNIX' and
'GIO_WINDOWS' definitions.

Use 'add_project_arguments' instead of 'vala_defines'

Disable '--socket' option if 'gio-unix-2.0' is not available.

For FastCGI, use 'GLib.Win32InputStream' and 'GLib.Win32OutputStream'
and gracefully fallback with basic I/O wrapper.

Add basic cross files to target 32 and 64 bit targets with MinGW.
Prefer the first over the latter if available and fallback with a
platform-less implementation.
@ZanderBrown
Copy link

Num Test Status Time
1/18 legacy OK 0.64 s
2/18 auth OK 0.64 s
3/18 multipart OK 0.64 s
4/18 request OK 0.64 s
5/18 response OK 0.20 s
6/18 server FAIL 0.20 s
7/18 http server FAIL 0.20 s
8/18 socket server OK 0.20 s
9/18 loader OK 0.51 s
10/18 authenticate OK 0.51 s
11/18 basepath OK 0.51 s
12/18 basic OK 0.51 s
13/18 content negotiation OK 0.18 s
14/18 context OK 0.25 s
15/18 safely OK 0.25 s
16/18 router OK 0.25 s
17/18 rule route FAIL 0.20 s
18/18 status OK 0.13 s
Response Count
OK: 15
FAIL: 3
SKIP: 0
TIMEOUT: 0

The output from the failed tests:

 6/18 server                                  FAIL     0.20 s

--- command ---
C:/msys32/home/user/valum/build/tests/server-test.exe
--- stdout ---
/server/fork:
-------

 7/18 http server                             FAIL     0.20 s

--- command ---
G_TEST_SRCDIR='C:/msys32/home/user/valum/tests' C:/msys32/home/user/valum/build/tests/http-server-test.exe
--- stdout ---
/http_server/https:
-------

17/18 rule route                              FAIL     0.20 s

--- command ---
C:/msys32/home/user/valum/build/tests/rule-route-test.exe
--- stdout ---
/rule_route/to_url_from_hash: OK
/rule_route/to_url: OK
/rule_route/to_url/exclude_rule_specific_characters: OK
/rule_route/to_url/optional: OK
/rule_route/to_url/error_on_missing_parameter:
-------

Full log written to C:/msys32/home/user/valum/build/meson-logs/testlog.txt
FAILED: test
"C:/msys32/mingw32/bin/python3.exe" "C:/msys32/mingw32/bin/mesontest.py" "--no-rebuild" "--print-errorlogs"
ninja: build stopped: subcommand failed.

@arteymix
Copy link
Member Author

arteymix commented May 2, 2017

@ZanderBrown I'm aware of that :) I need to setup AppVeyor to automate the tests because I don't run Windows, though I really have no clue about doing that

@elegaanz
Copy link

elegaanz commented May 2, 2017

I have Windows on my computer, I can help on this if you want. 😃

@ZanderBrown
Copy link

@arteymix I suspected you where aware, my comment was intended more to show your progress (i.e. most stuff works). Built on Win10 32bit (MSYS2 MinGW)

@arteymix
Copy link
Member Author

arteymix commented May 2, 2017

@Bat41 Good luck!

Forking should be a no-op on non-supporting platform.

Server errors might be related with dynamic loading of implementations. It's using rpath, which is not supported I think. We might need to use an absolute path for implementations.

The rule thing needs debugging.

@ZanderBrown
Copy link

A further cause of issues maybe Windows Firewall which did popup during the tests (Admin permission is needed to publically open a port)

@arteymix
Copy link
Member Author

arteymix commented May 3, 2017

@ZanderBrown

Looks strange that you need admin right for using an unpriviledged port. It seems to me that tests are using 3003, no?

@ZanderBrown
Copy link

In my experience opening any port to the wider network sets of Windows Firewall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants