You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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-truth cc_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:
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: