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