Skip to content

Commit df86c35

Browse files
committed
[ABLD-464] Add dd_strip_debug: provider/rule-based split of stripped + debug outputs
**what this does** Implements Plan A (provider/rule-based) for building "dbg" packages: a new dd_strip_debug rule (bazel/rules/dd_strip/dd_strip.bzl) that wraps a go_binary/cc_binary/cc_shared_library/rust_binary target and splits it into a stripped file and a separate debug-info file/dSYM, backed by a new toolchain_type (bazel/toolchains/dd_strip/) with per-OS drivers matching omnibus's Stripper semantics (Linux: objcopy --only-keep-debug + strip + --add-gnu-debuglink, sourced from the cc_toolchain; macOS: strip + dsymutil producing a .dSYM; Windows: unstripped original as the debug artifact, mingw strip for the shipped binary). No new config_setting was needed — this reuses //:is_release and adds a toolchain_type, per the approved design. The wrapped rule's DefaultInfo always stays unstripped (build behavior for plain `bazel build //x:x` is unchanged); the split is only materialized via OutputGroupInfo(stripped=..., debug=...) or DdStripInfo. dd_pkg_files_stripped (bazel/rules/dd_packaging/dd_pkg_files_stripped.bzl) exposes those groups as sibling "<name>.stripped"/"<name>.debug" labels consumable by pkg_files. dd_cc_packaged now runs dd_strip_debug between rewrite_rpath and pkg_files/so_symlink, so all its callers (rtloader, deps/msodbcsql18, etc.) ship the stripped output. //cmd/agent:agent and //cmd/loader:loader are wrapped directly as the two demonstration targets outside dd_cc_packaged (their previous dd_agent_go_binary definitions are now private "<name>_unstripped" targets). A strip_exclude kwarg on dd_strip_debug/dd_cc_packaged provides parity with omnibus's strip_exclude (passes the original file through unchanged, e.g. for objects that must not be split); the existing eBPF _stripped_ebpf rule in bazel/rules/ebpf/ebpf.bzl is untouched. REAL BEHAVIOR CHANGE: removed the one-shot linker stripping that used to happen in release builds, since it left nothing for dd_strip_debug to split. bazel/rules/go/go_binary.bzl no longer adds "-s -w" to release gc_linkopts, and bazel/configs/system_probe_lite.bazelrc no longer passes -Cstrip=symbols to rustc. Release Go/Rust binaries built directly (without being wrapped by dd_*_with_debug or dd_cc_packaged) are therefore no longer pre-stripped by default. **testing** - bazel test //bazel/rules/dd_strip:_dd_strip_tests and //bazel/rules/dd_packaging:_dd_packaging_tests (analysistest-based): all pass, including dd_cc_packaged's existing tests updated for the new "_patched_split.stripped" output shape. - bazel build //bazel/toolchains/dd_strip:all — all three per-OS driver rules (linux/windows/macos) analyze and build cleanly on this macOS machine. - bazel build --output_groups=+debug,+stripped //cmd/loader:loader — verified on macOS: the default output (loader_unstripped) keeps its symbol table (nm), the .stripped and .debug (dSYM bundle) output groups are produced. dsymutil warned "no debug symbols in executable" for this Go/arm64 binary (Go doesn't emit the N_OSO debug map dsymutil expects from C/C++ toolchains, so the resulting .dSYM is not populated for pure-Go macOS binaries) — could not verify a populated macOS dSYM at all on this machine. - bazel build //rtloader:rtloader_pkg_packaged and :rtloader_pkg_patched_split.{stripped,debug} — a real dd_cc_packaged consumer (C shared library), builds end to end. Also confirms `strip -S` runs AFTER rewrite_rpath's codesign step and invalidates the .dylib's code signature with nothing re-signing it afterward. - //cmd/agent:agent and //deps/msodbcsql18:msodbcsql_pkg_packaged could not be built at all on this macOS machine (both hit pre-existing, unrelated target_compatible_with incompatibilities: agent pulls in pkg/ebpf which requires linux, msodbcsql18 is Linux-only) — confirmed the same failure occurs on main without any of these changes, so this is a scoping/platform gap in local verification, not a regression. - The Linux objcopy 3-step path (linux_dd_strip_toolchain) could not be exercised at all locally (no Linux exec platform on this machine) — needs CI or a Linux sandbox to validate. - bazel run //:gazelle -- -mode=diff on cmd/agent and cmd/loader confirms Gazelle does not fight the renamed "_unstripped" dd_agent_go_binary targets (it only wanted a cosmetic attribute reorder, already applied). - bazel run //bazel/buildifier on every new/changed .bzl and BUILD.bazel file. **next steps** - packages/agent/product/BUILD.bazel's real product binaries still come from bazel/repo/prebuilt_file.bzl (wrapping dda-built files), not native Bazel compile/link targets, so dd_strip_debug cannot be attached to them yet — this is why //cmd/agent:agent and rtloader were used as the demonstration targets instead. Revisit once those binaries build natively via Bazel. - The macOS strip+dsymutil path is new territory (no prior art in this repo or omnibus) and needs build-team review before being relied on, especially given the empty-dSYM behavior observed for Go binaries above. - dd_cc_packaged now strips after rewrite_rpath's codesign step with no re-sign step; this needs to be fixed (likely by moving codesign after dd_strip_debug, or adding a re-sign action) before this is safe for signed macOS artifacts. - Plan B (packaging-time strip transform) is being developed in parallel in a separate worktree; per the sequencing note this PR built its own bazel/toolchains/dd_strip toolchain independently. The two toolchain layers will likely need to be reconciled/deduplicated in a follow-up once both land.
1 parent fec92d8 commit df86c35

