[toolchains] Add helper for extracting action names from cc_action_type
rules
#292
Labels
P3
Accepted issue. Team is likely to fix this issue in the future, but no short-term promises are made.
Many rules use
cc_common.get_tool_for_action()
to create custom rules that employ binaries from the current C/C++ toolchain. The status-quo today is to use the string constants exposed in Starlark files. Since these are now represented as rules, it's plausible to express the action types by referencing the source-of-truthcc_action_type
rule. Today this is not possible because the providers for toolchain rules are considered private and not exposed to prevent projects from relying on implementation details of the toolchain rules.Proposed solution
The simplest path forward is to add a
action_name_from_action_type(target)
helper that takes a target and extracts the action name from the action type. This will work as a bridge so user can do things like:The text was updated successfully, but these errors were encountered: