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.
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.
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.
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
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
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
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).
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
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
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
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
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
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
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.
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.
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.