Skip to main content

plugins

All

All: AllPlugins

kind

def kind() -> PluginKind

Create a new plugin kind.

Plugin kinds are identifiers used to categorize plugin dependencies. They enable unconfigured target labels to be propagated up the build graph, which are then configured as exec deps when used by a rule with uses_plugins. This ensures each rule gets plugins configured for its own execution platform.

The value returned should always be immediately bound to a global, like:

RustProcMacro = plugins.kind()

Once created, a plugin kind can be used with:

  • attrs.plugin_dep(kind = MyKind) to declare a direct plugin dependency
  • attrs.dep(pulls_plugins = [MyKind]) to pull plugins from deps without propagating
  • attrs.dep(pulls_and_pushes_plugins = [MyKind]) to pull and propagate plugins to rdeps
  • rule(..., uses_plugins = [MyKind]) to access plugins via ctx.plugins[MyKind]