Issue 11122: bdist_rpm should use rpmbuild, not rpm (original) (raw)

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: James.Bennet, bhyde, cheryl.sabella, cstratak, eric.araujo, eric.smith, miss-islington, ned.deily, petere, purpleidea, stanp, tarek, westley.martinez
Priority: normal Keywords: easy, patch

Created on 2011-02-04 21:19 by purpleidea, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix-rpm-use-2.7.diff eric.araujo,2014-03-13 22:22
Pull Requests
URL Status Linked Edit
PR 10594 merged n0npax,2018-11-18 20:10
PR 13922 merged miss-islington,2019-06-08 21:07
Messages (25)
msg127942 - (view) Author: James (purpleidea) Date: 2011-02-04 21:19
Hi distutils, When I run: ./setup.py bdist --formats=rpm on my source directory, I get the error: rpm -ba --define _topdir /home/james/code/scantran/build/bdist.linux-x86_64/rpm --clean build/bdist.linux-x86_64/rpm/SPECS/scantran.spec -ba: unknown option error: command 'rpm' failed with exit status 1 It seems the problem can be fixed by installing the rpm-build package (on fedora 14 anyways) and so perhaps something should be done so that this is more obvious... HTH, James
msg127943 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 21:23
Does this mean that there is one rpm command that does not have all options, and that rpm-build overwrites that command with another one that does the right thing?
msg127944 - (view) Author: James (purpleidea) Date: 2011-02-04 21:32
In the source for distutils it seems to attempt to use 'rpmbuild' if it exists, but otherwise falls back on regular 'rpm', however in my rpm: $ rpm --version RPM version 4.8.1 this fails as there is no -ba option. James
msg127945 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 21:37
What is your OS name and version? Is that rpm version considered obsolete or not?
msg127948 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2011-02-04 22:45
"rpm -ba" is very old. I think it's been at least since 2002 that "-ba" was supported by rpm. I believe bdist_rpm is calling "rpmbuild -ba", and if that doesn't exist, then "rpm -ba" is a transition strategy until all systems supported "rpmbuild". This transition period should be over. Unfortunately today it's far more likely that "rpm -ba" will not be what you want to call, but "rpm" will almost always be found, giving this error. Most systems (certain RedHat based) ship rpmbuild as a separate command. RedHat installs it via the rpm-build package. I'd suggest just switching bdist_rpm to always use rpmbuild. Then at least the error would be that rpmbuild isn't found.
msg127958 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-05 01:01
This is a gray area between bugfix and bahavior change forbidden by the feature freeze. Would it be okay for you to add a note in the docs and close this report?
msg127959 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-05 01:02
> Would it be okay for you to add a note in the docs and close this report? I meant to ask whether you would agree with that outcome, not that you should do the work (you’re welcome to provide a patch if you want to, but that’s not required).
msg128005 - (view) Author: James (purpleidea) Date: 2011-02-05 17:41
I'll write a docs and script patch for this next week... I'm happy to do the work, Thanks for the comments. James
msg128052 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-06 12:02
Thanks for volunteering. I will review and apply when the py3k branch is unfrozen. > I'll write a docs and script patch for this next week... Note that I proposed to patch the docs only.
msg128053 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-06 12:05
BTW, it may be useful to point people to http://pypi.python.org/pypi/pypi2rpm, which contains an updated command, bdist_rpm2.
msg153098 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-11 05:25
Given that we’ve made changes to distutils for Debian multiarch or Mac OS X compiler breakage, I now think that switching distutils to only use rpmbuild would be reasonable.
msg155120 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-03-07 20:54
More info on rpm vs. rpmbuild: http://bugs.python.org/issue1533164#msg82592
msg175042 - (view) Author: Peter Eisentraut (petere) * Date: 2012-11-07 04:50
I ran into a similar instance of this problem today and would like to add my support for just getting rid of the "rpm" calls and just call "rpmbuild" in all cases. The last release where "rpm" was used for building was more than 10 years ago.
msg177241 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2012-12-09 22:02
I agree on just switching to rpmbuild, at least for 3.4.
msg193105 - (view) Author: James Bennet (James.Bennet) Date: 2013-07-15 14:28
I have observed this bug under CentOS 5.9 using the version of python-setuptools from the official CentOS repository. -ba is not a valid option for that version of RPM. I am able to get further by installing the rpm-build package.
msg213484 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-13 22:22
Can someone test the attached patch for 2.7? I don’t know if the second use (rpm -q --qf etc) should be converted too.
msg213588 - (view) Author: Peter Eisentraut (petere) * Date: 2014-03-14 20:15
No, the second use should not be converted.
msg315180 - (view) Author: Stanislav P (stanp) Date: 2018-04-10 21:03
can this patch be sped up? i am running into this issue with the latest python version the patch was submitted 7 years ago i don't see any workaround.
msg315188 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2018-04-11 09:55
I could make a PR out of the patch but I wonder if anyone is actually using this functionality. Wearing my Fedora's python maintainer hat, we have a lot of tooling around rpm that handles those things, so I don't think there is a valid usecase for Fedora at least. Is it useful somehow for other rpm based distros or is the resulting rpm's functional enough for some testing at least?
msg315197 - (view) Author: Stanislav P (stanp) Date: 2018-04-11 17:30
i am using this on redhat enterprise and mac. both running python 3.5 both running latest rpm. if you can make a pr it would great.
msg315198 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2018-04-11 17:34
The bug exists indeed but I would like to know what is the actual use case here.
msg315200 - (view) Author: Stanislav P (stanp) Date: 2018-04-11 20:20
the use case is being able to publish python package as rpm using setup.py on mac.
msg330061 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-11-18 19:29
Note that Issue32281 also describes the problem of trying to use build_rpm on non-rpm systems, again specifically macOS. Before stumbling on this issue,I had suggested over there to use change bdist_rpm to not use hardwired paths for rpmbuild but, if the better solution is to just unconditionally use rpmbuild, let's do that instead.
msg345063 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-06-08 21:05
New changeset 45a14942c969ed508b35abd5e116cb18f84ce5b4 by Cheryl Sabella (Marcin Niemira) in branch 'master': bpo-11122: fix hardcoded path checking for rpmbuild in bdist_rpm.py (GH-10594) https://github.com/python/cpython/commit/45a14942c969ed508b35abd5e116cb18f84ce5b4
msg345067 - (view) Author: miss-islington (miss-islington) Date: 2019-06-08 21:25
New changeset 3f7629d93c8cb3e0ee118c6a6463250f03d6c9f9 by Miss Islington (bot) in branch '3.8': bpo-11122: fix hardcoded path checking for rpmbuild in bdist_rpm.py (GH-10594) https://github.com/python/cpython/commit/3f7629d93c8cb3e0ee118c6a6463250f03d6c9f9
History
Date User Action Args
2022-04-11 14:57:12 admin set github: 55331
2019-06-08 21:25:24 miss-islington set nosy: + miss-islingtonmessages: +
2019-06-08 21:07:15 miss-islington set pull_requests: + <pull%5Frequest13795>
2019-06-08 21:06:22 cheryl.sabella set status: open -> closedresolution: fixedstage: patch review -> resolved
2019-06-08 21:05:09 cheryl.sabella set nosy: + cheryl.sabellamessages: +
2018-11-18 20:10:22 n0npax set pull_requests: + <pull%5Frequest9839>
2018-11-18 19:29:02 ned.deily set messages: +
2018-11-18 19:25:44 ned.deily link issue32281 superseder
2018-11-18 19:25:33 ned.deily set nosy: + ned.deily, bhydeversions: - Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6
2018-04-11 20:20:01 stanp set messages: +
2018-04-11 17:34:56 cstratak set messages: +
2018-04-11 17:30:10 stanp set messages: +
2018-04-11 09:55:08 cstratak set nosy: + cstratakmessages: +
2018-04-10 21:03:12 stanp set nosy: + stanpmessages: + versions: + Python 3.5, Python 3.6, Python 3.7, Python 3.8
2014-03-14 20:15:50 petere set messages: +
2014-03-13 22:22:17 eric.araujo set files: + fix-rpm-use-2.7.diffversions: + Python 3.4, - Python 3.2messages: + keywords: + patchstage: needs patch -> patch review
2014-02-26 20:37:32 westley.martinez set nosy: + westley.martinez
2013-07-15 14:28:44 James.Bennet set nosy: + James.Bennetmessages: +
2012-12-09 22:02:45 eric.smith set messages: +
2012-11-07 04:50:19 petere set nosy: + peteremessages: +
2012-03-07 20:55:03 eric.araujo set title: bdist_rpm fails -> bdist_rpm should use rpmbuild, not rpm
2012-03-07 20:54:46 eric.araujo set keywords: + easymessages: + stage: needs patch
2012-02-11 05:25:58 eric.araujo set messages: + versions: - Python 3.1
2011-02-06 12:05:29 eric.araujo set nosy:eric.smith, tarek, eric.araujo, purpleideamessages: +
2011-02-06 12:02:01 eric.araujo set assignee: tarek -> eric.araujomessages: + nosy:eric.smith, tarek, eric.araujo, purpleidea
2011-02-05 17:41:12 purpleidea set nosy:eric.smith, tarek, eric.araujo, purpleideamessages: +
2011-02-05 01:02:30 eric.araujo set nosy:eric.smith, tarek, eric.araujo, purpleideamessages: +
2011-02-05 01:01:18 eric.araujo set nosy:eric.smith, tarek, eric.araujo, purpleideamessages: + versions: + Python 3.1, Python 3.2, Python 3.3
2011-02-04 22:45:24 eric.smith set nosy: + eric.smithmessages: +
2011-02-04 21:37:33 eric.araujo set nosy:tarek, eric.araujo, purpleideamessages: +
2011-02-04 21:32:13 purpleidea set nosy:tarek, eric.araujo, purpleideamessages: +
2011-02-04 21:23:41 eric.araujo set nosy:tarek, eric.araujo, purpleideamessages: +
2011-02-04 21:19:22 purpleidea create