18 files changed

Lines changed: 750 additions & 26 deletions

File tree

MODULE.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ register_toolchains(
205205
"//bazel/toolchains/rpath_rewriter:patchelf_toolchain",
206206
)
207207

208+
# ABLD-464: strip/split debug-symbol driver, one toolchain per OS plus a
209+
# fallback for exec platforms without one. Registered last so the specific
210+
# per-OS toolchains are preferred; :missing_toolchain matches everywhere and
211+
# would otherwise shadow them under earlier-wins resolution.
212+
register_toolchains(
213+
"//bazel/toolchains/dd_strip:linux_toolchain",
214+
"//bazel/toolchains/dd_strip:macos_toolchain",
215+
"//bazel/toolchains/dd_strip:windows_toolchain",
216+
"//bazel/toolchains/dd_strip:missing_toolchain",
217+
)
218+
208219
find_rpmbuild = use_extension("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild_bzlmod", dev_dependency = True)
209220
use_repo(find_rpmbuild, "rules_pkg_rpmbuild")
210221

bazel/configs/system_probe_lite.bazelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
build:system-probe-lite-release --@rules_rust//rust/settings:lto=fat # Enable fat LTO
44
build:system-probe-lite-release --@rules_rust//rust/settings:extra_rustc_flag=-Copt-level=z # Optimize for size
55
build:system-probe-lite-release --@rules_rust//rust/settings:extra_rustc_flag=-Ccodegen-units=1 # Single codegen unit for maximum optimization
6-
build:system-probe-lite-release --@rules_rust//rust/settings:extra_rustc_flag=-Cstrip=symbols # Strip debug symbols
76
build:system-probe-lite-release --@rules_rust//rust/settings:extra_rustc_flag=-Cpanic=abort # Remove stack unwinding

bazel/rules/dd_packaging/dd_cc_packaged.bzl

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
88
load("@rules_pkg//pkg:providers.bzl", "PackageFilegroupInfo", "PackageFilesInfo")
99
load("//bazel/rules:so_symlink.bzl", "so_symlink")
1010
load("//bazel/rules/dd_packaging:dd_packaging_info.bzl", "DdPackagingInfo")
11+
load("//bazel/rules/dd_packaging:dd_pkg_files_stripped.bzl", "dd_pkg_files_stripped")
12+
load("//bazel/rules/dd_strip:dd_strip.bzl", "dd_strip_debug")
1113
load("//bazel/rules/rewrite_rpath:rewrite_rpath.bzl", "rewrite_rpath", "rewrite_rpaths")
1214

1315
def _dd_packaged_files_impl(ctx):
@@ -95,7 +97,7 @@ _dd_cc_packaged_rule = rule(
9597
},
9698
)
9799

