Enable pkg_rpm and pkg_subrpm to create empty RPMs#859
Merged
aiuto merged 4 commits intobazelbuild:mainfrom Apr 24, 2024
Merged
Enable pkg_rpm and pkg_subrpm to create empty RPMs#859aiuto merged 4 commits intobazelbuild:mainfrom
aiuto merged 4 commits intobazelbuild:mainfrom
Conversation
At present we fail in two ways if we try to create empty RPMs: - we expect srcs to be both non-empty and will fail if it is empty and we have no spec file - we don't emit anything for the `%files` block in the RPM if there are no actual files and rpmbuild doesn't like this This change tweaks the former condition so that srcs has to be non-None or we have to have a specfile, but will allow us to have an empty (`[]`) value for srcs. Additionally, it injects `%defattr(-,root,root)` as a reasonable default for the `%files` blocks so as to allow rpmbuild to be happy with what we're providing.
aiuto
reviewed
Apr 17, 2024
Collaborator
aiuto
left a comment
There was a problem hiding this comment.
I still wonder why anyone would want an empty RPM, but I'll go with the flow on that.
Contributor
Author
The examples I've encountered thusfar involve having an empty / stub top level RPM with non-empty sub RPMs, although I figured it's harmless to also enable sub RPMs to do this too. |
We should be safe to inject this unconditionally instead of special casing on whether or not we have no actual files.
aiuto
approved these changes
Apr 24, 2024
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.
At present we fail in two ways if we try to create empty RPMs:
we expect srcs to be both non-empty and will fail if it is empty and we have no spec file
we don't emit anything for the
%filesblock in the RPM if there are no actual files and rpmbuild doesn't like thisThis change tweaks the former condition so that srcs has to be non-None or we have to have a specfile, but will allow us to have an empty (
[]) value for srcs. Additionally, it injects%defattr(-,root,root)as a reasonable default for the%filesblocks so as to allow rpmbuild to be happy with what we're providing.Fixes #711