Skip to content

Add prototype pkgfilegroup-based RPM builder#129

Merged
aiuto merged 1 commit intobazelbuild:masterfrom
nacl:topic/pkgfilegroup-full-rpmgen
Apr 15, 2020
Merged

Add prototype pkgfilegroup-based RPM builder#129
aiuto merged 1 commit intobazelbuild:masterfrom
nacl:topic/pkgfilegroup-full-rpmgen

Conversation

@nacl
Copy link
Copy Markdown
Collaborator

@nacl nacl commented Jan 15, 2020

NOTE: only the third commit (currently bd8d531) should be reviewed as a part of this change. The first two should be reviewed as a part of #128.

This change provides a prototype pkgfilegroup-based RPM builder in the form of
the gen_rpm rule. See #128 for more details on pkgfilegroup.

The RPM generator was derived from make_rpm.py in pkg/ and supports a number
of features over and above what's available in pkg_rpm. As written, it, given
a template like the one provided, can construct many full-fledged RPM
packages entirely within Bazel. In most cases, the templates will only need to
be customized with advanced logic and other macros that are not settable via
bazel itself; gen_rpm will write much of the preamble, %description text,
%install scriptlets, and %files based on rule-provided inputs.

Documentation outside of the source files is not yet available. This was
empirically tested on RPM packages internal to VMware with positive results;
actual tests of the rules are not yet ready.

This, naturally, is incomplete, and is missing capabilities such as:

  • Configurable compression
  • Configurable Provides/Requires
  • SRPM emission
  • Reproducibility
  • Configurable stripping
  • Configurable construction of "debug" packages

@nacl nacl requested a review from aiuto as a code owner January 15, 2020 14:11
@googlebot
Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to determine that you authored the commits in this PR. Maybe you used a different email address in the git commits than was used to sign the CLA? If someone else authored these commits, then please add them to this pull request and have them confirm that they're okay with them being contributed to Google. If there are co-authors, make sure they're formatted properly.

In order to pass this check, please resolve this problem and then comment@googlebot I fixed it... If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@nacl nacl force-pushed the topic/pkgfilegroup-full-rpmgen branch from 6c123bf to bd8d531 Compare January 15, 2020 14:19
@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Copy link
Copy Markdown
Collaborator

@aiuto aiuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you merge with the current upstream so this is a smaller change.

@nacl nacl force-pushed the topic/pkgfilegroup-full-rpmgen branch from bd8d531 to 331cdc1 Compare February 28, 2020 16:53
@nacl nacl requested a review from aiuto February 28, 2020 16:55
@nacl
Copy link
Copy Markdown
Collaborator Author

nacl commented Feb 28, 2020

Can you merge with the current upstream so this is a smaller change.

Done.

@aiuto
Copy link
Copy Markdown
Collaborator

aiuto commented Mar 11, 2020

Hi. I'm back from vacation, so I can take a look again.
There is a lot going on here. It seems two orthogonal things going on.

  1. working with pkgfilegroup
  2. general improvements to make_rpm.py itself

What are your plans to get the improvements migrated from experimental up to the top level package?
In the long run, we are going to need that.

@nacl nacl force-pushed the topic/pkgfilegroup-full-rpmgen branch from 331cdc1 to 9e9e7a6 Compare March 26, 2020 19:24
@nacl
Copy link
Copy Markdown
Collaborator Author

nacl commented Mar 26, 2020

Hi. I'm back from vacation, so I can take a look again.
There is a lot going on here. It seems two orthogonal things going on.

1. working with pkgfilegroup

2. general improvements to make_rpm.py itself

What are your plans to get the improvements migrated from experimental up to the top level package?
In the long run, we are going to need that.

From what I can tell, it shouldn't be too difficult to combine the two together; the logic could be made more robust to multiple template types. Could also change the pkg_rpm starlark logic, but I think changes to make_rpm.py would be easier.

@nacl nacl requested a review from aiuto April 2, 2020 16:32
@aiuto
Copy link
Copy Markdown
Collaborator

aiuto commented Apr 13, 2020

What I was trying to get at was to not to do everything here and replace, but to take the rpm enhancements (like built in spec-file, pre/post scripts) and move them to the mainline code. Then have experimental derive from that.

But I'll be OK with getting this merged so that others can provide feedback no the pkg_filegroup stuff. While that is improving, we can backport the new features to the mainline code first, and bring in pkgfilegroup as we reach concensus.

Copy link
Copy Markdown
Collaborator

@aiuto aiuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are still experimenting, can you name it pkg_filegroup, rather than pkgfilergroup so it matches the convention of all the other names.

@nacl
Copy link
Copy Markdown
Collaborator Author

nacl commented Apr 14, 2020

While we are still experimenting, can you name it pkg_filegroup, rather than pkgfilergroup so it matches the convention of all the other names.

Certainly. How about I take care of this in a change that will go in after this one?

This change provides a prototype `pkgfilegroup`-based RPM builder in the form of
the `gen_rpm` rule.  See bazelbuild#128 for more details on `pkgfilegroup`.

