Skip to content
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 pkgfilegroup for package-independent destination mappings #128

Merged
merged 2 commits into from
Feb 28, 2020

Conversation

nacl
Copy link
Collaborator

@nacl nacl commented Jan 14, 2020

This adds an experimental rule, pkgfilegroup, along with associated Providers,
that gives rule developers and users a consistent mechanism for using the output
of bazel targets in packaging rules.

Inspired by #36.

Other capabilities that are provided by this that were not mentioned in #36 are:

  • Creation of empty directories (pkg_mkdirs)
  • Exclusion of files from a pkgfilegroup (excludes)
  • Renames of files in a pkgfilegroup (renames)

This adds an experimental rule, `pkgfilegroup`, along with associated Providers,
that gives rule developers and users a consistent mechanism for using the output
of bazel targets in packaging rules.

Inspired by bazelbuild#36.

Other capabilities that are provided by this that were not mentioned in bazelbuild#36 are:

- Creation of empty directories (`pkg_mkdirs`)
- Exclusion of files from a `pkgfilegroup` (`excludes`)
- Renames of files in a `pkgfilegroup` (`renames`)
@nacl nacl requested a review from aiuto as a code owner January 14, 2020 22:34
nacl pushed a commit to nacl/rules_pkg that referenced this pull request Jan 14, 2020
This provides some analysis tests for various features of `pkgfilegroup` and
`pkg_mkdirs`.  See bazelbuild#128.

You can run them by invoking `bazel test experimental/...` from the `pkg`
directory

This implementation of pkgfilegroup was inspired by bazelbuild#36.

This commit depends on bazelbuild#128.
This provides some analysis tests for various features of `pkgfilegroup` and
`pkg_mkdirs`.  See bazelbuild#128.

You can run them by invoking `bazel test experimental/...` from the `pkg`
directory

This implementation of pkgfilegroup was inspired by bazelbuild#36.
@nacl nacl force-pushed the topic/pkgfilegroup-full branch from 78af648 to e3c71cb Compare January 14, 2020 22:53
nacl pushed a commit to nacl/rules_pkg that referenced this pull request Jan 14, 2020
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
Co-authored-by: klash
nacl pushed a commit to nacl/rules_pkg that referenced this pull request Jan 15, 2020
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]>
Copy link
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.

Since this is all in experimental, it's fine.
Just the question about the workspace.
Thanks for putting in the missing copyright blocks.

pkg/WORKSPACE Show resolved Hide resolved
Copy link
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 write a doc outlining the remaining plan here so that interested parties can try to experiment with it?

@aiuto aiuto merged commit e5919f4 into bazelbuild:master Feb 28, 2020
aiuto added a commit to aiuto/rules_pkg that referenced this pull request Feb 28, 2020
aiuto added a commit that referenced this pull request Feb 28, 2020
nacl pushed a commit to nacl/rules_pkg that referenced this pull request Feb 28, 2020
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 pushed a commit to nacl/rules_pkg that referenced this pull request Mar 26, 2020
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 pushed a commit to nacl/rules_pkg that referenced this pull request Apr 14, 2020
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]>
aiuto pushed a commit that referenced this pull request Apr 15, 2020
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, 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]>

Co-authored-by: mzeren-vmw <[email protected]>
Co-authored-by: klash <[email protected]>
@nacl nacl deleted the topic/pkgfilegroup-full 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.

2 participants