Skip to content

Add .stripped and .dwp target for bin targets - #4378

Merged
krasimirgg merged 5 commits into
bazelbuild:mainfrom
johnmave126:local/dwp_stripped
Nov 18, 2026
Merged

krasimirgg merged 5 commits into
bazelbuild:mainfrom
johnmave126:local/dwp_stripped

Conversation

@johnmave126

Copy link
Copy Markdown
Contributor

Currently bin target does not produce any stripped target. This change adapts from rules_cc, adds .stripped and .dwp target for bin targets and emits debug package info to relate them. Also add a test adapted from dwo_files_test in rules_cc.

Tested:
bazelisk test //test/unit/...
Also generated dwo_main to verify the stripped binary.

@krasimirgg
krasimirgg self-requested a review November 4, 2026 10:40
Comment thread rust/private/rustc.bzl Resolved
Comment thread rust/private/rustc.bzl Resolved
Comment thread rust/private/rustc.bzl Resolved
Comment thread test/unit/debug_info/dwo_files_test.bzl Resolved
Comment thread rust/private/rustc.bzl Resolved
Comment thread rust/private/rustc.bzl Resolved
Comment thread rust/private/rustc.bzl Resolved
Comment thread rust/private/rustc.bzl Resolved
Comment thread test/unit/debug_info/dwo_files_test.bzl Resolved
Shuhao Tan added 3 commits November 14, 2026 01:41
Currently bin target does not produce any stripped target. This change
adapts from rules_cc, adds .stripped and .dwp target for bin targets
and emits debug package info to relate them. Also add a test adapted
from dwo_files_test in rules_cc.
should_use_pic expects compilation_mode to be a str. One call site
was silently broken in the past. This commit adds a type check to
avoid type confusion.
Add strip action assertion as part of the test. Add
experimental_use_cc_common_link = True test case (with a link action
assertion to make sure it is exercised). Add a no_cc_toolchain mock
to assert analysis failure when --fission=yes is specified without a
cc_toolchain.

@krasimirgg krasimirgg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you! Looks good.

Comment thread rust/private/rustc.bzl Resolved
Comment thread test/unit/debug_info/dwo_files_test.bzl Resolved
@krasimirgg
krasimirgg enabled auto-merge November 16, 2026 13:34
@krasimirgg
krasimirgg added this pull request to the merge queue Nov 18, 2026
Merged via the queue into bazelbuild:main with commit 7b4b96c Nov 18, 2026
3 checks passed
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