-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add package_file_name to pkg_deb and pkg_zip #282
Merged
Merged
Conversation
This file contains 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
dannysullivan
approved these changes
Feb 3, 2021
nacl
approved these changes
Feb 3, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
The comments are largely nitpicky or can be deferred. I don't feel that I need to look at this again unless you want me to.
I'm interested in a common attribute for package names. If that isn't done now, I'd like to see it done later.
5 tasks
nacl
pushed a commit
to nacl/rules_pkg
that referenced
this pull request
Mar 22, 2021
…ule attribute This change modifies the `pkg_filegroup`-using `pkg_rpm` rule to use the same naming attributes and output system as other packaging rules, specifically: - `package_variables` corresponds to a rule providing `PackageVariablesInfo`, used for templating of various package attributes. - `package_file_name` corresponds to the output filename, and uses the value provided to `package_variables` to construct an "expanded" output file name. - `package_name` corresponds to the "name" of the package, as recognized by the package manager. This replaces `rpm_name`. - The expanded output file name is identified via a `PackageArtifactInfo` provider. The default, unexpanded name is derived from `package_name`, or `name` if not provided. If `package_file_name` is not provided, then the default name is formatted according to the preferred RPM "NVRA" format. File names will look like `$name-$version-$release.$architecture.rpm`. As a side-effect, this removes the deprecated `outputs` output from `pkg_rpm`. This resolves bazelbuild#282 for this rule, but not the soon-to-be-legacy rule in `rpm.bzl`. If it is desired to do this, I will do so in a follow-on-change. Since (both versions of) `pkg_rpm` are structured differently from the other packaging rules, `setup_output_files` in `private/util.bzl` was modified to support deriving the default output file name from a macro argument instead of relying on `ctx.outputs.out`, as it is not present in `pkg_rpm`. The documentation was also updated to mention this and to improve clarity. Documentation was also opportunistically fixed in `experimental/rpm.bzl`. Tests are also provided.
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 unifies pkg_deb, pkg_tar, and pkg_zip so that they all have these 3 parameters
If package_file_name is not specified, out is the single output file. If it is specified, the default output of the target (DefaultInfo.files) will be the file named by package_file_name and out will be a symlink to it.
The examples are expanded to show how this is used in practice.
See #193 for discussion.
Also, a partial fix for #161. runfiles now includes all the outputs of these pkg_* rules
pkg_rpm is excluded from this PR. We need to resolve #283 first.
RELNOTES:
pkg_deb
,pkg_tar
, andpkg_zip
all now usepackage_file_name
andpackage_variables
to provide build time configurable names for their outputs.archive_name
is deprecated for all rules. See Deprecation: archive_name to be removed in all pkg_* rules #284