Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Reduce Windows debug binary size #1619

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading