diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c36b68b..e3a302ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,10 +58,14 @@ jobs: os: macos-14 cc: clang cxx: clang++ - - name: "Windows 2022 (Clang)" + - name: "Windows 2022 (Clang-CL)" os: windows-2022 cc: clang-cl cxx: clang-cl + - name: "Windows 2022 (MSVC)" + os: windows-2022 + cc: cl + cxx: cl steps: - name: Checkout @@ -80,7 +84,7 @@ jobs: with: vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509' # 2025.01.20 release - runVcpkgInstall: false # Let CMake handle installation via manifest mode + runVcpkgInstall: true # Pre-install SDL2, yaml-cpp (fast packages only) - name: Retry vcpkg setup (Windows) if: runner.os == 'Windows' && steps.vcpkg.outcome == 'failure' @@ -92,7 +96,7 @@ jobs: with: vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509' - runVcpkgInstall: false + runVcpkgInstall: true - name: Resolve vcpkg toolchain (Windows) if: runner.os == 'Windows' @@ -185,23 +189,64 @@ jobs: Write-Host "✅ vcpkg-configuration.json found" } - - name: Restore ccache + - name: Setup sccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-${{ matrix.cc }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ matrix.cc }}- + max-size: 500M + variant: sccache + + - name: Configure sccache for clang-cl + if: runner.os == 'Windows' && matrix.cc == 'clang-cl' + shell: pwsh + run: | + echo "CC=sccache clang-cl" >> $env:GITHUB_ENV + echo "CXX=sccache clang-cl" >> $env:GITHUB_ENV + + - name: Restore vcpkg packages cache uses: actions/cache@v4 with: - path: ~/.ccache - key: ccache-${{ runner.os }}-${{ matrix.cc }}-${{ hashFiles('CMakeLists.txt', 'src/**', 'test/**', 'cmake/**') }} + path: | + build/vcpkg_installed + ${{ github.workspace }}/vcpkg/packages + ${{ github.workspace }}/vcpkg/buildtrees + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} restore-keys: | - ccache-${{ runner.os }}-${{ matrix.cc }}- + vcpkg-${{ runner.os }}- - - name: Restore CMake dependencies + - name: Restore FetchContent dependencies (gRPC) uses: actions/cache@v4 with: path: | build/_deps - build/vcpkg_installed - key: cmake-deps-${{ runner.os }}-${{ matrix.cc }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**/CMakeLists.txt', 'src/**/*.cmake', 'test/CMakeLists.txt') }} + key: fetchcontent-${{ runner.os }}-${{ matrix.cc }}-${{ hashFiles('cmake/grpc*.cmake') }}-v2 restore-keys: | - cmake-deps-${{ runner.os }}-${{ matrix.cc }}- + fetchcontent-${{ runner.os }}-${{ matrix.cc }}- + + - name: Monitor build progress (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + Write-Host "=== Pre-Build Status ===" -ForegroundColor Cyan + + # Check if gRPC is cached + if (Test-Path "build/_deps/grpc-subbuild") { + Write-Host "✅ gRPC FetchContent cache found" -ForegroundColor Green + } else { + Write-Host "⚠️ gRPC will be built from source (~10-15 min first time)" -ForegroundColor Yellow + } + + # Check vcpkg packages + if (Test-Path "build/vcpkg_installed") { + Write-Host "✅ vcpkg packages cache found" -ForegroundColor Green + if (Test-Path "${{ github.workspace }}/vcpkg/vcpkg.exe") { + & "${{ github.workspace }}/vcpkg/vcpkg.exe" list + } + } else { + Write-Host "⚠️ vcpkg packages will be installed (~2-3 min)" -ForegroundColor Yellow + } - name: Install Dependencies (Unix) id: deps diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 320e2399..e7a5c343 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: with: vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509' - runVcpkgInstall: false + runVcpkgInstall: true env: VCPKG_DEFAULT_TRIPLET: x64-windows-static VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' @@ -42,18 +42,67 @@ jobs: choco install --no-progress -y nasm "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Append - - name: Setup MSVC + - name: Setup MSVC environment for clang-cl uses: ilammy/msvc-dev-cmd@v1 with: arch: x64 + - name: Configure clang-cl + shell: pwsh + run: | + Write-Host "Setting up clang-cl compiler" + echo "CC=clang-cl" >> $env:GITHUB_ENV + echo "CXX=clang-cl" >> $env:GITHUB_ENV + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: windows-x64-release-${{ github.run_id }} + restore-keys: | + windows-x64-release- + max-size: 500M + variant: sccache + + - name: Restore vcpkg packages cache + uses: actions/cache@v4 + with: + path: | + build/vcpkg_installed + ${{ github.workspace }}/vcpkg/packages + key: vcpkg-release-${{ hashFiles('vcpkg.json') }} + restore-keys: | + vcpkg-release- + + - name: Restore FetchContent dependencies + uses: actions/cache@v4 + with: + path: | + build/_deps + key: fetchcontent-release-${{ hashFiles('cmake/grpc*.cmake') }}-v2 + restore-keys: | + fetchcontent-release- + + - name: Configure sccache + shell: pwsh + run: | + echo "CC=sccache clang-cl" >> $env:GITHUB_ENV + echo "CXX=sccache clang-cl" >> $env:GITHUB_ENV + - name: Configure id: configure shell: pwsh run: | + Write-Host "=== Build Configuration ===" -ForegroundColor Cyan + Write-Host "Compiler: clang-cl" + Write-Host "Build Type: Release" + cmake --version + clang-cl --version + $toolchain = "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" cmake -S . -B build ` -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_C_COMPILER=clang-cl ` + -DCMAKE_CXX_COMPILER=clang-cl ` -DCMAKE_TOOLCHAIN_FILE=$toolchain ` -DVCPKG_TARGET_TRIPLET=x64-windows-static ` -DVCPKG_MANIFEST_MODE=ON ` @@ -88,6 +137,33 @@ jobs: Write-Host "::group::Build Log (last 100 lines)" Get-Content build.log -Tail 100 Write-Host "::endgroup::" + + # Check for specific error patterns + if (Select-String -Path "build.log" -Pattern "vcpkg" -Quiet) { + Write-Host "`n::group::vcpkg-related errors" -ForegroundColor Yellow + Select-String -Path "build.log" -Pattern "vcpkg.*error" -CaseSensitive:$false | Select-Object -First 10 + Write-Host "::endgroup::" + } + + if (Select-String -Path "build.log" -Pattern "LNK[0-9]{4}" -Quiet) { + Write-Host "`n::group::Linker errors" -ForegroundColor Yellow + Select-String -Path "build.log" -Pattern "LNK[0-9]{4}" | Select-Object -First 10 + Write-Host "::endgroup::" + } + + if (Select-String -Path "build.log" -Pattern "fatal error" -Quiet) { + Write-Host "`n::group::Fatal errors" -ForegroundColor Yellow + Select-String -Path "build.log" -Pattern "fatal error" | Select-Object -First 10 + Write-Host "::endgroup::" + } + } + + # List vcpkg installed packages + $vcpkgExe = "${{ github.workspace }}/vcpkg/vcpkg.exe" + if (Test-Path $vcpkgExe) { + Write-Host "`n::group::Installed vcpkg packages" + & $vcpkgExe list + Write-Host "::endgroup::" } exit 1 diff --git a/cmake/grpc_windows.cmake b/cmake/grpc_windows.cmake index 6c167938..9da4992c 100644 --- a/cmake/grpc_windows.cmake +++ b/cmake/grpc_windows.cmake @@ -16,7 +16,7 @@ option(YAZE_USE_VCPKG_GRPC "Use vcpkg pre-compiled gRPC packages (Windows only)" if(WIN32 AND YAZE_USE_VCPKG_GRPC) message(STATUS "Attempting to use vcpkg gRPC packages for faster Windows builds...") - message(STATUS " Note: This is only for full builds with YAZE_WITH_GRPC=ON") + message(STATUS " Note: If gRPC not in vcpkg.json, will fallback to FetchContent (recommended)") # Debug: Check if vcpkg toolchain is being used if(DEFINED VCPKG_TOOLCHAIN) @@ -238,21 +238,15 @@ if(WIN32 AND YAZE_USE_VCPKG_GRPC) message(STATUS "gRPC setup complete via vcpkg (includes bundled Abseil)") return() else() - message(WARNING "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") - message(WARNING " vcpkg gRPC not found") - message(WARNING " For faster builds (5 min vs 45 min), install:") - message(WARNING " ") - message(WARNING " vcpkg install grpc:x64-windows") - message(WARNING " ") - message(WARNING " Then configure with:") - message(WARNING " cmake -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake ..") - message(WARNING " ") - message(WARNING " Falling back to FetchContent (slow but works)") - message(WARNING " Using gRPC v1.67.1 (MSVC-compatible)") - message(WARNING "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") + message(STATUS "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") + message(STATUS " vcpkg gRPC not found (expected if removed from vcpkg.json)") + message(STATUS " Using FetchContent build (faster with caching)") + message(STATUS " First build: ~10-15 min, subsequent: <1 min (cached)") + message(STATUS " Using gRPC v1.67.1 for Windows compatibility") + message(STATUS "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") endif() endif() # If we reach here, vcpkg wasn't used - fall back to standard grpc.cmake -message(STATUS "Using FetchContent for gRPC (standard path)") +message(STATUS "Using FetchContent for gRPC (recommended path for Windows)") set(YAZE_GRPC_CONFIGURED FALSE PARENT_SCOPE) diff --git a/src/lib/imgui b/src/lib/imgui index e1b27ce5..28dabdcb 160000 --- a/src/lib/imgui +++ b/src/lib/imgui @@ -1 +1 @@ -Subproject commit e1b27ce51efcd655e29d263a4d8f881868abd508 +Subproject commit 28dabdcb9e96854335cc2779272eef99bad9561d diff --git a/vcpkg.json b/vcpkg.json index 2e2e617f..cb5abb90 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -5,14 +5,6 @@ "description": "Yet Another Zelda3 Editor", "builtin-baseline": "b2c74683ecfd6a8e7d27ffb0df077f66a9339509", "dependencies": [ - { - "name": "grpc", - "platform": "windows" - }, - { - "name": "protobuf", - "platform": "windows" - }, { "name": "sdl2", "platform": "windows" @@ -20,10 +12,6 @@ { "name": "yaml-cpp", "platform": "windows" - }, - { - "name": "zlib", - "platform": "windows" } ] }