2
Some checks failed
Build Eden Emulator / Build Windows (Wine + MSYS2) (push) Failing after 19m8s
Build Eden Emulator / Build Linux (push) Failing after 28m19s

This commit is contained in:
2025-12-26 21:53:12 -03:00
parent 22c2044e95
commit 0f5bb0f44d
2 changed files with 177 additions and 64 deletions

View File

@@ -76,10 +76,10 @@ jobs:
name: eden-linux-x64
path: eden-linux-x64.tar.gz
retention-days: 30
build-windows-mingw:
name: Build Windows (MinGW Cross-Compile)
build-windows-wine:
name: Build Windows (Wine + MSYS2)
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Checkout repository
@@ -87,94 +87,207 @@ jobs:
with:
submodules: recursive
- name: Install MinGW and dependencies
- name: Install Wine and dependencies
run: |
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo apt-get update
sudo apt-get install -y \
mingw-w64 g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 \
cmake ninja-build git nasm autoconf libtool \
pkg-config python3 wget unzip
sudo apt-get install -y --install-recommends winehq-stable
sudo apt-get install -y wget unzip p7zip-full xvfb cabextract
- name: Set up MinGW toolchain
wine --version
- name: Setup Xvfb for headless display
run: |
cat > mingw-toolchain.cmake << EOF
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &
sleep 2
echo "DISPLAY=:99" >> $GITHUB_ENV
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_CROSSCOMPILING_EMULATOR wine64)
EOF
- name: Configure CMake for Windows
- name: Initialize Wine prefix
run: |
cmake -S . -B build-windows \
-DCMAKE_TOOLCHAIN_FILE=mingw-toolchain.cmake \
export WINEPREFIX=$HOME/.wine-eden
export WINEARCH=win64
export WINEDEBUG=-all
wineboot -u
sleep 5
echo "WINEPREFIX=$HOME/.wine-eden" >> $GITHUB_ENV
echo "WINEARCH=win64" >> $GITHUB_ENV
echo "WINEDEBUG=-all" >> $GITHUB_ENV
- name: Download and Install MSYS2
run: |
# Download MSYS2 base
wget https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20231026.tar.xz
# Extract to Wine prefix
mkdir -p $WINEPREFIX/drive_c/msys64
tar -xf msys2-base-x86_64-20231026.tar.xz -C $WINEPREFIX/drive_c/
# Setup MSYS2 environment
echo "export MSYS2_PATH_TYPE=inherit" > $WINEPREFIX/drive_c/msys64/etc/profile.d/wine.sh
ls -la $WINEPREFIX/drive_c/msys64/
- name: Initialize MSYS2 in Wine
run: |
# Run MSYS2 bash to initialize
wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman-key --init" || true
sleep 2
wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman-key --populate msys2" || true
sleep 2
wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman -Sy --noconfirm" || true
- name: Install MSYS2 Build Dependencies
run: |
# Install MinGW packages
wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "pacman -S --noconfirm --needed \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-ninja \
mingw-w64-x86_64-qt6-base \
mingw-w64-x86_64-qt6-tools \
mingw-w64-x86_64-qt6-translations \
mingw-w64-x86_64-qt6-svg \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-fmt \
mingw-w64-x86_64-lz4 \
mingw-w64-x86_64-nlohmann-json \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-zstd \
mingw-w64-x86_64-opus \
mingw-w64-x86_64-mbedtls \
mingw-w64-x86_64-libusb \
mingw-w64-x86_64-SDL2 \
mingw-w64-x86_64-vulkan-headers \
mingw-w64-x86_64-vulkan-loader \
mingw-w64-x86_64-glslang \
mingw-w64-x86_64-spirv-tools \
mingw-w64-x86_64-ffmpeg \
git \
make \
autoconf \
automake \
libtool \
patch \
python" || echo "Some packages may have failed to install"
- name: Download Vulkan SDK for Windows
run: |
wget https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan-sdk.exe
# Try silent install
wine vulkan-sdk.exe /S || echo "Vulkan SDK install attempted"
sleep 10
- name: Setup build script
run: |
cat > build-eden.sh << 'EOFSCRIPT'
#!/bin/bash
set -e
export PATH="/c/msys64/mingw64/bin:/c/msys64/usr/bin:$PATH"
export PKG_CONFIG_PATH="/c/msys64/mingw64/lib/pkgconfig"
cd "$(pwd)"
mkdir -p build-wine
cd build-wine
cmake .. \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="/c/msys64/mingw64" \
-DYUZU_TESTS=OFF \
-DENABLE_QT_TRANSLATION=OFF \
-DENABLE_QT=OFF \
-DYUZU_CMD=ON \
-DENABLE_QT=ON \
-DENABLE_QT_TRANSLATION=ON \
-DENABLE_SDL2=ON \
-DYUZU_USE_BUNDLED_SDL2=ON \
-DYUZU_USE_BUNDLED_FFMPEG=ON \
-DYUZU_USE_CPM=ON || echo "Configure failed, this is expected with limited MinGW support"
-DENABLE_WEB_SERVICE=ON \
-DYUZU_USE_QT_MULTIMEDIA=ON \
-DENABLE_LIBUSB=ON \
-DENABLE_OPENSSL=ON \
-DYUZU_USE_BUNDLED_QT=OFF \
-DYUZU_USE_BUNDLED_SDL2=OFF \
-DYUZU_USE_BUNDLED_FFMPEG=OFF \
-DYUZU_USE_CPM=ON
- name: Build Eden for Windows
ninja -j$(nproc)
EOFSCRIPT
chmod +x build-eden.sh
- name: Build Eden in Wine
run: |
cmake --build build-windows --parallel $(nproc) || echo "Build may have issues with MinGW cross-compilation"
# Copy build script to Wine drive
cp build-eden.sh $WINEPREFIX/drive_c/
# Copy source to Wine accessible location
rsync -av --exclude='.git' --exclude='build*' ./ $WINEPREFIX/drive_c/eden-src/
# Run build
cd $WINEPREFIX/drive_c/eden-src
wine $WINEPREFIX/drive_c/msys64/usr/bin/bash.exe -lc "/c/build-eden.sh" || echo "Build completed with potential errors"
timeout-minutes: 120
continue-on-error: true
- name: Package Windows Artifacts
run: |
mkdir -p artifacts-windows
if [ -f build-windows/bin/eden.exe ]; then
cp build-windows/bin/eden.exe artifacts-windows/
echo "eden.exe found and copied"
fi
BUILD_DIR="$WINEPREFIX/drive_c/eden-src/build-wine/bin"
if [ -f build-windows/bin/eden-cmd.exe ]; then
cp build-windows/bin/eden-cmd.exe artifacts-windows/
echo "eden-cmd.exe found and copied"
fi
if [ -d "$BUILD_DIR" ]; then
# Copy executables
find "$BUILD_DIR" -name "*.exe" -exec cp {} artifacts-windows/ \; 2>/dev/null || true
# Copy any DLLs
find build-windows/bin -name "*.dll" -exec cp {} artifacts-windows/ \; 2>/dev/null || true
# Copy DLLs
find "$BUILD_DIR" -name "*.dll" -exec cp {} artifacts-windows/ \; 2>/dev/null || true
# Copy Qt dependencies if eden.exe exists
if [ -f artifacts-windows/eden.exe ]; then
wine $WINEPREFIX/drive_c/msys64/mingw64/bin/windeployqt.exe artifacts-windows/eden.exe || true
fi
fi
# Create version info
echo "Eden Emulator - Windows Build (MinGW)" > artifacts-windows/VERSION.txt
echo "Eden Emulator - Windows Build (Wine + MSYS2)" > artifacts-windows/VERSION.txt
echo "Build Date: $(date)" >> artifacts-windows/VERSION.txt
echo "Commit: $(git rev-parse --short HEAD)" >> artifacts-windows/VERSION.txt
echo "Note: Cross-compiled with MinGW on Linux" >> artifacts-windows/VERSION.txt
echo "" >> artifacts-windows/VERSION.txt
echo "Built using:" >> artifacts-windows/VERSION.txt
echo "- Wine (Windows emulation on Linux)" >> artifacts-windows/VERSION.txt
echo "- MSYS2 MinGW-w64 toolchain" >> artifacts-windows/VERSION.txt
echo "- Qt6 for Windows" >> artifacts-windows/VERSION.txt
echo "" >> artifacts-windows/VERSION.txt
echo "Features:" >> artifacts-windows/VERSION.txt
echo "- Qt GUI: Enabled" >> artifacts-windows/VERSION.txt
echo "- SDL2: Enabled" >> artifacts-windows/VERSION.txt
echo "- OpenSSL: Enabled" >> artifacts-windows/VERSION.txt
echo "- Web Services: Enabled" >> artifacts-windows/VERSION.txt
# Check if we have any executables
if [ -f artifacts-windows/eden.exe ] || [ -f artifacts-windows/eden-cmd.exe ]; then
echo "Windows build successful"
cd artifacts-windows
zip -r ../eden-windows-x64-mingw.zip .
cd ..
if [ ! -f artifacts-windows/eden.exe ] && [ ! -f artifacts-windows/eden-cmd.exe ]; then
echo "" >> artifacts-windows/VERSION.txt
echo "BUILD STATUS: FAILED - No executables produced" >> artifacts-windows/VERSION.txt
echo "Check build logs for errors" >> artifacts-windows/VERSION.txt
else
echo "No Windows executables produced - MinGW cross-compilation may not be fully supported"
echo "This is expected - Eden emulator is complex and may require native Windows build" > artifacts-windows/BUILD_FAILED.txt
cd artifacts-windows
zip -r ../eden-windows-x64-mingw.zip .
cd ..
echo "" >> artifacts-windows/VERSION.txt
echo "BUILD STATUS: SUCCESS" >> artifacts-windows/VERSION.txt
fi
# Create archive
cd artifacts-windows
zip -r ../eden-windows-wine-msys2.zip .
cd ..
continue-on-error: true
- name: Upload Windows Build
if: always()
uses: actions/upload-artifact@v4
with:
name: eden-windows-x64-mingw
path: eden-windows-x64-mingw.zip
name: eden-windows-wine-msys2
path: eden-windows-wine-msys2.zip
retention-days: 30

