-
Notifications
You must be signed in to change notification settings - Fork 644
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
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ef12c8e
GUACAMOLE-1841: Create a Cygwin build option.
jmuehlner 28821d7
GUACAMOLE-1841: Always close event handles.
jmuehlner ca84f42
GUACAMOLE-1841: Ignore stack stackdump files.
jmuehlner f38ab48
GUACAMOLE-1841: Provide an example of how to build under Windows.
jmuehlner 2a0fe85
GUACAMOLE-1841: Update build instructions to build freerdp from source.
jmuehlner b845e18
GUACAMOLE-1841: Log Windows PIDs instead of Cygwin PIDs.
jmuehlner 5ba11a9
GUACAMOLE-1841: Ensure that children get killed even under windows.
jmuehlner 5ff7fe1
More debugging stuff for why VNC gets stuck.
jmuehlner 9ab06d5
What happens if we just set the timout to 0 for WaitForMessage()?
jmuehlner 3a8a23e
yet more logging.
jmuehlner 61c451a
Maybe we can just use built in UUID functions for generating IDs?
jmuehlner 269031b
Dockerfile to test cross-compilation build.
jmuehlner c36794b
Disable the warning that's breaking the build.
jmuehlner 47931d5
Fix build.
jmuehlner c46e499
Buildy buildy
jmuehlner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,6 @@ doc/*/doxygen-output | |
|
||
# IDE metadata | ||
nbproject/ | ||
|
||
# Crash Reports | ||
**/*.stackdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get -y update | ||
RUN apt-get -y install software-properties-common | ||
|
||
RUN apt-get -y install \ | ||
autoconf \ | ||
autotools-dev \ | ||
cmake \ | ||
git \ | ||
libtool \ | ||
make \ | ||
meson \ | ||
pkg-config \ | ||
wget \ | ||
zstd \ | ||
gpg \ | ||
wine \ | ||
gcc-mingw-w64-x86-64-win32 \ | ||
gcc-mingw-w64-x86-64-win32-runtime | ||
|
||
COPY scripts/install-msys2.sh /install-msys2.sh | ||
RUN bash /install-msys2.sh | ||
|
||
RUN mkdir /guacamole-server | ||
COPY . /guacamole-server | ||
|
||
COPY /scripts/build-guac.sh /build-guac.sh | ||
RUN bash /build-guac.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Building guacamole-server for Windows | ||
The `guacamole-server` Windows build relies on compatibility features provided by Cygwin (most notably, a `fork()` implmentation), and therefore _must_ be built using Cygwin tools. Since no Cygwin cross-compilation environment exists, this means that `guacamole-server` can only be built for Windows using the Windows OS. This document describes a build that produces a working `guacd.exe`, as well as shared libraries for every supported protocol. | ||
|
||
## Build Specifics | ||
In this example, `guacamole-server` was built under Cygwin, on a Windows Server 2022 x86_64 build node. Dependencies were installed using packages from Cygwin and MSYS2 (and built from source where no suitable package is available, in the case of `libtelnet` and `libfreerdp2`). | ||
|
||
### Build Steps | ||
1. Install Cygwin (version 2.926 used here) | ||
2. Install MSYS2 (version 20230718 used here) | ||
3. Install Cygwin packages: | ||
* autoconf | ||
* automake | ||
* cmake | ||
* git | ||
* gcc-core | ||
* libtool | ||
* libuuid-devel | ||
* make | ||
* pkg-config | ||
4. Install MSYS2 packages: | ||
* autoconf-wrapper | ||
* automake-wrapper | ||
* diffutils | ||
* make | ||
* mingw-w64-x86_64-gcc | ||
* mingw-w64-x86_64-cairo | ||
* mingw-w64-x86_64-pango | ||
* mingw-w64-x86_64-libwebsockets | ||
* mingw-w64-x86_64-libvncserver | ||
* mingw-w64-x86_64-libssh2 | ||
* mingw-w64-x86_64-libtool | ||
* mingw-w64-x86_64-libmariadbclient | ||
* mingw-w64-x86_64-postgresql | ||
* mingw-w64-x86_64-libpng | ||
* mingw-w64-x86_64-libjpeg | ||
* mingw-w64-x86_64-dlfcn | ||
* mingw-w64-x86_64-pkg-config | ||
* mingw-w64-x86_64-pulseaudio | ||
* mingw-w64-x86_64-libvorbis | ||
* mingw-w64-x86_64-libwebp | ||
* mingw-w64-x86_64-zlib | ||
5. Build `libtelnet` from source using MSYS2 bash shell | ||
``` | ||
curl -s -L https://github.com/seanmiddleditch/libtelnet/releases/download/0.23/libtelnet-0.23.tar.gz | tar xz | ||
cd libtelnet-0.23 | ||
|
||
autoreconf -fi | ||
./configure --disable-static --disable-util LDFLAGS="-Wl,-no-undefined" | ||
|
||
make LDFLAGS="-no-undefined" | ||
make install | ||
|
||
# Required for the Cygwin build to understand how to link against this DLL | ||
ln -s /usr/bin/msys-telnet-2.dll /usr/bin/libtelnet.dll | ||
``` | ||
5. Build `libfreerdp2` from source using Cygwin bash shell | ||
``` | ||
curl -s -L https://github.com/FreeRDP/FreeRDP/archive/2.10.0/FreeRDP-2.10.0.tar.gz | tar xz | ||
cd FreeRDP-2.10.0 | ||
|
||
cmake \ | ||
-DWITH_ALSA=OFF \ | ||
-DWITH_CUPS=OFF \ | ||
-DWITH_CHANNELS=ON \ | ||
-DBUILTIN_CHANNELS=OFF \ | ||
-DCHANNEL_URBDRC=OFF \ | ||
-DWITH_CLIENT=ON \ | ||
-DWITH_DIRECTFB=OFF \ | ||
-DWITH_FFMPEG=OFF \ | ||
-DWITH_GSM=OFF \ | ||
-DWITH_GSSAPI=OFF \ | ||
-DWITH_GSTREAMER_1_0=OFF \ | ||
-DWITH_GSTREAMER_0_10=OFF \ | ||
-DWITH_IPP=OFF \ | ||
-DWITH_JPEG=ON \ | ||
-DWITH_MANPAGES=ON \ | ||
-DWITH_OPENH264=OFF \ | ||
-DWITH_OPENSSL=ON \ | ||
-DWITH_PCSC=OFF \ | ||
-DWITH_PULSE=OFF \ | ||
-DWITH_SERVER=OFF \ | ||
-DWITH_SERVER_INTERFACE=OFF \ | ||
-DWITH_SHADOW_X11=OFF \ | ||
-DWITH_SHADOW_MAC=OFF \ | ||
-DWITH_SSE2=$SSE2_SETTING \ | ||
-DWITH_WAYLAND=OFF \ | ||
-DWITH_X11=OFF \ | ||
-DWITH_X264=OFF \ | ||
-DWITH_XCURSOR=ON \ | ||
-DWITH_XEXT=ON \ | ||
-DWITH_XKBFILE=ON \ | ||
-DWITH_XI=OFF \ | ||
-DWITH_XINERAMA=OFF \ | ||
-DWITH_XRENDER=OFF \ | ||
-DWITH_XTEST=OFF \ | ||
-DWITH_XV=OFF \ | ||
-DWITH_ZLIB=ON \ | ||
. | ||
cmake . -G"Unix Makefiles" | ||
make | ||
make install | ||
``` | ||
7. Build `guacamole-server` from source using Cygwin bash shell | ||
``` | ||
# FIXME: Update this to check out master once this PR is ready for merge | ||
git clone https://github.com/jmuehlner/guacamole-server.git | ||
cd guacamole-server | ||
git checkout GUACAMOLE-1841-cygwin-build | ||
|
||
autoreconf -fi | ||
export LDFLAGS="-L/usr/bin/ -L/usr/lib/ -L/usr/local/lib -L/usr/local/bin -L/cygdrive/c/msys64/mingw64/bin -L/cygdrive/c/msys64/mingw64/lib -L/cygdrive/c/msys64/usr/bin" | ||
export CFLAGS="-idirafter /cygdrive/c/msys64/mingw64/include/winpr2 -idirafter /usr/include/ -idirafter /cygdrive/c/msys64/mingw64/include -idirafter /cygdrive/c/msys64/mingw64/include/pango-1.0 -idirafter /cygdrive/c/msys64/mingw64/include/cairo -idirafter /usr/local/include/freerdp2 -idirafter /cygdrive/c/msys64/mingw64/include/glib-2.0 -idirafter /cygdrive/c/msys64/mingw64/include/harfbuzz -idirafter /cygdrive/c/msys64/mingw64/lib/glib-2.0/include -idirafter /cygdrive/c/msys64/usr/include" | ||
export PKG_CONFIG_PATH="/cygdrive/c/msys64/mingw64/lib/pkgconfig/:/usr/local/lib/pkgconfig" | ||
./configure --with-cygwin || cat config.log | ||
make | ||
``` | ||
|
||
## Closing Notes | ||
The generated `guacd.exe` will run as expected when invoked from the Cygwin bash shell, but when run outside of a Cygwin environment (e.g. using powershell), connections using text-based protocols (ssh, telnet, kubernetes) will fail with `Fontconfig error: Cannot load default config file`. | ||
|
||
FIXME: Update this document to explain how to configure fonts under Windows once I figure it out. | ||
|
||
In addition, to enable running `guacd.exe` outside of a Cygwin environment, all (non-system) DLLs that it depends on should be copied into the same directory as the executable. These can be found by running `ldd` in the Cygwin bash shell - e.g. | ||
``` | ||
ldd /usr/local/sbin/guacd.exe | ||
find /usr -name '*guac*.dll' | xargs ldd | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
wget -qO- https://www.cairographics.org/releases/pixman-0.42.2.tar.gz | tar xz | ||
pushd pixman-0.42.2 | ||
|
||
./configure --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 \ | ||
CPPFLAGS="-I/usr/x86_64-w64-mingw32/include" LDFLAGS="-L/usr/x86_64-w64-mingw32/lib/" | ||
make | ||
make install | ||
popd | ||
|
||
wget -qO- https://www.cairographics.org/releases/cairo-1.18.0.tar.xz | tar xJ | ||
pushd cairo-1.18.0 | ||
|
||
meson setup --cross-file /x86_64-w64-mingw32.txt build-mingw | ||
meson compile -C build-mingw | ||
meson install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
#set -e | ||
|
||
cd guacamole-server | ||
|
||
export PKG_CONFIG_PATH="/quasi-msys2/root/ucrt64/lib/pkgconfig/" | ||
export LDFLAGS="-L/quasi-msys2/root/ucrt64/bin/" | ||
export CFLAGS="-I/quasi-msys2/root/ucrt64/include/ -I/usr/x86_64-w64-mingw32/include" | ||
|
||
autoreconf -fi | ||
./configure --host=x86_64-w64-mingw32 --with-cygwin --with-telnet=no --with-ssh=no --with-rdp=no --with-vnc=no --disable-kubernetes --disable-guacenc --disable-guacd --disable-guaclog | ||
|
||
cat config.log | ||
|
||
make | ||
make install |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: