[Rpm-ecosystem] Trying to understand %buildsubdir and debuginfo generation

Jeff Johnson n3npq at me.com
Fri Apr 27 03:34:04 UTC 2018



> On Apr 26, 2018, at 8:45 PM, Jason L Tibbitts III <tibbs at math.uh.edu> wrote:
> 
> To sort of answer my own question...
> 
> It isn't %build that's important.  There simply must be some other
> section between %prep and %install.
> 
> What I think happens is this:
> 
> The parser is running through %prep, doing whatever it does (expanding
> macros and building the script that will be executed, I guess).  It sees
> %install, which is defined as a macro, so it goes to expand it.  At that
> moment, %buildsubdir hasn't actually been defined as a macro because rpm
> is still parsing and hasn't executed anything (specifically the magic
> %setup macro).  So because %buildsubdir is not defined, %install just
> expands to... %install.
> 

Ok. There are means using %{expand: ...} to trigger an immediate expansion, and there are means to delay the expansion (if expanded multiple times) by escaping with a doubled %%.

Again, you need to find the person who chose to add that macro definition, and ask them what is/was the intent. There was no need for %install overloading when -debuginfo was first implemented. Nor do I have sufficient Fedora Packaging Commmitte context wrto R packaging to begin to understand and suggest an alternative implementation to whatever you are attempting ...

> An easy way to test this is to just move the %check section up above
> %install.   And... it works.  Even just adding an empty %clean section
> works fine.
> 
 Yes, but ... The original implementation of -debuginfo was based on a heuristic that is/was based on an expansion insertion point to drop-in the automagic definition of a -debuginfo subpackage.

That isn't you, with someone else's decision to overload %install with a test in %buildsubdir.

> So I guess this is down to two things:
> * RPM parsing is deep magic and will hurt your brain.

Oh definitely: spec file parsing is deeply flawed, largely for 2 reasons: 1) ctype(3) parsing 2) there is no proper parsing pass, everything is instead done as a side effect.

I get burned every time I attempt rpmbuild changes all this century.

> * Redefining the section "macros" is a recipe for "fun".

No idea what this means. Again note that your %install overloading has little to do with either the original implementation, Fedora R packaging, or the rpm macro implementation.

If you would like to back up and restate your problem goal differently, there is likely a solution.

> 
> I have no idea if this weirdness would be considered a bug.  I'll file a
> ticket if someone thinks it's worth it, but outside of R packages, I
> would expect there to be relatively few archful packages that would
> legitimately not have a %build section.
> 

You can always write Fedora R packaging policy mandating the existence of an empty %build section.

WORKSFORME

Meanwhile if you supply a R packaging goal, there is likely a solution. Your call.

73 de Jeff
> - J<
> _______________________________________________
> Rpm-ecosystem mailing list
> Rpm-ecosystem at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-ecosystem


More information about the Rpm-ecosystem mailing list