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
Macro file comment loading "regression" #1659
Comments
That also happens without the patch. I think you need
I.e. an empty line that used to terminate the body. |
If you don't mind rdcl() reaching an even higher level of ugliness, an easy fix
right before the This only does the "add continuation lines" magic for real macro definitions. A different thing to consider is if we want to revert the "empty line ends macro definition" |
Oh, sorry. I thought I had a minimal reproducer but it was in a bit of a haste (https://bugzilla.redhat.com/show_bug.cgi?id=1953910 is the original case) so I missed the some further subtleties. It indeed relates to the empty newlines, the real reproducer being:
...and whether xmacro3 gets defined depends on whether the patch is applied or not. And with this it all actually fits together in how the heck does that patch change the behavior in the original case 😅 |
Doesn't seem that bad to me, considering the company it's in. Perhaps a comment of the case would be in order. Care to submit a PR? I rather like the new behavior otherwise. |
Personally, I would prefer to emit an error here. |
No you wouldn't. Nobody expects contents of a #-commented line to affect anything coming after it, it's just absurd. It's absurd in specs too as indicated by the endless bugs and tickets filed on the behavior over the years, but at least there we have an excuse or two, and other options (%dnl). |
Silently discarding everything after the comment is certainly wrong, but I agree that comment lines should not be parsed. |
…1659) Previously %{ and similar in macro file comment line would cause the line continuation logic to trigger and silently eat macro definitions up to the next empty line. Since 75275a8 we permit empty lines inside macro definitions, which would cause the whole remaining file to be silently skipped (RhBug:1953910) Only ever parse macro file lines starting with %, and add a test for the case. Actual patch by Michael Schroeder, testcase by undersigned. Fixes: rpm-software-management#1659
@mlschroe , I went ahead and created a PR from this with a testcase, hope you don't mind. |
Previously %{ and similar in macro file comment line would cause the line continuation logic to trigger and silently eat macro definitions up to the next empty line. Since 75275a8 we permit empty lines inside macro definitions, which would cause the whole remaining file to be silently skipped (RhBug:1953910) Only ever parse macro file lines starting with %, and add a test for the case. Actual patch by Michael Schroeder, testcase by undersigned. Fixes: #1659
Oh and BTW, thanks @mlschroe for the quick fix! |
PR #1606 (commit 75275a8) changed macro file loading in a subtle way. Prior to that, the both macros in the following would be loaded. Now, anything coming after the comment gets silently discarded:
There are two ways to see this: either the contents of comment lines should be completely ignored, or this should emit an error about an unterminated macro. In spec, macros are expanded in comments too so the latter would be more consistent with that, but in macro files we're not expanding anything ever which suggests the former should be the right behavior. Thoughts? @mlschroe , others...
The text was updated successfully, but these errors were encountered: