@@ -155,47 +155,6 @@ def _create_debug_packager_actions(ctx, cc_toolchain, dwp_output, dwo_files):
155
155
outputs = packager ["outputs" ],
156
156
)
157
157
158
- def _create_strip_action (ctx , cc_toolchain , cpp_config , input , output , feature_configuration ):
159
- if cc_common .is_enabled (feature_configuration = feature_configuration , feature_name = "no_stripping" ):
160
- ctx .actions .symlink (
161
- output = output ,
162
- target_file = input ,
163
- progress_message = "Symlinking original binary as stripped binary" ,
164
- )
165
- return
166
-
167
- if not cc_common .action_is_enabled (feature_configuration = feature_configuration , action_name = "strip" ):
168
- fail ("Expected action_config for 'strip' to be configured." )
169
-
170
- variables = cc_common .create_compile_variables (
171
- cc_toolchain = cc_toolchain ,
172
- feature_configuration = feature_configuration ,
173
- output_file = output .path ,
174
- input_file = input .path ,
175
- strip_opts = cpp_config .strip_opts (),
176
- )
177
- command_line = cc_common .get_memory_inefficient_command_line (
178
- feature_configuration = feature_configuration ,
179
- action_name = "strip" ,
180
- variables = variables ,
181
- )
182
- execution_info = {}
183
- for execution_requirement in cc_common .get_tool_requirement_for_action (feature_configuration = feature_configuration , action_name = "strip" ):
184
- execution_info [execution_requirement ] = ""
185
- ctx .actions .run (
186
- inputs = depset (
187
- direct = [input ],
188
- transitive = [cc_toolchain .all_files ],
189
- ),
190
- outputs = [output ],
191
- use_default_shell_env = True ,
192
- executable = cc_common .get_tool_for_action (feature_configuration = feature_configuration , action_name = "strip" ),
193
- execution_requirements = execution_info ,
194
- progress_message = "Stripping {} for {}" .format (output .short_path , ctx .label ),
195
- mnemonic = "CcStrip" ,
196
- arguments = command_line ,
197
- )
198
-
199
158
def _is_stamping_enabled (ctx ):
200
159
if ctx .configuration .is_tool_configuration ():
201
160
return 0
@@ -858,7 +817,7 @@ def cc_binary_impl(ctx, additional_linkopts):
858
817
859
818
# Create the stripped binary but don't add it to filesToBuild; it's only built when requested.
860
819
stripped_file = ctx .outputs .stripped_binary
861
- _create_strip_action (ctx , cc_toolchain , cpp_config , binary , stripped_file , feature_configuration )
820
+ cc_helper . create_strip_action (ctx , cc_toolchain , cpp_config , binary , stripped_file , feature_configuration )
862
821
dwo_files = _collect_transitive_dwo_artifacts (
863
822
cc_compilation_outputs ,
864
823
cc_helper .merge_cc_debug_contexts (cc_compilation_outputs , _get_providers (ctx , cpp_config )),
0 commit comments