summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2025-08-28 14:02:54 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2025-08-28 14:02:54 +0200
commit8250730d9ee6308eb7e88134fc9497a5f22cebed (patch)
tree36439a7fae2cbe512ce0b5a2991fb3daedb9260a
parent6d09010a73efd48457091629537d47c92bef64c8 (diff)
parent81361181795d27a1060ccf019ec5126dfba4c0f4 (diff)
downloadmullvadvpn-8250730d9ee6308eb7e88134fc9497a5f22cebed.tar.xz
mullvadvpn-8250730d9ee6308eb7e88134fc9497a5f22cebed.zip
Merge branch 'build-windows-windows-11-arm-arm64-in-github-ci-fails-des-2405'
-rw-r--r--.github/workflows/daemon.yml14
-rwxr-xr-xbuild-windows-modules.sh19
2 files changed, 30 insertions, 3 deletions
diff --git a/.github/workflows/daemon.yml b/.github/workflows/daemon.yml
index b31502ad63..c2e7df53eb 100644
--- a/.github/workflows/daemon.yml
+++ b/.github/workflows/daemon.yml
@@ -192,11 +192,21 @@ jobs:
with:
go-version: 1.21.3
- - name: Build Windows modules
- if: steps.cache-windows-modules.outputs.cache-hit != 'true'
+ - name: Build Windows modules (x86_64)
+ if: ${{ (steps.cache-windows-modules.outputs.cache-hit != 'true') && (matrix.config.arch == 'x64') }}
shell: bash
run: ./build-windows-modules.sh
+ - name: Build Windows modules (ARM64)
+ if: ${{ (steps.cache-windows-modules.outputs.cache-hit != 'true') && (matrix.config.arch == 'arm64') }}
+ shell: bash
+ # By default, ./build-windows-modules.sh will use 4 concurrent processes during compilation
+ # because the Windows 11 ARM runner has 4 cores:
+ # 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
+ #
+ # Cap the number of concurrent processes to something less than 4 to avoid OOM issues.
+ run: ./build-windows-modules.sh --max-concurrent-processes 3
+
- name: Build and test crates
shell: bash
env:
diff --git a/build-windows-modules.sh b/build-windows-modules.sh
index 32a1a98c05..c66556bc67 100755
--- a/build-windows-modules.sh
+++ b/build-windows-modules.sh
@@ -2,6 +2,12 @@
set -eu
+function usage {
+ echo "usage: $0 [clean] [--max-concurrent-processes <n>]"
+ echo " --max-concurrent-processes <n> Limit concurrent processes that msbuild can spawn to <n>. Defaults to number of processor cores."
+ exit 1
+}
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
@@ -22,6 +28,11 @@ ACTION=build
while [[ "$#" -gt 0 ]]; do
case $1 in
clean) ACTION="clean";;
+ --max-concurrent-processes)
+ MAX_CPUS="$2"
+ shift
+ ;;
+ help | --help) usage;;
*)
log_error "Unknown parameter: $1"
exit 1
@@ -49,8 +60,14 @@ 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
- cmd.exe "/c msbuild.exe /m $(to_win_path "$sln") /p:Configuration=$config /p:Platform=$platform"
+ cmd.exe "/c msbuild.exe $MAX_CPU_COUNT_ARG $(to_win_path "$sln") /p:Configuration=$config /p:Platform=$platform"
set +x
}