From 2d9a2d11f46f597aac111d8055c6f360bfa9feb9 Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 9 Oct 2025 12:24:27 -0400 Subject: [PATCH] chore: Update vcpkg.json and CI workflow for improved platform-specific configurations - Updated the builtin-baseline in vcpkg.json to '01f602195983451bc83e72f4214af2cbc495aa94' for consistency with the latest vcpkg release. - Enhanced the CI workflow by separating CMake configuration steps for Windows, macOS, and Linux, improving clarity and error handling. - Improved error reporting for CMake configuration failures across different platforms, ensuring better diagnostics in CI logs. --- .github/workflows/release.yml | 83 ++++++++++++++++++--------- src/cli/handlers/overworld_inspect.cc | 22 +++---- vcpkg.json | 6 +- 3 files changed, 72 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5685382a..af0bdf54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -194,38 +194,66 @@ jobs: brew install ninja cmake pkg-config fi - - name: "Configure" - id: configure + - name: "Configure (Windows)" + if: runner.os == 'Windows' + id: configure_windows + shell: pwsh + run: | + Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan + + $vcpkgToolchain = "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -replace '\\', '/' + Write-Host "Using vcpkg toolchain: $vcpkgToolchain" + + cmake -B build -G "Visual Studio 17 2022" -A x64 ` + -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE ` + -DCMAKE_TOOLCHAIN_FILE="$vcpkgToolchain" ` + -DYAZE_BUILD_TESTS=OFF ` + -DYAZE_BUILD_EMU=OFF ` + -DYAZE_BUILD_Z3ED=ON 2>&1 | Tee-Object -FilePath cmake_config.log + + if ($LASTEXITCODE -ne 0) { + Write-Host "::error::CMake configuration failed with exit code $LASTEXITCODE" + exit $LASTEXITCODE + } + + Write-Host "::endgroup::" + + - name: "Configure (macOS)" + if: runner.os == 'macOS' + id: configure_macos shell: bash run: | set -e - echo "::group::CMake Configuration" - if [[ "${{ runner.os }}" == "Windows" ]]; then - cmake -B build -G "Visual Studio 17 2022" -A x64 \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ - -DYAZE_BUILD_TESTS=OFF \ - -DYAZE_BUILD_EMU=OFF \ - -DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log - elif [[ "${{ runner.os }}" == "macOS" ]]; then - cmake -B build -G Ninja \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DCMAKE_OSX_ARCHITECTURES=${{ matrix.mac_arch }} \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \ - -DYAZE_BUILD_TESTS=OFF \ - -DYAZE_BUILD_EMU=OFF \ - -DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log - else - cmake -B build -G Ninja \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DYAZE_BUILD_TESTS=OFF \ - -DYAZE_BUILD_EMU=OFF \ - -DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log - fi + echo "::group::CMake Configuration (macOS)" + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DCMAKE_OSX_ARCHITECTURES=${{ matrix.mac_arch }} \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \ + -DYAZE_BUILD_TESTS=OFF \ + -DYAZE_BUILD_EMU=OFF \ + -DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log + echo "::endgroup::" + + - name: "Configure (Linux)" + if: runner.os == 'Linux' + id: configure_linux + shell: bash + run: | + set -e + echo "::group::CMake Configuration (Linux)" + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DYAZE_BUILD_TESTS=OFF \ + -DYAZE_BUILD_EMU=OFF \ + -DYAZE_BUILD_Z3ED=ON 2>&1 | tee cmake_config.log echo "::endgroup::" - name: "Report Configure Failure" - if: failure() && steps.configure.outcome == 'failure' + if: | + failure() && + (steps.configure_windows.outcome == 'failure' || + steps.configure_macos.outcome == 'failure' || + steps.configure_linux.outcome == 'failure') shell: bash run: | echo "::error::CMake configuration failed for ${{ matrix.name }}" @@ -343,7 +371,8 @@ jobs: echo "" >> $GITHUB_STEP_SUMMARY echo "### Build Status" >> $GITHUB_STEP_SUMMARY - if [[ "${{ steps.configure.outcome }}" == "success" ]]; then + CONFIGURE_OUTCOME="${{ steps.configure_windows.outcome || steps.configure_macos.outcome || steps.configure_linux.outcome }}" + if [[ "$CONFIGURE_OUTCOME" == "success" ]]; then echo "- ✅ Configure: Success" >> $GITHUB_STEP_SUMMARY else echo "- ❌ Configure: Failed" >> $GITHUB_STEP_SUMMARY diff --git a/src/cli/handlers/overworld_inspect.cc b/src/cli/handlers/overworld_inspect.cc index fd03617e..be719c81 100644 --- a/src/cli/handlers/overworld_inspect.cc +++ b/src/cli/handlers/overworld_inspect.cc @@ -102,21 +102,21 @@ void PopulateCommonWarpFields(WarpEntry& entry, uint16_t raw_map_id, absl::StatusOr ParseNumeric(std::string_view value, int base) { try { - size_t processed = 0; - int result = std::stoi(std::string(value), &processed, base); - if (processed != value.size()) { - return absl::InvalidArgumentError( - absl::StrCat("Invalid numeric value: ", value)); - } - return result; - } catch (const std::exception&) { + size_t processed = 0; + int result = std::stoi(std::string(value), &processed, base); + if (processed != value.size()) { return absl::InvalidArgumentError( - absl::StrCat("Invalid numeric value: ", value)); + absl::StrCat("Invalid numeric value: ", std::string(value))); } + return result; +} catch (const std::exception&) { + return absl::InvalidArgumentError( + absl::StrCat("Invalid numeric value: ", std::string(value))); +} } absl::StatusOr ParseWorldSpecifier(std::string_view value) { - std::string lower = absl::AsciiStrToLower(value); + std::string lower = absl::AsciiStrToLower(std::string(value)); if (lower == "0" || lower == "light") { return 0; } @@ -127,7 +127,7 @@ absl::StatusOr ParseWorldSpecifier(std::string_view value) { return 2; } return absl::InvalidArgumentError( - absl::StrCat("Unknown world value: ", value)); + absl::StrCat("Unknown world value: ", std::string(value))); } absl::StatusOr InferWorldFromMapId(int map_id) { diff --git a/vcpkg.json b/vcpkg.json index a793a92b..06b1a4aa 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,7 +3,7 @@ "name": "yaze", "version": "0.3.2", "description": "Yet Another Zelda3 Editor", - "builtin-baseline": "a42af01b72c28a8e1d7b48107b33e4f286a55ef6", + "builtin-baseline": "01f602195983451bc83e72f4214af2cbc495aa94", "dependencies": [ { "name": "sdl2", @@ -22,6 +22,10 @@ { "name": "zlib", "platform": "windows" + }, + { + "name": "openssl", + "platform": "windows" } ], "overrides": [