Allow composing rule implementations
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
It would be nice of the implementation of a Starlark rule could call the implementation of another rule.
There are two current answers to this functionality:
* Macros (but they are much less powerful than rules and show up in `bazel query`, which is not ideal
* Calling the implementation function of another rule (it may or may not be exported, doesn't work for native rules and requires the attributes of the calling rule to be set up just right including their names, types, applied aspects, toolchains and implicit dependencies)
I am not very certain if this is the right approach: this came up within the context of writing custom C++ rules and it could very well be that a better `cc_common` API would make this request superfluous. On the surface, however, I think it's useful to at least discuss it.
### What underlying problem are you trying to solve with this feature?
_No response_
### Which operating system are you running Bazel on?
_No response_
### What is the output of `bazel info release`?
_No response_
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.