Draft
Conversation
This commit adds a [plugin](https://github.com/bazelbuild/bazel-gazelle/blob/master/extend.rst) for [gazelle](https://github.com/bazelbuild/bazel-gazelle) that generates nfpm_package rules and updates their dependencies. While nfpm_package rules are small and simple to write, their dependencies must match the dependencies consumed in the corresponding .yaml file. This custom gazelle plugin automatically updates the dependencies. There are a few ways we could distinguish between an nfpm yaml file and some other yaml file. Currently the plugin looks for a ".nfpm.yaml" file. This is faster than reading the file to determine what it is, especially for large projects with many YAML files. Another question is whether to generate an RPM rule, a DEB rule, or both. Currently the plugin generates both. If one is unused it can be tagged as "manual". Some alternatives are choosing based on gazelle directives (eg "// gazelle:nfpm output rpm"), based on the config file extension (eg "example.rpm.yaml"), or providing one gazelle plugin for each of RPMs and DEBs. Users who wish to set other custom attributes on the nfpm_package rules, such as tags and visibility, may do so using buildozer, for example.
|
A directive for overriding default output type seems reasonable for a generally used package like this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds a plugin for gazelle that generates nfpm_package rules and updates their dependencies.
While nfpm_package rules are small and simple to write, their dependencies must match the dependencies consumed in the corresponding .yaml file. This custom gazelle plugin automatically updates the dependencies.
There are a few ways we could distinguish between an nfpm yaml file and some other yaml file. Currently the plugin looks for a ".nfpm.yaml" file. This is faster than reading the file to determine what it is, especially for large projects with many YAML files.
Another question is whether to generate an RPM rule, a DEB rule, or both. Currently the plugin generates both. If one is unused it can be tagged as "manual". Some alternatives are choosing based on gazelle directives (eg "// gazelle:nfpm output rpm"), based on the config file extension (eg "example.rpm.yaml"), or providing one gazelle plugin for each of RPMs and DEBs.
Users who wish to set other custom attributes on the nfpm_package rules, such as tags and visibility, may do so using buildozer, for example.