From af6b261d2b66fe1f18384b566c2094dde371b700 Mon Sep 17 00:00:00 2001 From: Felix Hanau Date: Mon, 5 Feb 2024 09:22:29 -0500 Subject: [PATCH] [CI] Reduce Windows debug binary size This resolves CI failures due to running out of disk space, at least for the near term. Also drops a flag modifying features for windows_no_dbg, disabling optimizations when building for the host configuration is not necessary. --- .bazelrc | 7 ++++++- .github/workflows/test.yml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 94691d07868..269af77ccea 100644 --- a/.bazelrc +++ b/.bazelrc @@ -207,9 +207,14 @@ build:windows_no_dbg -c opt build:windows_no_dbg --copt='-O0' --host_copt='-O0' build:windows_no_dbg --copt='/Od' --host_copt='/Od' build:windows_no_dbg --copt='/INCREMENTAL:NO' --host_copt='/INCREMENTAL:NO' -build:windows_no_dbg --noincompatible_use_host_features build:windows_no_dbg --features=-smaller_binary --features=-disable_assertions_feature +# Mitigate the large size impact of Windows debug binaries somewhat by applying string merging and +# linker garbage collection. +build:windows_dbg --config=debug +build:windows_dbg --copt='/Gy' --copt='/Gw' --copt='/GF' +build:windows_dbg --linkopt='/OPT:REF' + build:windows --cxxopt='/std:c++20' --host_cxxopt='/std:c++20' build:windows --cxxopt='/await' --host_cxxopt='/await' build:windows --copt='/D_CRT_USE_BUILTIN_OFFSETOF' --host_copt='/D_CRT_USE_BUILTIN_OFFSETOF' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01a664528f0..165f4ad8856 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,10 +32,14 @@ jobs: # Windows has a custom non-debug bazel config. - os: { name : windows, image : windows-2022 } config: { suffix: '', bazel-args: --config=windows_no_dbg } + - os: { name : windows, image : windows-2022 } + config: { suffix: -debug, bazel-args: --config=windows_dbg } exclude: # Skip the matrix generated Windows non-debug config to use the one added above. - os: { name : windows, image : windows-2022 } config: { suffix: '', bazel-args: '' } + - os: { name : windows, image : windows-2022 } + config: { suffix: -debug, bazel-args: --config=debug } fail-fast: false runs-on: ${{ matrix.os.image }} name: test (${{ matrix.os.name }}${{ matrix.config.suffix }})