-
Notifications
You must be signed in to change notification settings - Fork 642
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
GUACAMOLE-1841: Create a Cygwin build option. #454
Conversation
|
||
if test "x$with_winsock" != "xno" | ||
if test "x$with_cygwin" = "xno" |
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.
Winsock support will be detected on Cygwin, but will induce compilation errors if an attempt is made to actually build with it:
In file included from /usr/include/w32api/winsock2.h:56,
from socket-fd.c:35:
/usr/include/w32api/psdk_inc/_fd_types.h:100:2: error: #warning "fd_set and associated macros have been defined in sys/types. This can cause runtime problems with W32 sockets" [-Werror=cpp]
100 | #warning "fd_set and associated macros have been defined in sys/types. \
| ^~~~~~~
In file included from socket-fd.c:35:
/usr/include/w32api/winsock2.h:1031:34: error: conflicting types for 'select'; have 'int(int, fd_set *, fd_set *, fd_set *, const TIMEVAL *)'
1031 | WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const TIMEVAL *timeout);
| ^~~~~~
In file included from /usr/include/sys/time.h:49,
from socket-fd.c:31:
/usr/include/sys/select.h:80:5: note: previous declaration of 'select' with type 'int(int, fd_set *, fd_set *, fd_set *, struct timeval *)'
80 | int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
| ^~~~~~
In file included from socket-fd.c:35:
/usr/include/w32api/winsock2.h:1040:34: error: conflicting types for 'gethostname'; have 'int(char *, int)'
1040 | WINSOCK_API_LINKAGE int WSAAPI gethostname(char *name,int namelen);
| ^~~~~~~~~~~
In file included from /usr/include/unistd.h:4,
from guacamole/socket-fntypes.h:31,
from guacamole/socket.h:31,
from socket-fd.c:23:
/usr/include/sys/unistd.h:286:9: note: previous declaration of 'gethostname' with type 'int(char *, size_t)' {aka 'int(char *, long unsigned int)'}
286 | int gethostname (char *__name, size_t __len);
| ^~~~~~~~~~~
c81c508
to
78cf730
Compare
* https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-getoverlappedresult#remarks. | ||
*/ | ||
OVERLAPPED overlapped = { 0 }; | ||
overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); |
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.
Should probably add a check for if CreateEvent fails.
If it fails, it returns NULL and an error message can be retrieved by calling GetLastError.
* Overlapped structure and associated event for waiting on async call. | ||
*/ | ||
OVERLAPPED overlapped = { 0 }; | ||
overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); |
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.
Should probably add a check for if CreateEvent fails.
If it fails, it returns NULL and an error message can be retrieved by calling GetLastError.
6f68d7e
to
1c98b79
Compare
e3c3fdc
to
39e1c72
Compare
b7c951b
to
39e1c72
Compare
f03b0b4
to
473ac53
Compare
46da6c8
to
462242a
Compare
320039d
to
2a0fe85
Compare
39bee57
to
afb1b36
Compare
a0d18a5
to
b4d8c1c
Compare
ff8a98f
to
5ba11a9
Compare
8b00944
to
fd9c93f
Compare
fd9c93f
to
5ff7fe1
Compare
9cc9c08
to
d3d41e2
Compare
d3d41e2
to
61c451a
Compare
49b390d
to
a911df5
Compare
a911df5
to
c46e499
Compare
I was able to build and run this successfully using Cygwin. All other protocols are working correctly, as all required libraries are either provided by Cygwin, or easily built from source.
The main difference here is that Windows named pipes are used for IPC instead of local socket pairs, since these do not work as required in Cygwin/Windows. Many other related changes flow from there.
I would greatly appreciate it if people would review this carefully and give it a try themselves, especially any Windows experts (I am decidedly not one).
TODO:
1. Figure out how to build libwebsockets to enable Kubernetes support.2. Add a README with build instructions for Cygwin.3. Figure out how to configure fonts on windows for text-based protocols