98-
def _dd_cc_packaged_impl(name, input, version = "", installed_files = [], installed_executables = {}, libname = "", prefix = "", dest_dir = "", visibility = None, **kwargs):
100+
def _dd_cc_packaged_impl(name, input, version = "", installed_files = [], installed_executables = {}, libname = "", prefix = "", dest_dir = "", strip_exclude = False, visibility = None, **kwargs):
99101
patched_name = "{}_patched".format(name)
100102
base = dest_dir if dest_dir else "lib"
101103
package_dest_dir = paths.join(base, prefix) if prefix else base
@@ -111,6 +113,25 @@ def _dd_cc_packaged_impl(name, input, version = "", installed_files = [], instal
111113
use_relative_rpaths = use_relative_rpaths,
112114
package_metadata = [],
113115
)
116+
117+
# Split the rpath-patched binary/library into stripped + debug-only
118+
# outputs before packaging. The stripped output is what actually gets
119+
# shipped (via the ".stripped" sibling label below); the debug output is
120+
# only materialized for consumers that explicitly collect it (e.g. a
121+
# future dbg package).
122+
split_name = "{}_split".format(patched_name)
123+
dd_strip_debug(
124+
name = split_name,
125+
input = ":{}".format(patched_name),
126+
exclude = strip_exclude,
127+
visibility = visibility,
128+
)
129+
dd_pkg_files_stripped(
130+
name = split_name,
131+
visibility = visibility,
132+
)
133+
stripped_input = ":{}.stripped".format(split_name)
134+
114135
extra_files = []
115136
if installed_executables:
116137
exec_files_name = "{}_exec_files".format(name)
@@ -127,7 +148,7 @@ def _dd_cc_packaged_impl(name, input, version = "", installed_files = [], instal
127148
if version:
128149
so_symlink(
129150
name = packaged_lib,
130-
src = ":{}".format(patched_name),
151+
src = stripped_input,
131152
libname = resolved_libname,
132153
version = version,
133154
prefix = prefix,
@@ -137,7 +158,7 @@ def _dd_cc_packaged_impl(name, input, version = "", installed_files = [], instal
137158
else:
138159
pkg_files(
139160
name = packaged_lib,
140-
srcs = [":{}".format(patched_name)],
161+
srcs = [stripped_input],
141162
prefix = package_dest_dir,
142163
visibility = visibility,
143164
package_metadata = [],
@@ -203,6 +224,13 @@ dd_cc_packaged = macro(
203224
default = "",
204225
configurable = False,
205226
),
227+
"strip_exclude": attr.bool(
228+
doc = """Skip splitting stripped/debug outputs for this target,
229+
parity with omnibus's strip_exclude. The unstripped, rpath-patched
230+
binary/library is packaged as-is.""",
231+
default = False,
232+
configurable = False,
233+
),
206234
"version": attr.string(
207235
default = "",
208236
configurable = False,

bazel/rules/dd_packaging/dd_packaging_test.bzl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ def _test_so_collected(name):
133133
)
134134

135135
def _test_so_collected_impl(env, target):
136-
# rewrite_rpath places its output under a "patched/" subdirectory.
136+
# rewrite_rpath names its output "<name>_patched"; dd_strip_debug then
137+
# further splits that into "<name>_patched_split.stripped" (shipped) and
138+
# ".debug" (not collected here). Match on "patched" broadly to cover both.
137139
_outputs_of(env, target).contains_predicate(
138-
matching.file_path_matches("*patched/*"),
140+
matching.file_path_matches("*_patched*"),
139141
)
140142

141143
# Test 3: dd_cc_packaged with installed_files → both the patched .so and the
@@ -172,7 +174,7 @@ def _test_installed_files_collected(name):
172174

173175
def _test_installed_files_collected_impl(env, target):
174176
outputs = _outputs_of(env, target)
175-
outputs.contains_predicate(matching.file_path_matches("*patched/*"))
177+
outputs.contains_predicate(matching.file_path_matches("*_patched*"))
176178
outputs.contains_predicate(matching.file_basename_contains("empty.h"))
177179

178180
# Test 4: transitive collection through dynamic_deps.
@@ -228,7 +230,7 @@ def _test_transitive_collected_impl(env, target):
228230
outputs = _outputs_of(env, target)
229231

230232
# outer's own patched .so
231-
outputs.contains_predicate(matching.file_path_matches("*patched/*"))
233+
outputs.contains_predicate(matching.file_path_matches("*_patched*"))
232234

233235
# inner's header, reached transitively via dynamic_deps → input → dynamic_deps
234236
outputs.contains_predicate(matching.file_basename_contains("empty.h"))
@@ -293,7 +295,7 @@ def _test_packaged_forwards_unpatched_so(name):
293295
def _test_packaged_forwards_unpatched_so_impl(env, target):
294296
outputs = _outputs_of(env, target)
295297
outputs.contains_predicate(matching.file_extension_in(["so", "dll", "dylib"]))
296-
outputs.not_contains_predicate(matching.file_path_matches("*patched/*"))
298+
outputs.not_contains_predicate(matching.file_path_matches("*_patched*"))
297299

298300
# Test 7: dd_cc_packaged wrapping a cc_binary → the rpath-patched binary
299301
# appears in DdPackagingInfo.installed_files.
@@ -322,7 +324,7 @@ def _test_cc_binary_collected(name):
322324
)
323325

324326
def _test_cc_binary_collected_impl(env, target):
325-
_outputs_of(env, target).contains_predicate(matching.file_path_matches("*patched/*"))
327+
_outputs_of(env, target).contains_predicate(matching.file_path_matches("*_patched*"))
326328

327329
# Test 8: dd_cc_packaged wrapping a cc_binary does NOT forward CcSharedLibraryInfo,
328330
# even when the binary links against a dd_cc_packaged shared library.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
"""Helper for referencing a dd_strip_debug target's split outputs from pkg_files.
2+
3+
dd_strip_debug's DefaultInfo intentionally stays unstripped (see
4+
//bazel/rules/dd_strip:dd_strip.bzl), so a plain `pkg_files(srcs = [":foo"])`
5+
would package the unstripped binary. dd_pkg_files_stripped creates two small
6+
sibling targets, "<name>.stripped" and "<name>.debug", that expose a
7+
dd_strip_debug target's OutputGroupInfo(stripped = ...)/OutputGroupInfo(debug
8+
= ...) outputs through DefaultInfo, so they can be referenced directly as
9+
pkg_files srcs, e.g.:
10+
11+
dd_strip_debug(name = "agent", input = ":agent_unstripped")
12+
dd_pkg_files_stripped(name = "agent")
13+
pkg_files(srcs = ["//cmd/agent:agent.stripped"], ...)
14+
"""
15+
16+
def _dd_output_group_file_impl(ctx):
17+
group = getattr(ctx.attr.dep[OutputGroupInfo], ctx.attr.group)
18+
return [DefaultInfo(files = group)]
19+
20+
_dd_output_group_file = rule(
21+
implementation = _dd_output_group_file_impl,
22+
doc = "Re-exposes one named OutputGroupInfo group of `dep` as this target's DefaultInfo.",
23+
attrs = {
24+
"dep": attr.label(
25+
doc = "A target providing OutputGroupInfo, typically a dd_strip_debug target.",
26+
providers = [OutputGroupInfo],
27+
mandatory = True,
28+
),
29+
"group": attr.string(
30+
doc = "The OutputGroupInfo group to expose: 'stripped' or 'debug'.",
31+
mandatory = True,
32+
values = ["stripped", "debug"],
33+
),
34+
},
35+
)
36+
37+
def dd_pkg_files_stripped(name, dep = None, visibility = None):
38+
"""Creates "<name>.stripped" and "<name>.debug" sibling labels for a dd_strip_debug target.
39+
40+
Args:
41+
name: the base name used for the sibling labels ("<name>.stripped", "<name>.debug").
42+
dep: the dd_strip_debug target to read from. Defaults to ":<name>" (i.e. call this
43+
right after `dd_strip_debug(name = name, ...)`).
44+
visibility: visibility applied to both sibling targets.
45+
"""
46+
dep = dep or (":" + name)
47+
_dd_output_group_file(
48+
name = name + ".stripped",
49+
dep = dep,
50+
group = "stripped",
51+
visibility = visibility,
52+
)
53+
_dd_output_group_file(
54+
name = name + ".debug",
55+
dep = dep,
56+
group = "debug",
57+
visibility = visibility,
58+
)

bazel/rules/dd_strip/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load(":dd_strip_test.bzl", "dd_strip_test_suite")
2+
3+
dd_strip_test_suite(name = "_dd_strip_tests")

bazel/rules/dd_strip/dd_strip.bzl

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
"""dd_strip_debug: split a binary/library into stripped + debug-only outputs.
2+
3+
Wraps any single label that produces one default output file (a go_binary,
4+
cc_binary, cc_shared_library, or rust_binary). The wrapped rule's DEFAULT
5+
output is untouched and stays unstripped, so `bazel build //some:target`
6+
behavior never changes; the split outputs are only materialized for
7+
consumers that ask for them via OutputGroupInfo (`--output_groups=+debug` or
8+
`+stripped`) or by reading DdStripInfo directly (see dd_pkg_files_stripped.bzl).
9+
10+
dd_go_binary_with_debug / dd_cc_binary_with_debug / dd_rust_binary_with_debug
11+
are convenience macros that create the wrapped binary/library under a private
12+
`<name>_unstripped` target and wrap it with dd_strip_debug under the
13+
requested `name`, so callers just swap the rule name and keep every other
14+
kwarg unchanged.
15+
"""
16+
17+
load("@rules_cc//cc:defs.bzl", "cc_binary")
18+
load("@rules_go//go:def.bzl", "go_binary")
19+
load(":dd_strip_info.bzl", "DdStripInfo")
20+
21+
_TOOLCHAIN_TYPE = "//bazel/toolchains/dd_strip:dd_strip_toolchain_type"
22+
23+
def _passthrough(original, excluded):
24+
return [
25+
DefaultInfo(files = depset([original])),
26+
DdStripInfo(
27+
stripped_file = original,
28+
debug_file = None,
29+
original_file = original,
30+
excluded = excluded,
31+
),
32+
OutputGroupInfo(stripped = depset([original]), debug = depset([])),
33+
]
34+
35+
def _dd_strip_debug_impl(ctx):
36+
original = ctx.file.input
37+
38+
if ctx.attr.exclude:
39+
return _passthrough(original, excluded = True)
40+
41+
toolchain = ctx.toolchains[_TOOLCHAIN_TYPE]
42+
if toolchain == None or not toolchain.available:
43+
# No strip/split driver for this platform: pass the original through
44+
# rather than failing the build (parity with DdStripInfo.excluded).
45+
return _passthrough(original, excluded = True)
46+
47+
stripped = ctx.actions.declare_file(ctx.label.name + ".stripped")
48+
if toolchain.debug_is_directory:
49+
debug = ctx.actions.declare_directory(ctx.label.name + ".debug")
50+
else:
51+
debug = ctx.actions.declare_file(ctx.label.name + ".debug")
52+
53+
args = ctx.actions.args()
54+
args.add(original.path)
55+
args.add(stripped.path)
56+
args.add(debug.path)
57+
ctx.actions.run(
58+
executable = toolchain.driver,
59+
arguments = [args],
60+
inputs = [original],
61+
outputs = [stripped, debug],
62+
toolchain = _TOOLCHAIN_TYPE,
63+
mnemonic = "DdStripDebug",
64+
progress_message = "Splitting debug info for %s" % original.short_path,
65+
)
66+
67+
return [
68+
# Default output stays unstripped: bazel build //x:x never changes.
69+
DefaultInfo(files = depset([original])),
70+
DdStripInfo(
71+
stripped_file = stripped,
72+
debug_file = debug,
73+
original_file = original,
74+
excluded = False,
75+
),
76+
OutputGroupInfo(stripped = depset([stripped]), debug = depset([debug])),
77+
]
78+
79+
dd_strip_debug = rule(
80+
implementation = _dd_strip_debug_impl,
81+
doc = """Wraps a single-output binary/library target, exposing:
82+
83+
- DefaultInfo: the original, unstripped file (unchanged build behavior).
84+
- OutputGroupInfo(stripped = [...]): the stripped file, for packaging.
85+
- OutputGroupInfo(debug = [...]): the debug-only file/dSYM directory.
86+
- DdStripInfo: the same three files plus whether stripping was skipped.
87+
88+
When exclude = True (parity with omnibus's strip_exclude, e.g. for eBPF
89+
.o objects handled separately by _stripped_ebpf), or when no dd_strip
90+
toolchain is registered for the current platform, stripped_file equals
91+
original_file and debug_file is None -- no stripping occurs and
92+
DdStripInfo.excluded is True.""",
93+
attrs = {
94+
"input": attr.label(
95+
doc = "Label producing a single default output file to strip (a binary or shared library).",
96+
mandatory = True,
97+
allow_single_file = True,
98+
),
99+
"exclude": attr.bool(
100+
doc = "Skip stripping and expose the original file unchanged, parity with omnibus's strip_exclude.",
101+
default = False,
102+
),
103+
},
104+
toolchains = [config_common.toolchain_type(_TOOLCHAIN_TYPE, mandatory = False)],
105+
)
106+
107+
def _wrap(binary_rule, name, strip_exclude, visibility, kwargs):
108+
unstripped_name = name + "_unstripped"
109+
binary_rule(
110+
name = unstripped_name,
111+
visibility = ["//visibility:private"],
112+
tags = (kwargs.pop("tags", None) or []) + ["manual"],
113+
**kwargs
114+
)
115+
dd_strip_debug(
116+
name = name,
117+
input = ":" + unstripped_name,
118+
exclude = strip_exclude,
119+
visibility = visibility,
120+
)
121+
122+
def dd_go_binary_with_debug(name, strip_exclude = False, visibility = None, **kwargs):
123+
"""A go_binary wrapped with dd_strip_debug.
124+
125+
Accepts all go_binary attributes via **kwargs. See dd_strip_debug for the
126+
behavior of the wrapping (default output stays unstripped; use
127+
--output_groups=+stripped/+debug or DdStripInfo to get the split).
128+
129+
Args:
130+
name: target name. The underlying go_binary is created as
131+
"<name>_unstripped" (private, tags = ["manual"]).
132+
strip_exclude: parity with omnibus's strip_exclude -- skip stripping.
133+
visibility: visibility of the resulting dd_strip_debug target.
134+
**kwargs: forwarded to go_binary.
135+
"""
136+
_wrap(go_binary, name, strip_exclude, visibility, kwargs)
137+
138+
def dd_cc_binary_with_debug(name, strip_exclude = False, visibility = None, **kwargs):
139+
"""A cc_binary wrapped with dd_strip_debug. See dd_go_binary_with_debug."""
140+
_wrap(cc_binary, name, strip_exclude, visibility, kwargs)
141+
142+
def dd_rust_binary_with_debug(name, strip_exclude = False, visibility = None, **kwargs):
143+
"""A rust_binary wrapped with dd_strip_debug. See dd_go_binary_with_debug."""
144+
145+
# Deferred import: rules_rust is not a dependency of every consumer of
146+
# this file (e.g. dd_go_binary_with_debug-only callers), and loading it
147+
# unconditionally would pull rules_rust into packages that never use it.
148+
_wrap(_rust_binary(), name, strip_exclude, visibility, kwargs)
149+
150+
def _rust_binary():
151+
return Label("@rules_rust//rust:defs.bzl%rust_binary")
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Provider reporting the stripped/debug split produced by dd_strip_debug."""
2+
3+
DdStripInfo = provider(
4+
doc = """Reports the outputs of splitting a single binary/library into a
5+
stripped artifact (for shipping) and a debug-only artifact (for a
6+
companion "dbg" package), mirroring omnibus's Stripper.
7+
8+
Consumers such as dd_pkg_files_stripped read this provider off a wrapped
9+
target to decide which file to place in the shipped package vs. the
10+
debug-only package.""",
11+
fields = {
12+
"stripped_file": """File. The binary/library with debug info removed,
13+
ready for the shipped package. Equal to original_file when
14+
excluded is True or no strip toolchain is available.""",
15+
"debug_file": """File or None. The extracted debug information.
16+
A regular File on Linux (objcopy --only-keep-debug output) and
17+
Windows (the unstripped original), a Directory for macOS .dSYM
18+
bundles. None when excluded is True or no strip toolchain is
19+
available for the target platform.""",
20+
"original_file": "File. The unstripped input as originally built.",
21+
"excluded": """bool. True when this target opted out of stripping
22+
(parity with omnibus's strip_exclude, used e.g. for eBPF .o
23+
objects) or when no dd_strip toolchain is available for the
24+
current platform. stripped_file is the unmodified original_file
25+
in that case, and debug_file is None.""",
26+
},
27+
)

0 commit comments

Comments
 (0)