I’m writing a custom rule in Skylark, and in the rule I would like to access the current toolchain action definitions that were created via cc_common.create_cc_toolchain_config_info(), essentially the contents of the action_configs argument. Is there any way to do this within a custom rule?
https://bazel.build/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info
I would imagine that an aspect could do this, but I suspect for my use case it would create a circular dependency. I’m interested in the action definition for the current C++ toolchain independent of a given target.
I tried cc_common.get_tool_for_action(), but it is unhelpful as there can be an action defined for a tool without an associated make variable, they are configured separately and what I need is in CcToolchainConfigInfo.
https://bazel.build/rules/lib/toplevel/cc_common#get_tool_for_action
marcsupial is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.