Skip to content

build: Only enable debug symbols for debug builds on non-Windows platforms#5411

Open
KananSu wants to merge 1 commit intogoogle:mainfrom
KananSu:fix/build_debug_symbols
Open

build: Only enable debug symbols for debug builds on non-Windows platforms#5411
KananSu wants to merge 1 commit intogoogle:mainfrom
KananSu:fix/build_debug_symbols

Conversation

@KananSu
Copy link
Copy Markdown
Contributor

@KananSu KananSu commented Apr 7, 2026

The -g flag was unconditionally added to cflags for all non-Windows, non-WASM builds (Linux, macOS, etc.). This causes debug symbols to be generated even in release builds, unnecessarily increasing binary size and potentially impacting build performance.

This change wraps the -g flag with a condition on is_debug, ensuring debug symbols are only generated when building in debug mode. Release builds (is_debug = false) will no longer include debug symbols by default.

…forms

The -g flag was unconditionally added to cflags for all non-Windows,
non-WASM builds (Linux, macOS, etc.). This causes debug symbols to be
generated even in release builds, unnecessarily increasing binary size
and potentially impacting build performance.

This change wraps the -g flag with a condition on `is_debug`, ensuring
debug symbols are only generated when building in debug mode. Release
builds (`is_debug = false`) will no longer include debug symbols by
default.
@KananSu KananSu requested a review from a team as a code owner April 7, 2026 07:48
@LalitMaganti
Copy link
Copy Markdown
Member

LalitMaganti commented Apr 7, 2026

Sorry but this is WAI. We intentionally do this because we often test release builds locally and it's really nice to be able to have debug symbols for profiling and debugging issues.

In release mode we have a step to strip binaries and if you want binaries without debug symbols you can use those stripped ones.

Copy link
Copy Markdown
Member

@LalitMaganti LalitMaganti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants