Skip to content

Commit

Permalink
[CI] Reduce Windows debug binary size
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fhanau committed Feb 22, 2024
1 parent 2100f41 commit ae47406
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})
Expand Down

0 comments on commit ae47406

Please sign in to comment.