Add nFPM backend for building system packages (only the nfpm core bits)#19308
Merged
cognifloyd merged 200 commits intomainfrom Aug 14, 2024
Merged
Add nFPM backend for building system packages (only the nfpm core bits)#19308cognifloyd merged 200 commits intomainfrom
cognifloyd merged 200 commits intomainfrom
Conversation
Also, add type hints for some of the field.alias properties because mypy was getting confused.
This is needed for the field_set calculations
A common field that all nfpm packages will share, making it easier to build a common FieldSet base.
Almost all fields are "required" in that, if present, they are used in the generation of the package. Users do not have to supply them, but the fields have to exist on the Nfpm*Package targets.
Member
Author
|
I extracted |
CI does not allow skipped tests, so just drop them and re-add them when adding the first packager type.
5745a77 to
3e1a88d
Compare
tdyas
approved these changes
Aug 13, 2024
Contributor
tdyas
left a comment
There was a problem hiding this comment.
Very nice. Thank you for splitting up the original PR into separate PRs.
Approved with some minor style comments.
|
|
||
| ### Backends | ||
|
|
||
| #### NEW: nFPM |
Contributor
There was a problem hiding this comment.
Do you plan on having an example-nfpm repository users could look at? No need to develop it now or even reference it if you have one, but might be good to keep in mind as a follow-on.
Member
Author
There was a problem hiding this comment.
I hadn't thought about that. I think a section in the documentation might be useful as well, but I don't know when I can tackle something like that.
cognifloyd
added a commit
that referenced
this pull request
Aug 14, 2024
This adds deb packaging to the nfpm backend introduced in #19308. It also adds the integration tests that require an `nfpm_*_package` target. New target (and related fields): - `nfpm_deb_package`
cognifloyd
added a commit
that referenced
this pull request
Aug 14, 2024
This adds rpm packaging to the nfpm backend introduced in #19308. New target (and related fields): - `nfpm_rpm_package`
cognifloyd
added a commit
that referenced
this pull request
Aug 14, 2024
This adds apk packaging to the nfpm backend introduced in #19308. New target (and related fields): - `nfpm_apk_package`
cognifloyd
added a commit
that referenced
this pull request
Aug 14, 2024
This adds archlinux packaging to the nfpm backend introduced in #19308. New target (and related fields): - `nfpm_archlinux_package`
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.
Builds an
nfpmbackend fornFPMaccording to this plan:https://docs.google.com/document/d/1b2ZvP_Ol6bOURHBaZYOD8gxixxHpV22S_zKiHKZw9iY/edit?usp=sharing
In summary, these are the new targets in this backend (along with many fields that these targets use):
nfpm_content_filesnfpm_content_filenfpm_content_dirsnfpm_content_dirnfpm_content_symlinksnfpm_content_symlinkThese targets (and their fields) are prepared for follow-up PRs:
nfpm_deb_packagenfpm_apk_packagenfpm_archlinux_packagenfpm_rpm_packageThere are several fields that I did not implement (as mentioned in the doc linked above):
signature_key_filewill need dep inference when addedsignature_key_idsignature_key_name(apk only)signature_method(deb only)signature_type(deb only)signature_signer(deb only)changeloga yaml config file that nFPM transforms into packager-specific changelog files (only for deb, rpm)Supporting this might require additional fields for the pants-plugin to generate the file somehow.
In the future, someone could also add support for IPK packages.
nFPMjust barely gained support for that inv2.37.1. Writing the documentation for all of the other fields took me a long time, so I don't plan on addingnfpm_ipk_packageany time soon. If someone wants this, they just need to add the target, ipk-specific fields, and wire the target into the various rules (via UnionRule or tiny wrapper rules), which should be fairly straight forward. I'm happy to help guide anyone that chooses to implement this.Relationship with other PRs:
TraverseIfNotPackageTargetdeps traversal predicate for use in plugins #19306 (merged).TupleSequenceFieldtype #21301