Skip to content

Commit 7c0a3bb

Browse files
Googlercopybara-github
authored andcommitted
Refactor action sets for consistency and simplicity
BEGIN_PUBLIC Refactor action sets for consistency and simplicity * Remove the "CC" prefix on some of the actions, as we're already within the scope of rules_cc. * Remove the "all" prefix, since the plural "actions" should already imply this. * Ensure all action types sets end with "_actions" * Refactor some action type sets to be constructed from other (eg. link actions = link executables + link dynamic libraries). * Remove the redundant "all_compile_actions", since it was equivalent to "all_cc_compile_actions" END_PUBLIC PiperOrigin-RevId: 617985242 Change-Id: I9a3621a9d613ff604efdc5c86ba52e5c77f06731
1 parent 17143d1 commit 7c0a3bb

File tree

4 files changed

+79
-93
lines changed

4 files changed

+79
-93
lines changed

cc/toolchains/actions.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cc_action_type_set = rule(
6363
Example:
6464
6565
cc_action_type_set(
66-
name = "cc_link_executable_actions",
66+
name = "link_executable_actions",
6767
actions = [
6868
":cpp_link_executable",
6969
":lto_index_for_executable",

cc/toolchains/actions/BUILD

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,20 @@ cc_action_type(
139139
)
140140

141141
cc_action_type_set(
142-
name = "all_ar_actions",
142+
name = "ar_actions",
143143
actions = [":cpp_link_static_library"],
144144
)
145145

146146
cc_action_type_set(
147-
name = "all_assembly_actions",
147+
name = "assembly_actions",
148148
actions = [
149149
":preprocess_assemble",
150150
":assemble",
151151
],
152152
)
153153

154154
cc_action_type_set(
155-
name = "all_cpp_compile_actions",
155+
name = "cpp_compile_actions",
156156
actions = [
157157
":linkstamp_compile",
158158
":cpp_compile",
@@ -165,37 +165,24 @@ cc_action_type_set(
165165
)
166166

167167
cc_action_type_set(
168-
name = "all_cc_compile_actions",
168+
name = "compile_actions",
169169
actions = [
170-
":all_cpp_compile_actions",
170+
":cpp_compile_actions",
171171
":c_compile",
172-
":preprocess_assemble",
173-
":assemble",
172+
":assembly_actions",
174173
],
175174
)
176175

177176
cc_action_type_set(
178-
name = "all_compile_actions",
177+
name = "link_actions",
179178
actions = [
180-
":all_cc_compile_actions",
181-
":all_cpp_compile_actions",
179+
":link_executable_actions",
180+
":dynamic_library_link_actions",
182181
],
183182
)
184183

185184
cc_action_type_set(
186-
name = "all_cc_link_actions",
187-
actions = [
188-
":cpp_link_executable",
189-
":cpp_link_dynamic_library",
190-
":cpp_link_nodeps_dynamic_library",
191-
":lto_index_for_executable",
192-
":lto_index_for_dynamic_library",
193-
":lto_index_for_nodeps_dynamic_library",
194-
],
195-
)
196-
197-
cc_action_type_set(
198-
name = "cc_link_executable_actions",
185+
name = "link_executable_actions",
199186
actions = [
200187
":cpp_link_executable",
201188
":lto_index_for_executable",
@@ -206,9 +193,8 @@ cc_action_type_set(
206193
name = "dynamic_library_link_actions",
207194
actions = [
208195
":cpp_link_dynamic_library",
209-
":cpp_link_nodeps_dynamic_library",
210196
":lto_index_for_dynamic_library",
211-
":lto_index_for_nodeps_dynamic_library",
197+
":nodeps_dynamic_library_link_actions",
212198
],
213199
)
214200

cc/toolchains/toolchain.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ visibility("public")
2727
# work out what actions correspond to what file groups.
2828
_LEGACY_FILE_GROUPS = {
2929
"ar_files": [
30-
"@rules_cc//cc/toolchains/actions:all_ar_actions", # copybara-use-repo-external-label
30+
"@rules_cc//cc/toolchains/actions:ar_actions", # copybara-use-repo-external-label
3131
],
3232
"as_files": [
33-
"@rules_cc//cc/toolchains/actions:all_assembly_actions", # copybara-use-repo-external-label
33+
"@rules_cc//cc/toolchains/actions:assembly_actions", # copybara-use-repo-external-label
3434
],
3535
"compiler_files": [
3636
"@rules_cc//cc/toolchains/actions:cc_flags_make_variable", # copybara-use-repo-external-label

0 commit comments

Comments
 (0)