From 01ab5328b1d526b14f83f6d5fca70edce567977c Mon Sep 17 00:00:00 2001 From: infinityabundance <255699974+infinityabundance@users.noreply.github.com> Date: Tue, 3 Feb 2026 00:33:55 +0000 Subject: [PATCH 1/4] Fix Windows CI: Use vcpkg manifest mode - Update vcpkg to more recent commit (01f602195983451bc83e72f4214af2cbc495aa94) - Use runVcpkgInstall: true to leverage vcpkg.json manifest - Remove separate install step (now handled by manifest mode) - Add build verification step to diagnose output path issues - Update artifact paths to handle both Release/Debug subdirs Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b8830d..97b6f13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -218,11 +218,8 @@ jobs: - name: Setup vcpkg uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: '8eb57355a4ffb410a2e94c07b4dca2dffbee8e50' - - - name: Install dependencies - run: | - vcpkg install sdl2:x64-windows libsodium:x64-windows opus:x64-windows + vcpkgGitCommitId: '01f602195983451bc83e72f4214af2cbc495aa94' + runVcpkgInstall: true - name: Configure CMake run: | @@ -234,11 +231,23 @@ jobs: - name: Build run: cmake --build build --config ${{ matrix.build-type }} + - name: Verify build + run: | + if (Test-Path "build/${{ matrix.build-type }}/rootstream-client.exe") { + Write-Host "✓ Windows client built successfully" + Get-Item "build/${{ matrix.build-type }}/rootstream-client.exe" + } else { + Write-Host "Looking for built executable..." + Get-ChildItem -Recurse build -Filter "*.exe" | ForEach-Object { $_.FullName } + } + - name: Upload Windows client uses: actions/upload-artifact@v4 with: name: rootstream-windows-${{ matrix.build-type }} - path: build/${{ matrix.build-type }}/rootstream-client.exe + path: | + build/${{ matrix.build-type }}/rootstream-client.exe + build/rootstream-client.exe if-no-files-found: warn cmake-linux-build: From b94457b2a5b5229577f10da9c010412cf786f0a2 Mon Sep 17 00:00:00 2001 From: infinityabundance <255699974+infinityabundance@users.noreply.github.com> Date: Tue, 3 Feb 2026 00:41:40 +0000 Subject: [PATCH 2/4] Use pre-installed vcpkg on Windows runners Windows GitHub runners have vcpkg pre-installed at C:\vcpkg. Using this instead of cloning from scratch is more reliable and faster. - Remove lukka/run-vcpkg action in favor of pre-installed vcpkg - Use explicit vcpkg.exe install command with triplet - Add caching for installed packages - Fix PowerShell path separators Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97b6f13..490dfe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,6 +207,9 @@ jobs: strategy: matrix: build-type: [Release, Debug] + env: + VCPKG_ROOT: C:\vcpkg + VCPKG_DEFAULT_TRIPLET: x64-windows steps: - name: Checkout code @@ -215,17 +218,23 @@ jobs: - name: Setup MSVC uses: microsoft/setup-msbuild@v2 - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11 + - name: Cache vcpkg packages + uses: actions/cache@v4 with: - vcpkgGitCommitId: '01f602195983451bc83e72f4214af2cbc495aa94' - runVcpkgInstall: true + path: C:\vcpkg\installed + key: vcpkg-win-x64-${{ hashFiles('vcpkg.json') }} + restore-keys: vcpkg-win-x64- + + - name: Install vcpkg dependencies + run: | + & "$env:VCPKG_ROOT\vcpkg.exe" integrate install + & "$env:VCPKG_ROOT\vcpkg.exe" install sdl2:x64-windows libsodium:x64-windows opus:x64-windows - name: Configure CMake run: | cmake -B build -S . ` -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ` - -DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" ` + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" ` -DVCPKG_TARGET_TRIPLET=x64-windows - name: Build @@ -233,9 +242,9 @@ jobs: - name: Verify build run: | - if (Test-Path "build/${{ matrix.build-type }}/rootstream-client.exe") { + if (Test-Path "build\${{ matrix.build-type }}\rootstream-client.exe") { Write-Host "✓ Windows client built successfully" - Get-Item "build/${{ matrix.build-type }}/rootstream-client.exe" + Get-Item "build\${{ matrix.build-type }}\rootstream-client.exe" } else { Write-Host "Looking for built executable..." Get-ChildItem -Recurse build -Filter "*.exe" | ForEach-Object { $_.FullName } From 8a78960f3b88f4c93676663fbdf5586c8053af40 Mon Sep 17 00:00:00 2001 From: infinityabundance <255699974+infinityabundance@users.noreply.github.com> Date: Tue, 3 Feb 2026 00:46:42 +0000 Subject: [PATCH 3/4] Fix vcpkg manifest mode: use install without package args In manifest mode (when vcpkg.json exists), vcpkg install should be run without individual package arguments - it reads from vcpkg.json instead. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 490dfe4..2dea06c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,7 +228,7 @@ jobs: - name: Install vcpkg dependencies run: | & "$env:VCPKG_ROOT\vcpkg.exe" integrate install - & "$env:VCPKG_ROOT\vcpkg.exe" install sdl2:x64-windows libsodium:x64-windows opus:x64-windows + & "$env:VCPKG_ROOT\vcpkg.exe" install --triplet x64-windows - name: Configure CMake run: | From 83ffdc9cc4d30063af11d22e6e2b39472d1e5630 Mon Sep 17 00:00:00 2001 From: infinityabundance <255699974+infinityabundance@users.noreply.github.com> Date: Tue, 3 Feb 2026 00:56:20 +0000 Subject: [PATCH 4/4] Add cross-platform packed struct support for MSVC MSVC doesn't understand GCC's __attribute__((packed)) syntax. Add PACKED_STRUCT and PACKED_STRUCT_END macros that use: - __pragma(pack(push, 1)) / __pragma(pack(pop)) for MSVC - __attribute__((packed)) for GCC/Clang Fixes Windows build errors in packet_header_t, control_packet_t, and input_event_pkt_t struct definitions. Co-Authored-By: Claude Opus 4.5 --- include/rootstream.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/include/rootstream.h b/include/rootstream.h index 668d3f5..07862b1 100644 --- a/include/rootstream.h +++ b/include/rootstream.h @@ -7,6 +7,15 @@ /* Platform abstraction for cross-platform socket types */ #include "../src/platform/platform.h" +/* Cross-platform packed struct support */ +#ifdef _MSC_VER + #define PACKED_STRUCT __pragma(pack(push, 1)) struct + #define PACKED_STRUCT_END __pragma(pack(pop)) +#else + #define PACKED_STRUCT struct __attribute__((packed)) + #define PACKED_STRUCT_END +#endif + /* * ============================================================================ * RootStream - Secure Peer-to-Peer Game Streaming @@ -155,7 +164,7 @@ typedef struct { * ============================================================================ */ /* Packet header (always plaintext for routing) */ -typedef struct __attribute__((packed)) { +typedef PACKED_STRUCT { uint32_t magic; /* 0x524F4F54 "ROOT" */ uint8_t version; /* Protocol version (1) */ uint8_t type; /* Packet type (see below) */ @@ -164,6 +173,7 @@ typedef struct __attribute__((packed)) { uint16_t payload_size; /* Encrypted payload size */ uint8_t mac[CRYPTO_MAC_BYTES]; /* Authentication tag */ } packet_header_t; +PACKED_STRUCT_END /* Packet types */ #define PKT_HANDSHAKE 0x01 /* Initial key exchange */ @@ -186,17 +196,19 @@ typedef enum { } control_cmd_t; /* Control packet payload (encrypted) */ -typedef struct __attribute__((packed)) { +typedef PACKED_STRUCT { uint8_t cmd; /* control_cmd_t command */ uint32_t value; /* Command-specific value */ } control_packet_t; +PACKED_STRUCT_END /* Encrypted input event payload */ -typedef struct __attribute__((packed)) { +typedef PACKED_STRUCT { uint8_t type; /* EV_KEY, EV_REL, etc */ uint16_t code; /* Key/button code */ int32_t value; /* Value/delta */ } input_event_pkt_t; +PACKED_STRUCT_END /* ============================================================================ * PEER MANAGEMENT - Connected peer tracking