Bug 1198009

Summary: rpmdev-setuptree overrides %_smp_mflags macro
Product: [Fedora] Fedora Reporter: Panu Matilainen <pmatilai>
Component: rpmdevtoolsAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: bugs.michael, kevin, twoerner, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpmdevtools-8.6-1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-11 19:08:36 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:

Description Panu Matilainen 2015-03-03 08:26:03 UTC
Description of problem:
rpmdev-setuptree overrides %_smp_mflags macro by writing one of its own into users ~/.rpmmacros. This causes any improvements done to the central version of this macro go down the toilet because the one in ~/.rpmmacros is never updated once written. For example it does not honor %_smp_ncpus_max macro which caused me a fair amount of unnecessary head-scratching to figure where the -j3 was coming from in a copr build, despite setting %_smp_ncpus_max to 1 in spec.

Please stop overriding the macro. 

Version-Release number of selected component (if applicable):
rpmdevtools-8.5-1, git head apparently as well

How reproducible:
Always

Steps to Reproduce:

[luser@localhost ~]$ rpm --eval "%{_smp_mflags}"
-j4
[luser@localhost ~]$ rpm --define "%_smp_ncpus_max 1" --eval "%{_smp_mflags}"

[luser@localhost ~]$ rpmdev-setuptree 
[luser@localhost ~]$ rpm --eval "%{_smp_mflags}"
-j4
[luser@localhost ~]$ rpm --define "%_smp_ncpus_max 1" --eval "%{_smp_mflags}"
-j4

Note that this is NOT a request for adding %_smp_ncpus_max support, but to stop overriding what could be considered a system macro for no really good reason. The original point was to force parallel build on non-smp systems to shake out makefile bugs. Most systems are smp these days so the original point is largely lost by now, but it has negative effect on other users.

Comment 1 Ville Skyttä 2015-03-03 09:13:26 UTC
I believe the original point was not to force anything (can't be done with this macro I believe) but to define _some_ useful value for %_smp_mflags as it was not necessarily defined at all back then even on SMP systems.

Anyway, removed in git, https://git.fedorahosted.org/cgit/rpmdevtools.git/commit/?id=fc64adc538b9bf1fce90600868f81f4f95a65bcd

Comment 2 Panu Matilainen 2015-03-03 09:26:24 UTC
Right, force might be an inaccurate expression and its entirely possible there were other reasons as well, but I do recall getting parallel builds on non-smp systems was at least one of the points in them good ol' days. That'd be fedora.us era when most of us were only dreaming of smp at home, yet the builders were Big Fancy machines with two cpus and tripping up all sorts of weird build errors :)

Anyway, thanks. Removed in git is good enough for me, so feel free to CLOSE -> UPSTREAM unless you to track this for other purposes.

Comment 3 Fedora Update System 2015-05-10 18:47:21 UTC
rpmdevtools-8.6-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/rpmdevtools-8.6-1.fc22

Comment 4 Fedora Update System 2015-05-11 19:08:36 UTC
rpmdevtools-8.6-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.