* Update to new stardoc so we can work with bzlmod.
* Requires update to merge.py to account for stardoc changes.
* put integration test back on bazel at head.
Fixes #808
* rpm: Add support for sub packages to make_rpm.py script
Before we can enable support for sub RPM building as part of a single
`pkg_rpm()` rule we must add the underlying support to make_pkg.py
which is the underlying driver for `pkg_rpm()`.
This covers three pieces:
* specifying `buildsubdir` rpm variable
* capturing multiple RPM files as outputs
* injecting sub RPM definitions into specfile
* rpm: Factor out rpm_ctx helper
The various processing functions pass around a bunch of collections
everywhere which is a bit fragile. This collects them together into a
struct to make it a bit less messy.
* rpm: Factor out _process_dep() helper function
_process_dep() handles processing an individual dep and is currently
called from the processing loop. We'll need to re-use this logic for
processing individual sub RPMs as well so we want it in a helper.
* rpm: Capture generated output RPM files in rpm_ctx
Currently we only generate one RPM file, but once we generate sub RPM
files we'll need to be able to capture those outputs as well. This
prepares us for that step.
* rpm: Add args for make_rpm to rpm_ctx
We'll need to add additional arguments to make_rpm for sub RPM
building. It's easier to capture this in our context object than to
try to shuttle these bits around.
* rpm: Pass correct `--name` argument to make_rpm
If we don't pass the correct RPM name to `make_rpm.py` than we won't be
able to correctly determine the subrpm names. Currently, the name is
only used by `make_rpm` to generate some progress output, so this
shouldn't break anything internally.
* rpm: Implementation of `pkg_sub_rpm` rule
This introduces a `pkg_sub_rpm` rule that allows us to generate and
capture RPM subpackages and generate them as part of a single RPM
invocation in lieu of cobbling this together from multiple RPM rules.
This has a few benefits:
- faster execution due to single rpmbuild invocation
- sharing configuration between RPMs in the same fashion as vanilla
RPM building from a specfile
- will enable the proper construction of debuginfo RPMs in a later PR
The current implementation *only* works with non-specfile based rules
and currently allows for a subset of the general RPM configuration.
Internally, the process is for `pkg_sub_rpm` to generate a
PackageSubRPMInfo provider that will subsequently get consumed by the
`pkg_rpm` rule that generates the actual RPMs. We re-use the internal
dependency processing logic that's used by the top-level RPM to
generate the content related to the sub-RPM.
* rpm: Update entry points for RPM rules to include pkg_sub_rpm
This change updates `rpm.bzl` in two ways to account for sub RPMs:
- it adds an entrypoint for `pkg_sub_rpm`
- it adds a check in `pkg_rpm` to assert incompatibility with
`spec_file`
* examples: Add an example of how to use the subrpm rule
This provides a basic example using the `pkg_sub_rpm` rule to generate
multiple RPMs.
* Fix buildifier noise
* Fix make_rpm failures
* doc: Clean up sub-RPM docstring and add to doc_build
The initial docstring for pkg_sub_rpm is not great, so this change
fixes that while adding this to the list of rules to have
documentation generated for them.
* doc: Additional documentation for subrpms in pkg_rpm
This clarifies the `subrpms` attribute usage as well as indicating the
incompatibility with `spec_file` mode.
* Fix issue in subrpm passthrough
When adding the check to verify if we can use subrpms, this pass
through wasn't added.
* Add a basic test for pkg_sub_rpm
This introduces a basic test with a single sub RPM and main RPM each
containing a single source file.
* Tweaks to test
* Test fixes for CentOS 7
The `rpm` version on CentOS 7 doesn't work exactly the same way as
newer versions of rpm and requires a `-p` parameter to inspect
non-installed RPMs. CentOS 7 also inserts a `Relocations` field that
we didn't see on other platforms so we'll filter that out to make our
test a bit more portable.
* Move PackageSubRPMInfoProvider into rpm_pfg.bzl
This is private to the RPM rules so should probably live there.
* Document that package_dir also uses package_variables
The pkg_zip and pkg_tar rule already support variable substitution in their
package_dir parameter, it was only documented for package_variables so far.
* Make Common Attributes linkable
When we merge generated docs into the final form, convert
@since(text) to emphasized (currently italic) text.
This is not intended to be perfect. It is just to get the concept out
there to start playing with it. Ideally, StarDoc will eventually support
@since natively and we can delete this.
* Make the .bzl files available as input to a bzl_library, without having to resort to the invasivness of a shadow tree of just the .bzl files without the other distributable files.
* Add @rules_license declarations.
This is a little more unwieldy than we would like, in that we
hand add them to each BUILD file.
This should be enforced with a test, but it should be a non-Bazel
test at the source code level.
* Try to make the docs a little better.
- Fix stardoc adding <p align=center> in markdown tables.
- Add rough capability to handle macros that wrap a rule.
The wrapping technique is:
- In the wrapping macro, use the docstring @wraps(some_rule)
- Then we don't emit the docs for the wrapper
- In the docs for some_rule, replace the string "some_rule" with the
name of the wrapper macro.
It is a first attempt to make things better. It is crude, but it
mostly works.It is a first attempt to make things better. It is crude, but it mostly works. If Stardoc ever adds this capability [(feature request)[https://github.com/bazelbuild/stardoc/issues/120] we can move to that.
where the rules are defined. Without that, you just have to know.
It would be nice if stardoc had support for adding the bzl path out of the box.
https://github.com/bazelbuild/stardoc/issues/120
* Add 0.6.0 doc tree
* fix <li>s in stamp docs
* fix the <li> in tables with a stardoc bug workaround.
* remove obsolete reference.md that was imbedded in the wrong place
* Improved doc generation: Produce a single reference doc.
- moves doc generation out of distro into a separate doc_build tree
- creates a single reference.md from the common attributes section
plus the individual page.
Future plans
- post transform the .html to add links between sections
- post transform the .html to add external links to Bazel docs.
- add procedures to cut doc releases alongside distribution releases