Bug 1056271

Summary: Spec files that depend on macros cannot be built from SCM
Product: [Fedora] Fedora Reporter: Rodrigo Dias Cruz <rodrigodc+redhatbugzilla>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mebrown, peter.jonsson, rodrigodc+redhatbugzilla, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.1.38-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-09 13:18:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch that fixes the problem none

Description Rodrigo Dias Cruz 2014-01-21 20:35:11 UTC
Description of problem: spec files that depend on macros cannot be built directly from SCM (option --scm-enable). The reason is that the scm plugin ignores the macros defined in the command line (option --define="MACRO EXPR").


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


How reproducible: 1)  2) 


Steps to Reproduce:

1. Take a Git repository with a spec file that depends on some user-defined macro, for example %{version}.

2. Try to build that spec file using something like: /usr/bin/mock -v -r epel-6-x86_64 --scm-enable --scm-option package=guardis-agent --scm-option package=SOME_PKG --define="version 0.7"


Actual results:

The command line defined macro is ignored and the spec file cannot be parsed because it is missing.

"""
DEBUG: Preparing SCM sources
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< Source: guardis-agent-
error: line 5: Source: SOME_PKG-
"""

Expected results:

The command-line defined macro should be used, the spec file should be correctly parsed and be successfully built from SCM.


Additional info:

The problem does not happen when building directly from SRPM, only from SCM.

Comment 1 Rodrigo Dias Cruz 2014-01-21 20:39:07 UTC
Created attachment 853438 [details]
Patch that fixes the problem

Here is a patch that can fix the problem. It basically passes to the scm plugin all command line options with macro definitions (--define="MACRO EXPR"), then the scm plugin tells the RPM module to use those macros when parsing the spec file.

The patch is based on the latest master, commit cba8ec7ea5bcac835159f4506a5665b6a1852811.

Comment 2 Peter Jönsson 2014-02-17 12:36:43 UTC
Hi!

I have verified this in our build environment at $DAY_JOB as well. We sent in %{version} expanded from the git tag name. But with this patch everything is expanded nicely.

Comment 3 Fedora Update System 2014-03-25 20:24:37 UTC
mock-1.1.37-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc19

Comment 4 Fedora Update System 2014-03-25 20:27:02 UTC
mock-1.1.37-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc20

Comment 5 Fedora Update System 2014-03-25 20:29:09 UTC
mock-1.1.37-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.el6

Comment 6 Fedora Update System 2014-03-26 17:37:53 UTC
Package mock-1.1.37-1.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.1.37-1.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0960/mock-1.1.37-1.el6
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-03-27 17:47:40 UTC
mock-1.1.37-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc20

Comment 8 Fedora Update System 2014-03-27 17:49:33 UTC
mock-1.1.37-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc19

Comment 9 Fedora Update System 2014-03-27 17:51:28 UTC
mock-1.1.37-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.el6

Comment 10 Fedora Update System 2014-03-31 19:04:16 UTC
mock-1.1.38-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc19

Comment 11 Fedora Update System 2014-03-31 19:06:38 UTC
mock-1.1.38-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.el6

Comment 12 Fedora Update System 2014-03-31 19:08:34 UTC
mock-1.1.38-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc20

Comment 13 Fedora Update System 2014-04-09 13:18:31 UTC
mock-1.1.38-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2014-04-18 15:37:29 UTC
mock-1.1.38-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2014-04-19 09:19:48 UTC
mock-1.1.38-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.