Skip to content

Commit

Permalink
feat: better debug build experience
Browse files Browse the repository at this point in the history
- don't delete local symbols for `debug` builds
- enable source-level debugging by default for `debug` builds

Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Jan 14, 2024
1 parent 36befe6 commit 19e679d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/native_image/builder.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ _STRICT_NATIVE_IMAGE_ARGS = [
"--strict-image-heap",
]

_DEBUG_NATIVE_IMAGE_ARGS = [
"-g",
"-H:+SourceLevelDebug",
"-H:-DeleteLocalSymbols",
]

def _expand_var(ctx, arg, context = None, vars = None):
return ctx.expand_make_variables(
"native_image",
Expand Down Expand Up @@ -77,7 +83,7 @@ def _configure_debug(ctx, args):
"""

if ctx.attr.debug:
args.add("-g")
args.add_all(_DEBUG_NATIVE_IMAGE_ARGS)

def _configure_optimization_mode(ctx, args):
"""Configure the Native Image optimization mode to match Bazel's build setting.
Expand Down

0 comments on commit 19e679d

Please sign in to comment.