-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bdist_rpm should use rpmbuild, not rpm #55331
Comments
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 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, |
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? |
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 |
What is your OS name and version? Is that rpm version considered obsolete or not? |
"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. |
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? |
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). |
I'll write a docs and script patch for this next week... I'm happy to do the work, Thanks for the comments. James |
Thanks for volunteering. I will review and apply when the py3k branch is unfrozen.
|
BTW, it may be useful to point people to http://pypi.python.org/pypi/pypi2rpm, which contains an updated command, bdist_rpm2. |
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. |
More info on rpm vs. rpmbuild: http://bugs.python.org/issue1533164#msg82592 |
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. |
I agree on just switching to rpmbuild, at least for 3.4. |
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. |
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. |
No, the second use should not be converted. |
can this patch be sped up? i don't see any workaround. |
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? |
i am using this on redhat enterprise and mac. both running python 3.5 |
The bug exists indeed but I would like to know what is the actual use case here. |
the use case is being able to publish python package as rpm using setup.py on mac. |
Note that bpo-32281 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. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: