mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[CI] Build Windows releases with Ninja (#7380)
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 cover (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Desktop / Prune caches (push) Waiting to run
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 cover (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Desktop / Prune caches (push) Waiting to run
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
The A/B run measured Ninja against the Visual Studio generator across ten builds: Ninja medians sit at ~17 min against ~21 for MSBuild, and more importantly Ninja already matches the Linux and macOS legs, runs the compiler itself and parallelizes the whole graph instead of one MSBuild node at a time. Single runs on shared 4-core hosts swing by minutes either way (VS and Ninja legs even ran in different Azure regions inside one matrix), so this switches on medians and engineering coherence, not on any one timing. The Ninja leg is now the release leg: it keeps the -Win10 suffix and the vcpkg scope (named after the vs2026 toolchain, whose cl.exe is unchanged, so the warm archives keep restoring), uploads PDBs from the single-config layout and ships installers to releases. The experiment scaffolding goes away with the generator it measured.
This commit is contained in:
parent
0c10798ef4
commit
fea12a74e2
2 changed files with 47 additions and 41 deletions
|
|
@ -314,26 +314,33 @@ if [[ $RUNNER_OS == macOS ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ $RUNNER_OS == Windows ]]; then
|
elif [[ $RUNNER_OS == Windows ]]; then
|
||||||
# cmake only hands MSBuild a job count when one is asked for, and without it
|
if [[ $CMAKE_GENERATOR == "Visual Studio"* ]]; then
|
||||||
# MSBuild builds a single node: one project at a time, whatever MTT does inside
|
# cmake only hands MSBuild a job count when one is asked for, and without it
|
||||||
# it. Ask for a node per core.
|
# MSBuild builds a single node: one project at a time, whatever MTT does inside
|
||||||
if [[ ! $BUILD_PARALLEL_LEVEL ]]; then
|
# it. Ask for a node per core.
|
||||||
BUILD_PARALLEL_LEVEL="${NUMBER_OF_PROCESSORS:-1}"
|
if [[ ! $BUILD_PARALLEL_LEVEL ]]; then
|
||||||
fi
|
BUILD_PARALLEL_LEVEL="${NUMBER_OF_PROCESSORS:-1}"
|
||||||
buildflags+=(--parallel "$BUILD_PARALLEL_LEVEL")
|
fi
|
||||||
|
buildflags+=(--parallel "$BUILD_PARALLEL_LEVEL")
|
||||||
|
|
||||||
# Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
# Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
||||||
# and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt
|
# and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt
|
||||||
# EnforceProcessCountAcrossBuilds makes the CL_MPCount ceiling apply across all
|
# EnforceProcessCountAcrossBuilds makes the CL_MPCount ceiling apply across all
|
||||||
# the projects the nodes are building, instead of each node running its own
|
# the projects the nodes are building, instead of each node running its own
|
||||||
# cl.exe processes and /m and MTT multiplying into an oversubscribed machine.
|
# cl.exe processes and /m and MTT multiplying into an oversubscribed machine.
|
||||||
buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true -p:EnforceProcessCountAcrossBuilds=true -p:CL_MPCount="$BUILD_PARALLEL_LEVEL")
|
buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true -p:EnforceProcessCountAcrossBuilds=true -p:CL_MPCount="$BUILD_PARALLEL_LEVEL")
|
||||||
if [[ $BUILD_PROFILE ]]; then
|
if [[ $BUILD_PROFILE ]]; then
|
||||||
# A performance summary says which projects and tasks cost what, the binary log
|
# A performance summary says which projects and tasks cost what, the binary log
|
||||||
# keeps the full timeline; both are far too noisy to always produce. The files
|
# keeps the full timeline; both are far too noisy to always produce. The files
|
||||||
# land next to the solution, i.e. in the build dir the workflow uploads. These
|
# land next to the solution, i.e. in the build dir the workflow uploads. These
|
||||||
# join the MTT options above, which already carried the "--" separator.
|
# join the MTT options above, which already carried the "--" separator.
|
||||||
buildflags+=("-flp:PerformanceSummary;v=q;LogFile=msbuild-perf.log" -bl:msbuild.binlog)
|
buildflags+=("-flp:PerformanceSummary;v=q;LogFile=msbuild-perf.log" -bl:msbuild.binlog)
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Ninja runs the compiler itself, so it neither takes the MSBuild switches
|
||||||
|
# (it rejects -p: options outright) nor a job count: it sizes its own pool
|
||||||
|
# for the cores it finds.
|
||||||
|
echo "ninja $(ninja --version)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
43
.github/workflows/desktop-build.yml
vendored
43
.github/workflows/desktop-build.yml
vendored
|
|
@ -385,17 +385,20 @@ jobs:
|
||||||
target: 10
|
target: 10
|
||||||
runner: windows-2025 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-VS2026-Readme.md
|
runner: windows-2025 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-VS2026-Readme.md
|
||||||
|
|
||||||
# Set build_profile: 1 to have the build write an MSBuild performance
|
# Ninja builds the whole dependency graph at once instead of one
|
||||||
# summary and a binary log; empty on every entry that runs by default.
|
# MSBuild node at a time, runs the compiler itself, and matches the
|
||||||
build_profile: ''
|
# Linux and macOS legs. Its median build phase measured ~17 min
|
||||||
|
# against ~21 for the Visual Studio generator (shared 4-core hosts
|
||||||
cmake_generator: "Visual Studio 18 2026"
|
# swing either by minutes, so read medians, not single runs).
|
||||||
cmake_generator_platform: x64
|
cmake_generator: Ninja
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-Win10"
|
package_suffix: "-Win10"
|
||||||
qt_version: 6.11.*
|
qt_version: 6.11.*
|
||||||
qt_modules: qtimageformats qtmultimedia qtshadertools qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtshadertools qtwebsockets
|
||||||
type: Release
|
type: Release
|
||||||
|
# Scope is named after the vs2026 toolchain, not the generator: the
|
||||||
|
# ABI hash covers cl.exe, which is identical, so this leg keeps
|
||||||
|
# restoring the warm archives. Renaming would orphan them.
|
||||||
vcpkg_scope: 'vcpkg/windows10-x64-vs2026/'
|
vcpkg_scope: 'vcpkg/windows10-x64-vs2026/'
|
||||||
vcpkg_upload: 1 # only one leg per vcpkg_scope hands its archives over
|
vcpkg_upload: 1 # only one leg per vcpkg_scope hands its archives over
|
||||||
|
|
||||||
|
|
@ -404,7 +407,6 @@ jobs:
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
env:
|
env:
|
||||||
BUILD_PROFILE: '${{ matrix.build_profile }}'
|
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.cache/
|
CCACHE_DIR: ${{ github.workspace }}/.cache/
|
||||||
CCACHE_SIZE: 600M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
|
CCACHE_SIZE: 600M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
|
||||||
|
|
||||||
|
|
@ -492,6 +494,13 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: choco install nsis
|
run: choco install nsis
|
||||||
|
|
||||||
|
# Ninja invokes cl.exe directly and needs the MSVC environment on PATH.
|
||||||
|
- name: "[Windows] Set up MSVC environment"
|
||||||
|
if: matrix.os == 'Windows'
|
||||||
|
uses: TheMrMilchmann/setup-msvc-dev@368ef7d1ee4d1171b31d4a7f67f4d954f903f5a9 # v4.1.0
|
||||||
|
with:
|
||||||
|
arch: x64
|
||||||
|
|
||||||
- name: "Setup vcpkg cache"
|
- name: "Setup vcpkg cache"
|
||||||
id: vcpkg-cache
|
id: vcpkg-cache
|
||||||
uses: TAServers/vcpkg-cache@v3
|
uses: TAServers/vcpkg-cache@v3
|
||||||
|
|
@ -526,7 +535,6 @@ jobs:
|
||||||
BUILDTYPE: '${{ matrix.type }}'
|
BUILDTYPE: '${{ matrix.type }}'
|
||||||
CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }}
|
CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }}
|
||||||
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
|
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
|
||||||
CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }}
|
|
||||||
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
|
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
|
||||||
GITHUB_TOKEN: ${{ github.token }} # needed for vcpkg dependency graph updates, see VCPKG_FEATURE_FLAGS
|
GITHUB_TOKEN: ${{ github.token }} # needed for vcpkg dependency graph updates, see VCPKG_FEATURE_FLAGS
|
||||||
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
||||||
|
|
@ -695,6 +703,8 @@ jobs:
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
path: ${{ steps.build.outputs.path }}
|
path: ${{ steps.build.outputs.path }}
|
||||||
|
|
||||||
|
# Ninja is single-config: binaries and their PDBs land directly in the
|
||||||
|
# target directories instead of a Release subdirectory.
|
||||||
- name: "[Windows] Upload PDBs (Program Databases)"
|
- name: "[Windows] Upload PDBs (Program Databases)"
|
||||||
if: matrix.os == 'Windows' && github.ref_type != 'tag'
|
if: matrix.os == 'Windows' && github.ref_type != 'tag'
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
|
|
@ -702,20 +712,9 @@ jobs:
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
name: ${{ steps.build.outputs.name }}-PDBs
|
name: ${{ steps.build.outputs.name }}-PDBs
|
||||||
path: |
|
path: |
|
||||||
build/cockatrice/Release/*.pdb
|
build/cockatrice/*.pdb
|
||||||
build/oracle/Release/*.pdb
|
build/oracle/*.pdb
|
||||||
build/servatrice/Release/*.pdb
|
build/servatrice/*.pdb
|
||||||
|
|
||||||
# Written only when the matrix entry sets build_profile, so the artifact
|
|
||||||
# exists exactly on the runs that were asked to produce one.
|
|
||||||
- name: "[Windows] Upload MSBuild binary log"
|
|
||||||
if: always() && matrix.os == 'Windows' && env.BUILD_PROFILE == '1'
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: ${{ steps.build.outputs.name }}-msbuild
|
|
||||||
path: build/msbuild.binlog
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
- name: "Upload to release"
|
- name: "Upload to release"
|
||||||
if: needs.configure.outputs.tag != null && matrix.make_package == '1'
|
if: needs.configure.outputs.tag != null && matrix.make_package == '1'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue