Allow substitution of user-defined variables in RPM preamble#787
Merged
aiuto merged 6 commits intobazelbuild:mainfrom Jan 2, 2024
Merged
Allow substitution of user-defined variables in RPM preamble#787aiuto merged 6 commits intobazelbuild:mainfrom
aiuto merged 6 commits intobazelbuild:mainfrom
Conversation
It's desirable to be able to parameterize some variables in the preamble such as architecture when RPM packages. This change enables variable substitution in the preamble section so that the values may be injected in this fashion in lieu of only using statically defined values.
Currently we don't handle things like $(foo or (bar) correctly. Lacking regex matching, we can compensate for this somewhat by attempting to find matching pairs of $( and ) and failing if we see the start of a variable declaration but not its termination.
b5f46be to
d8c35ba
Compare
cgrindel
reviewed
Dec 12, 2023
Collaborator
cgrindel
left a comment
There was a problem hiding this comment.
Overall, the changes look reasonable to me. Could you ping me when CI is green?
Contributor
Author
|
Will do! |
aiuto
reviewed
Dec 22, 2023
aiuto
reviewed
Dec 22, 2023
Collaborator
aiuto
left a comment
There was a problem hiding this comment.
The PR description doesn't seem to match the code at all. It looks like the code just adds some safety against someone mis-typing a variable like $(foo} something (bar) .
Contributor
Author
The initial PR + first commit match up. When the CI job ran to test the initial changes, it hit the former case that the second commit fixes. |
aiuto
approved these changes
Jan 2, 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.
It's desirable to be able to parameterize some variables in the preamble such as architecture when RPM packages. This change enables variable substitution in the preamble section so that the values may be injected in this fashion in lieu of only using statically defined values.