From d0ba99f381ee519698464670782821c438a4b8f3 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 16 May 2026 08:36:59 +0200 Subject: [PATCH] Updates the Windows CI workflow to build AzerothCore and mod-playerbots reliably with Ninja instead of the Visual Studio/MSBuild generator (#2383) Added a Windows CI fix to build with Ninja and avoid Windows command-line length failures. ## Pull Request Description This PR updates the Windows CI workflow to build AzerothCore + mod-playerbots reliably with Ninja instead of the Visual Studio/MSBuild generator. The previous Windows build could fail during the final `worldserver` build steps because MSBuild/RC generated command lines that exceeded Windows command-line limits. Enabling long-path support was not enough, because the failure was caused by tool command length rather than only filesystem path length. This workflow now: - installs and uses Ninja as the CMake generator; - creates an AzerothCore `conf/config.sh` for CI; - forces the compiler to MSVC `cl`; - enables CMake/Ninja response files to reduce command-line length; - moves the source tree to a short path (`C:\ac`) before configuring and building. This keeps the Windows build on MSVC while avoiding the MSBuild/RC command-line length issue. **Pros:** - Fixes Windows CI command-line length failures; - avoids unreliable `rc.exe` / `MSB6003` errors from the MSBuild generator; - keeps the build on MSVC; - makes the Windows CI build more predictable; - does not affect runtime code or bot behavior. **Cons:** - Visual Studio project files (`.vcxproj`) are no longer generated in CI; - the workflow now copies the source tree to a short path before building. ## Feature Evaluation - Minimum logic: CI-only workflow changes to use Ninja, force MSVC, enable response files, and build from a short path. - Processing cost: None at runtime. This only affects GitHub Actions build tooling. ## How to Test the Changes - Run the Windows CI workflow on GitHub Actions. - Confirm that CMake reports `-- Building for: Ninja`. - Confirm that CMake detects MSVC as the C and C++ compiler. - Confirm that the Windows build completes successfully. - Confirm that no MSBuild `MSB6003`, `rc.exe`, or Ninja `CreateProcess` command-line length errors occur. ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - [x] No, not at all - Does this change modify default bot behavior? - [x] No - Does this change add new decision branches or increase maintenance complexity? - [x] No ## AI Assistance Was AI assistance used while working on this change? - [x] No Maybe if should so i'd made less commits... ## Final Checklist - [x] Stability is not compromised. - [x] Performance impact is understood, tested, and acceptable. - [x] Added logic complexity is justified and explained. - [x] Any new bot dialogue lines are translated. - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers This change is CI-only and does not affect gameplay, bot logic, database logic, or runtime performance. The Windows workflow was failing because generated build commands became too long for Windows process creation. Switching the CI build to Ninja, forcing MSVC, enabling response files, and building from `C:\ac` fixes the issue while keeping the compiler/toolchain consistent with the Windows target. --------- Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com> Co-authored-by: bash Co-authored-by: Revision Co-authored-by: kadeshar --- .github/workflows/windows_build.yml | 92 ++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 94d6af108..17bd03f83 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -1,4 +1,5 @@ name: windows-build + on: push: branches: [ "master", "test-staging" ] @@ -6,7 +7,7 @@ on: branches: [ "master", "test-staging" ] concurrency: - group: "windows-build-${{ github.event.pull_request.number }}" + group: "windows-build-${{ github.event.pull_request.number || github.ref }}" cancel-in-progress: true jobs: @@ -15,35 +16,108 @@ jobs: fail-fast: false matrix: os: [windows-latest] + runs-on: ${{ matrix.os }} name: ${{ matrix.os }} + env: - BOOST_ROOT: C:\local\boost_1_82_0 + BOOST_ROOT: C:\local\boost_1_87_0 + CMAKE_GENERATOR: Ninja + CTOOLS_BUILD: all + steps: - name: Checkout AzerothCore - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: 'mod-playerbots/azerothcore-wotlk' ref: ${{ (github.base_ref || github.ref_name) == 'test-staging' && 'test-staging' || 'Playerbot' }} - path: 'ac' + path: a + - name: Checkout Playerbot Module - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: 'mod-playerbots/mod-playerbots' - #path: 'modules/mod-playerbots' - path: ac/modules/mod-playerbots + path: a/modules/mod-playerbots + + - name: Move source tree to short path + shell: powershell + run: | + if (Test-Path C:\ac) { + Remove-Item C:\ac -Recurse -Force + } + + New-Item -ItemType Directory -Path C:\ac | Out-Null + + robocopy "${{ github.workspace }}\a" "C:\ac" /MIR + + if ($LASTEXITCODE -le 7) { + exit 0 + } + + exit $LASTEXITCODE + + - name: Install Ninja + shell: powershell + run: | + choco install ninja -y + - name: ccache uses: hendrikmuhs/ccache-action@v1.2.13 + - name: Configure OS shell: bash - working-directory: ac + working-directory: C:\ac env: CONTINUOUS_INTEGRATION: true run: | ./acore.sh install-deps + + - name: Create AzerothCore CI config + shell: bash + working-directory: C:\ac + run: | + cat > conf/config.sh <<'EOF' + CCOMPILERC="cl" + CCOMPILERCXX="cl" + + CTYPE="Release" + CSCRIPTS="static" + CMODULES="static" + CTOOLS_BUILD="all" + + CCUSTOMOPTIONS="-DCMAKE_RC_COMPILER=rc -DCMAKE_NINJA_FORCE_RESPONSE_FILE=ON -DCMAKE_NINJA_CMCLDEPS_RC=OFF -DCMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS=ON -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON -DCMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES=ON -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES=ON -DCMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES=ON -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES=ON" + EOF + + cat conf/config.sh + + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 + with: + arch: x64 + - name: Build shell: bash - working-directory: ac + working-directory: C:\ac run: | export CTOOLS_BUILD=all + export CMAKE_GENERATOR=Ninja + + export CC=cl + export CXX=cl + export RC=rc + + cmake --version + ninja --version + + echo "CMAKE_GENERATOR=$CMAKE_GENERATOR" + echo "CC=$CC" + echo "CXX=$CXX" + + which cl || true + which rc || true + cl || true + rc || true + + rm -rf var/build/obj + ./acore.sh compiler build