ci: limit the lld concurreny on windows runners (#51310)

This commit is contained in:
Robo
2026-04-24 17:18:10 +09:00
committed by GitHub
parent 9f25fc4e06
commit 0960ddc688
3 changed files with 46 additions and 2 deletions

View File

@@ -40,9 +40,14 @@ runs:
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
- name: Set GN_EXTRA_ARGS for Windows
shell: bash
if: ${{inputs.target-arch != 'x64' && inputs.target-platform == 'win' }}
if: ${{ inputs.target-platform == 'win' }}
run: |
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"${{ inputs.target-arch }}\""
# Cap lld-link threads to work around BindFlt concurrency bug in
# Windows containers (https://github.com/microsoft/Windows-Containers/issues/635).
GN_APPENDED_ARGS="$GN_EXTRA_ARGS win_linker_threads=16"
if [ "${{ inputs.target-arch }}" != "x64" ]; then
GN_APPENDED_ARGS="$GN_APPENDED_ARGS target_cpu=\"${{ inputs.target-arch }}\""
fi
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
- name: Add Clang problem matcher
shell: bash

View File

@@ -149,3 +149,4 @@ feat_allow_enabling_extensions_on_custom_protocols.patch
fix_initialize_com_on_desktopmedialistcapturethread_on_windows.patch
chore_register_node_as_a_dynamic_trace_category_prefix.patch
fix_allow_reentrancy_on_downloadmanagerimpl_observer_list.patch
feat_add_win_linker_threads_gn_arg_to_cap_lld-link_thread_count.patch

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Fri, 24 Apr 2026 11:37:59 +0900
Subject: feat: add win_linker_threads GN arg to cap lld-link thread count
Windows containers using BindFlt have a known bug with high-volume
concurrent file reads on relative paths. This seems to affect
the lld-link phase when jumped from 16->32 core ARC runners..
Should be removed when associated container bug is addressed.
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 6f728e380cc7e18230b88a3717679e3cbe2e4a54..9344528f530d485194225c3ce33886a5079ff902 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -20,6 +20,11 @@ declare_args() {
# Turn this on to have the linker output extra timing information.
win_linker_timing = false
+ # Limit the number of threads used by the linker. 0 means use the default
+ # (all available hardware threads).
+ # Set to a positive integer to cap lld-link's internal thread count.
+ win_linker_threads = 0
+
# possible values for target_winuwp_version:
# "10" - Windows UWP 10
# "8.1" - Windows RT 8.1
@@ -335,6 +340,10 @@ config("common_linker_setup") {
"/verbose:incr",
]
}
+
+ if (win_linker_threads > 0) {
+ ldflags += [ "/threads:$win_linker_threads" ]
+ }
}
config("default_cfg_compiler") {