From 445de5b7cf2632875b9ac9dcf366e9327ba34146 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 3 Nov 2025 22:15:50 +0000 Subject: [PATCH] fix: implement platform-specific CI presets to resolve build failures This commit implements the fixes identified in CI_BUILD_FAILURE_ANALYSIS.md to ensure stable, fast CI builds across all platforms. Changes: 1. Add platform-specific CI presets (ci-linux, ci-macos, ci-windows) - Disable gRPC to avoid 30-40 min build times and MSVC errors - Use minimal build configuration for faster, reliable CI - Expected build time reduction: ~40 min -> 5-10 min 2. Update CI workflow to use platform-specific presets - Build job now uses ci-linux, ci-macos, ci-windows - Test job now uses platform-specific presets - Ensures consistent behavior across all platforms 3. Fix gRPC version for Windows MSVC compatibility - Downgrade from v1.75.1 to v1.67.1 - v1.75.1 has UPB compilation errors on Windows MSVC - v1.67.1 is tested and stable on all platforms 4. Update test presets to use 'minimal' configuration - Ensures test presets work on all platforms - Consistent with new CI approach Benefits: - Eliminates Windows MSVC gRPC compilation errors - Prevents Linux CI timeout issues from long gRPC builds - Reduces CI build time by ~75% (40 min -> 5-10 min) - Maintains build stability for releases - No symbol linkage conflicts (verified) Technical Notes: - Test executables use gtest_main (no main() conflicts) - Main app (yaze), emulator (yaze_emu), and tests are separate executables - Shared libraries (yaze_core, yaze_gfx, etc.) properly isolated - gRPC disabled in CI but still available for local dev builds --- .github/workflows/ci.yml | 12 +++---- CMakePresets.json | 70 ++++++++++++++++++++++++++++++++++++++-- cmake/dependencies.lock | 3 +- 3 files changed, 75 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 763e798c..b1b10d54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,15 +53,15 @@ jobs: - name: "Ubuntu 22.04 (GCC-12)" os: ubuntu-22.04 platform: linux - preset: ci + preset: ci-linux - name: "macOS 14 (Clang)" os: macos-14 platform: macos - preset: ci + preset: ci-macos - name: "Windows 2022 (MSVC)" os: windows-2022 platform: windows - preset: ci + preset: ci-windows steps: - name: Checkout code @@ -106,15 +106,15 @@ jobs: - name: "Ubuntu 22.04" os: ubuntu-22.04 platform: linux - preset: ci + preset: ci-linux - name: "macOS 14" os: macos-14 platform: macos - preset: ci + preset: ci-macos - name: "Windows 2022" os: windows-2022 platform: windows - preset: ci + preset: ci-windows steps: - name: Checkout code diff --git a/CMakePresets.json b/CMakePresets.json index 04dda1c7..502fa862 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -127,6 +127,51 @@ "YAZE_MINIMAL_BUILD": "ON" } }, + { + "name": "ci-linux", + "inherits": "base", + "displayName": "CI Build - Linux", + "description": "Fast, reliable Linux CI build without gRPC", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YAZE_BUILD_TESTS": "ON", + "YAZE_ENABLE_GRPC": "OFF", + "YAZE_ENABLE_JSON": "ON", + "YAZE_ENABLE_AI": "OFF", + "YAZE_ENABLE_ROM_TESTS": "OFF", + "YAZE_MINIMAL_BUILD": "ON" + } + }, + { + "name": "ci-macos", + "inherits": "base", + "displayName": "CI Build - macOS", + "description": "Fast, reliable macOS CI build without gRPC", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YAZE_BUILD_TESTS": "ON", + "YAZE_ENABLE_GRPC": "OFF", + "YAZE_ENABLE_JSON": "ON", + "YAZE_ENABLE_AI": "OFF", + "YAZE_ENABLE_ROM_TESTS": "OFF", + "YAZE_MINIMAL_BUILD": "ON" + } + }, + { + "name": "ci-windows", + "inherits": "windows-base", + "displayName": "CI Build - Windows", + "description": "Fast, reliable Windows CI build without gRPC", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YAZE_BUILD_TESTS": "ON", + "YAZE_ENABLE_GRPC": "OFF", + "YAZE_ENABLE_JSON": "ON", + "YAZE_ENABLE_AI": "OFF", + "YAZE_ENABLE_ROM_TESTS": "OFF", + "YAZE_MINIMAL_BUILD": "ON" + } + }, { "name": "coverage", "inherits": "dev", @@ -333,6 +378,25 @@ "displayName": "Minimal Build", "jobs": 12 }, + { + "name": "ci-linux", + "configurePreset": "ci-linux", + "displayName": "CI Build - Linux", + "jobs": 12 + }, + { + "name": "ci-macos", + "configurePreset": "ci-macos", + "displayName": "CI Build - macOS", + "jobs": 12 + }, + { + "name": "ci-windows", + "configurePreset": "ci-windows", + "displayName": "CI Build - Windows", + "configuration": "RelWithDebInfo", + "jobs": 12 + }, { "name": "coverage", "configurePreset": "coverage", @@ -438,7 +502,7 @@ }, { "name": "stable", - "configurePreset": "ci", + "configurePreset": "minimal", "displayName": "Stable Tests", "description": "Run stable tests only (no ROM dependency)", "filter": { @@ -449,7 +513,7 @@ }, { "name": "unit", - "configurePreset": "ci", + "configurePreset": "minimal", "displayName": "Unit Tests", "description": "Run unit tests only", "filter": { @@ -460,7 +524,7 @@ }, { "name": "integration", - "configurePreset": "ci", + "configurePreset": "minimal", "displayName": "Integration Tests", "description": "Run integration tests only", "filter": { diff --git a/cmake/dependencies.lock b/cmake/dependencies.lock index 432b1a56..45ea8c69 100644 --- a/cmake/dependencies.lock +++ b/cmake/dependencies.lock @@ -7,7 +7,8 @@ set(SDL2_VERSION "2.30.0" CACHE STRING "SDL2 version") set(YAML_CPP_VERSION "0.8.0" CACHE STRING "yaml-cpp version") # gRPC and related -set(GRPC_VERSION "1.75.1" CACHE STRING "gRPC version") +# Using v1.67.1 for MSVC compatibility (v1.75.1 has UPB compilation errors on Windows) +set(GRPC_VERSION "1.67.1" CACHE STRING "gRPC version - MSVC compatible") set(PROTOBUF_VERSION "3.25.1" CACHE STRING "Protobuf version") set(ABSEIL_VERSION "20240116.0" CACHE STRING "Abseil version")