View File

@@ -114,10 +114,10 @@ void LegacyOnlineService::ServerLoop() {
}
LOG_INFO(Network, "Legacy Online Server waiting for messages...");
// Set a timeout for recvfrom so check is_running periodically if not closed via socket
// Alternatively, closing the socket (as done in Stop) will cause recvfrom to return error
char buffer[2048];
while (is_running) {
sockaddr_in client_addr{};
@@ -127,7 +127,7 @@ void LegacyOnlineService::ServerLoop() {
socklen_t client_len = sizeof(client_addr);
#endif
int len = -1;
ssize_t len = -1;
#ifdef _WIN32
len = recvfrom(static_cast<SOCKET>(socket_fd), buffer, sizeof(buffer), 0, (sockaddr*)&client_addr, &client_len);
#else
@@ -142,7 +142,7 @@ void LegacyOnlineService::ServerLoop() {
#ifdef _WIN32
sendto(static_cast<SOCKET>(socket_fd), ack_msg, static_cast<int>(strlen(ack_msg)), 0, (sockaddr*)&client_addr, client_len);
#else
sendto(static_cast<int>(socket_fd), ack_msg, strlen(ack_msg), 0, (sockaddr*)&client_addr, client_len);
sendto(static_cast<int>(socket_fd), ack_msg, static_cast<socklen_t>(strlen(ack_msg)), 0, (sockaddr*)&client_addr, client_len);
#endif
} else {
// Error or closed