Bug 613010

Summary: Strange error message from rpmbuild
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: rpmAssignee: Jindrich Novy <jnovy>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ffesti, jnovy, n3npq, pknirsch, pmatilai
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-13 12:10:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2010-07-09 14:16:11 UTC
Description of problem:

$ rpmbuild -ta guestfs-browser-0.0.3.tar.gz 
error: Recursion depth(17) greater than max(16)
 15<                               (empty)
 14<                             (empty)
 13<                           (empty)
 12<                         (empty)
 11<                       (empty)
 10<                     (empty)
  9<                   (empty)
  8<                 (empty)
  7<               (empty)
  6<             (empty)
  5<           (empty)
  4<         (empty)
  3<       (empty)
  2<     (empty)
  1<   (empty)
  0< Source0:        http://people.redhat.com/~rjones/guestfs-browser/files/guestfs-browser-
error: line 10: Source0:        http://people.redhat.com/~rjones/guestfs-browser/files/guestfs-browser-

Version-Release number of selected component (if applicable):

rpm-build.x86_64 0:4.8.1-3.fc14

How reproducible:

Always.

Steps to Reproduce:
1. Download http://annexia.org/tmp/guestfs-browser-0.0.3.tar.gz
2. Run rpmbuild -ta guestfs-browser-0.0.3.tar.gz
3.
  
Actual results:

Strange error message.

Expected results:

Understandable error message.

Additional info:

Comment 1 Jindrich Novy 2010-07-09 15:30:18 UTC
The message is rather cryptic but makes perfect sense. Note that you have Version: %{version} at line 2 in the spec file what leads macro evaluator to infinite loop when evaluating Source0 at line 9 in spec:

Source0: http://people.redhat.com/~rjones/guestfs-browser/files/guestfs-browser-%{version}.tar.gz

Please fix your spec file.

Comment 2 Richard W.M. Jones 2010-07-09 16:24:52 UTC
I'm not an idiot.  I understand there is a problem with the
spec file, but the error message doesn't say anything useful
such as "you shouldn't use symbol %{version} recursively".

Comment 3 Jeff Johnson 2010-07-09 23:52:35 UTC
All macro processors do not have sufficient context to provide
useful errot messages in situ, largely because there are multiple
contexts associated.

But sure a better error message could/should/would help.

So would better input to the macro expansion.

Comment 4 Jindrich Novy 2010-07-13 12:10:32 UTC
Fixed upstream.

The new error message now looks like:

error: Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration.
error: line 10: Source0:        http://people.redhat.com/~rjones/guestfs-browser/files/guestfs-browser-

and the macro stack backtrace is now redirected to debug log in order to avoid user confusion.

Comment 5 Richard W.M. Jones 2010-07-13 12:44:16 UTC
Much better, thanks.