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
I wish Bazel had a plugin system allowing developers to add subcommands (e.g. bazel <custom-command>). This would be useful for many situations:
Ruleset developers could add utilities that currently need to be defined in the client’s workspace (e.g., bazel go get http://example.com , bazel swift package update).
Clients could provide short, user-friendly aliases for targets similar to how some folks use make to run Bazel commands.
Provide access to tools that should be built into Bazel but are not (e.g. buildozer, buildifier).
Instead of adding a plugin system to Bazel, what if we added it to bazelisk instead?
What features would this plugin framework provide?
Bazel workspace configurable. A workspace can provide a configuration file that describes the commands to provide and the tools to download.
Tool download. In much the same way that bazelisk downloads the configured version of Bazel, the plugin configuration can download source or prebuilt binaries.
Lazy evaluation. Don’t download the world when the user types bazelisk help. There will be some caveats here, but I bet that we can figure out how to provide a nice user experience without too much overhead.
Plugin Discoverability. A client could search for plugins (e.g. bazelisk plugin search awesome-plugin).
Plugin Install. A client could install plugins (e.g. bazelisk plugin install awesome-plugin).
Module install. A client could install a Bazel module simply by running bazel mod install rules_go.
Why add a plugin system to bazelisk?
It is the de facto launcher for Bazel.
It is written in Go. Many of the tools that I would like to see implemented are also implemented in Go. However, the plugin system should be language-agnostic.
Feature development can occur independently from Bazel releases.
What about the commercially available Bazel CLI replacements?
There are companies that provide a Bazel frontend with some of these features (e.g. BuildBuddy, Aspect). I posit that the community would benefit from the infrastructure being open-source and the plugins being open-source and proprietary. With an open-source plugin framework, companies can sell plugins or provide free plugins that work with their subscription services.
What do you think?
I am curious if other folks think that this is interesting. What improvements could we make to the Bazel user-experience with a plugin framework?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This discussion was born from a Slack thread in the #bazelisk channel. We moved the discussion here to ensure that a broad audience could participate.
Overview
I wish Bazel had a plugin system allowing developers to add subcommands (e.g.
bazel <custom-command>
). This would be useful for many situations:bazel go get http://example.com
,bazel swift package update
).make
to run Bazel commands.buildozer
,buildifier
).Instead of adding a plugin system to Bazel, what if we added it to
bazelisk
instead?What features would this plugin framework provide?
bazelisk
downloads the configured version of Bazel, the plugin configuration can download source or prebuilt binaries.bazelisk help
. There will be some caveats here, but I bet that we can figure out how to provide a nice user experience without too much overhead.bazelisk plugin search awesome-plugin
).bazelisk plugin install awesome-plugin
).bazel mod install rules_go
.Why add a plugin system to bazelisk?
What about the commercially available Bazel CLI replacements?
There are companies that provide a Bazel frontend with some of these features (e.g. BuildBuddy, Aspect). I posit that the community would benefit from the infrastructure being open-source and the plugins being open-source and proprietary. With an open-source plugin framework, companies can sell plugins or provide free plugins that work with their subscription services.
What do you think?
I am curious if other folks think that this is interesting. What improvements could we make to the Bazel user-experience with a plugin framework?
Beta Was this translation helpful? Give feedback.
All reactions