From 61d2159d63b9969455ba341c6a1603c972e66c4d Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 24 May 2024 14:16:33 -0700 Subject: [PATCH 1/2] feat: support ecsact_cli --debug flag --- ecsact/private/ecsact_binary.bzl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ecsact/private/ecsact_binary.bzl b/ecsact/private/ecsact_binary.bzl index 7be4b16..7de4c7f 100644 --- a/ecsact/private/ecsact_binary.bzl +++ b/ecsact/private/ecsact_binary.bzl @@ -55,6 +55,11 @@ def _ecsact_binary_impl(ctx): report_filter = ctx.var.get("ECSACT_CLI_REPORT_FILTER", "errors_and_warnings") args.add("--report_filter", report_filter) + if ctx.var["COMPILATION_MODE"] == "dbg": + args.add("--debug") + if ctx.attr.debug_symbols_extension: + outputs.append(ctx.actions.declare_file("{}{}").format(ctx.attr.name, ctx.attr.debug_symbols_extension)) + compiler_config = { "compiler_type": "auto", "compiler_path": cc_toolchain.compiler_executable, @@ -150,6 +155,9 @@ _ecsact_binary = rule( "interface_library_extension": attr.string( mandatory = True, ), + "debug_symbols_extension": attr.string( + mandatory = True, + ), "linkopts": attr.string_list( mandatory = False, ), @@ -174,5 +182,12 @@ def ecsact_binary(**kwargs): "@platforms//os:wasi": "", "@platforms//os:none": "", # for non-wasi }), + debug_symbols_extension = select({ + "@platforms//os:windows": ".pdb", + "@platforms//os:linux": "", + "@platforms//os:macos": "", + "@platforms//os:wasi": "", + "@platforms//os:none": "", # for non-wasi + }), **kwargs ) From 0bd122fccbb53615e5b6eecb1f4dec7ed4ced3d0 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 24 May 2024 15:20:31 -0700 Subject: [PATCH 2/2] fix: small typo --- ecsact/private/ecsact_binary.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecsact/private/ecsact_binary.bzl b/ecsact/private/ecsact_binary.bzl index 7de4c7f..c8942c5 100644 --- a/ecsact/private/ecsact_binary.bzl +++ b/ecsact/private/ecsact_binary.bzl @@ -58,7 +58,7 @@ def _ecsact_binary_impl(ctx): if ctx.var["COMPILATION_MODE"] == "dbg": args.add("--debug") if ctx.attr.debug_symbols_extension: - outputs.append(ctx.actions.declare_file("{}{}").format(ctx.attr.name, ctx.attr.debug_symbols_extension)) + outputs.append(ctx.actions.declare_file("{}{}".format(ctx.attr.name, ctx.attr.debug_symbols_extension))) compiler_config = { "compiler_type": "auto",