Stop telling msbuild how many processes it may spawn

The `/m` flag spreads work across projects, and this solution builds its
projects one after the other, so neither the flag nor the cap on it ever
changed what the build did.
This commit is contained in:
Linus committed 2026-09-18 09:50:56 +02:00
1 parent 353344e94e
commit d15946bc36
2 files changed
+3 -18

No files matched your search

+1 -5
View File
@@ -138,10 +138,6 @@ jobs:
arch: x64
- os: windows-11-arm
arch: arm64
# By default, ./build-windows-modules.sh uses one process per core,
# and the four of the Windows 11 ARM runner exhaust its memory:
# https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job#standard-github-hosted-runners-for-public-repositories
windows-modules-build-flags: --max-concurrent-processes 2
runs-on: ${{ matrix.config.os }}
steps:
# By default, the longest path a filename can have in git on Windows is 260 character.
@@ -166,7 +162,7 @@ jobs:
# only an incremental rebuild would read. Deleting them keeps the cache
# saved at the end of the job down to the linked libraries.
run: |
./build-windows-modules.sh ${{ matrix.config['windows-modules-build-flags'] }} build winfw
./build-windows-modules.sh build winfw
rm -rf windows/*/bin/temp
# Excluding windows-installer because it builds an actual full installer
+2 -13
View File
@@ -3,8 +3,7 @@
set -eu
function usage {
echo "usage: $0 [clean|build] [--max-concurrent-processes <n>] [solution...]"
echo " --max-concurrent-processes <n> Limit concurrent processes that msbuild can spawn to <n>. Defaults to number of processor cores."
echo "usage: $0 [clean|build] [solution...]"
exit 1
}
@@ -32,10 +31,6 @@ while [[ "$#" -gt 0 ]]; do
build) ACTION="build";;
winfw) SOLUTIONS+=(winfw);;
nsis-plugins) SOLUTIONS+=(nsis-plugins);;
--max-concurrent-processes)
MAX_CPUS="$2"
shift
;;
help | --help) usage;;
*)
log_error "Unknown parameter: $1"
@@ -78,19 +73,13 @@ function build_solution_config {
local config="$2"
local platform="$3"
if [ -z ${MAX_CPUS+x} ]; then
MAX_CPU_COUNT_ARG="/m"
else
MAX_CPU_COUNT_ARG="/m:${MAX_CPUS}"
fi
set -x
# Note: We've seen issues in CI (Windows ARM) indicating that the amount of memory that VS is allowed to reserve
# for pre-compiled headers is too small. '/Zm' allow us to tweak this value. /Zm100 is the default, and the value
# represents a multiplier expressed in percents. That is, /Zm400 equates to 4x the amount of memory VS is allowed
# to reserve compared to the default value. This parameter may be subject to tweaking if the issue persists.
# /Zm200 was not enough from our empirical testing, so /Zm400 was semi-arbitrarily chosen for now.
cmd.exe "/c msbuild.exe $MAX_CPU_COUNT_ARG $(to_win_path "$sln") /p:Configuration=$config /p:Platform=$platform /p:AdditionalOptions=/Zm400"
cmd.exe "/c msbuild.exe $(to_win_path "$sln") /p:Configuration=$config /p:Platform=$platform /p:AdditionalOptions=/Zm400"
set +x
}