From 0960ddc6882d3a3445136f9e579947d67c2641dd Mon Sep 17 00:00:00 2001 From: Robo Date: Fri, 24 Apr 2026 17:18:10 +0900 Subject: [PATCH] ci: limit the lld concurreny on windows runners (#51310) --- .github/actions/build-electron/action.yml | 9 ++++- patches/chromium/.patches | 1 + ..._gn_arg_to_cap_lld-link_thread_count.patch | 38 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 patches/chromium/feat_add_win_linker_threads_gn_arg_to_cap_lld-link_thread_count.patch diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 53c7224db9..3c174830f5 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -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 diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 104c1f0bd9..516a3599f4 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -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 diff --git a/patches/chromium/feat_add_win_linker_threads_gn_arg_to_cap_lld-link_thread_count.patch b/patches/chromium/feat_add_win_linker_threads_gn_arg_to_cap_lld-link_thread_count.patch new file mode 100644 index 0000000000..26e9a14d24 --- /dev/null +++ b/patches/chromium/feat_add_win_linker_threads_gn_arg_to_cap_lld-link_thread_count.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 +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") {