The RPM generator was derived from `make_rpm.py` in `pkg/` and supports a number
of features over and above what's available in `pkg_rpm`.  As written, it, given
a template like the one provided, you can construct many full-fledged RPM
packages entirely within Bazel.  In most cases, the templates will only need to
be customized with advanced logic and other macros that are not settable via
bazel itself; `gen_rpm` will write much of the preamble, `%description` text,
`%install` scriptlets, and `%files` based on rule-provided inputs.

Documentation outside of the source files is not yet available.  This was
empirically tested on RPM packages internal to VMware with positive results;
actual tests of the rules are not yet ready.

This, naturally, is incomplete, and is missing capabilities such as:
- Configurable compression
- Configurable Provides/Requires
- SRPM emission
- Reproducibility
- Configurable stripping
- Configurable construction of "debug" packages

Co-authored-by: mzeren-vmw <[email protected]>
Co-authored-by: klash <[email protected]>
@nacl nacl force-pushed the topic/pkgfilegroup-full-rpmgen branch from 9e9e7a6 to 229a244 Compare April 14, 2020 20:57
@nacl nacl requested a review from aiuto April 14, 2020 21:01
@nacl
Copy link
Copy Markdown
Collaborator Author

nacl commented Apr 14, 2020

What I was trying to get at was to not to do everything here and replace, but to take the rpm enhancements (like built in spec-file, pre/post scripts) and move them to the mainline code. Then have experimental derive from that.

But I'll be OK with getting this merged so that others can provide feedback no the pkg_filegroup stuff. While that is improving, we can backport the new features to the mainline code first, and bring in pkgfilegroup as we reach concensus.

Ah, OK. Fair enough.

I'll work on this next after I clear out my stack of pending changes. I got symlink support and an RPM build tester in the pipe.

@nacl
Copy link
Copy Markdown
Collaborator Author

nacl commented Apr 14, 2020

It just occurred me that I'm probably making reviews difficult by force-pushing updates all the time. Sorry about that. Here's the text diff for the latest change:

9e9e7a6-to-229a244.diff.txt

@aiuto
Copy link
Copy Markdown
Collaborator

aiuto commented Apr 15, 2020

One thing I truly hate about github reviews is that it is telling me I requested changes, and it won't point me to the place I asked for them. There are more things, but that is one.

While we are still experimenting, can you name it pkg_filegroup, rather than pkgfilergroup so it matches the convention of all the other names.

Certainly. How about I take care of this in a change that will go in after this one?

Sure.

@aiuto aiuto merged commit 1c799ba into bazelbuild:master Apr 15, 2020
nacl added a commit to nacl/rules_pkg that referenced this pull request Apr 16, 2020
This change renames all instances of `pkgfilegroup` with `pkg_filegroup`, and
renames `experimental/genpkg.bzl` to `experimental/pkg_filegroup.bzl`.

Names of tests and documentation have been updated accordingly.  The change was
mostly made mechanically using `sed(1)`, with minor cleanup afterward.

This change makes the names within the experimental/ branch consistent, and was
requested in the review of bazelbuild#129.
nacl added a commit to nacl/rules_pkg that referenced this pull request Apr 16, 2020
This change renames all instances of `pkgfilegroup` with `pkg_filegroup`, and
renames `experimental/genpkg.bzl` to `experimental/pkg_filegroup.bzl`.

Names of tests and documentation have been updated accordingly.  The change was
mostly made mechanically using `sed(1)`, with minor cleanup afterward.

This change makes the names within the experimental/ branch consistent, and was
requested in the review of bazelbuild#129.
nacl added a commit to nacl/rules_pkg that referenced this pull request Apr 16, 2020
This change renames all instances of `pkgfilegroup` with `pkg_filegroup`, and
renames `experimental/genpkg.bzl` to `experimental/pkg_filegroup.bzl`.

Names of tests and documentation have been updated accordingly.  The change was
mostly made mechanically using `sed(1)`, with minor cleanup afterward.

This change makes the names within the experimental/ directory consistent, and was
requested in the review of bazelbuild#129.
nacl added a commit to nacl/rules_pkg that referenced this pull request Apr 16, 2020
This change renames all instances of `pkgfilegroup` to `pkg_filegroup`, and
renames `experimental/genpkg.bzl` to `experimental/pkg_filegroup.bzl`.

Names of tests and documentation have been updated accordingly.  The change was
mostly made mechanically using `sed(1)`, with minor cleanup afterward.

This change makes the names within the experimental/ directory consistent, and was
requested in the review of bazelbuild#129.
aiuto pushed a commit that referenced this pull request Apr 16, 2020
This change renames all instances of `pkgfilegroup` to `pkg_filegroup`, and
renames `experimental/genpkg.bzl` to `experimental/pkg_filegroup.bzl`.

Names of tests and documentation have been updated accordingly.  The change was
mostly made mechanically using `sed(1)`, with minor cleanup afterward.

This change makes the names within the experimental/ directory consistent, and was
requested in the review of #129.
@nacl nacl deleted the topic/pkgfilegroup-full-rpmgen branch January 19, 2021 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants