classification
Title: bdist_rpm should enable --fix-python by default
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: John5342, akitada, eric.araujo, tarek, vstinner
Priority: normal Keywords:

Created on 2008-11-29 14:42 by John5342, last changed 2019-03-11 13:37 by vstinner.

Messages (6)
msg76596 - (view) Author: John5342 (John5342) Date: 2008-11-29 14:42
When using bdist_rpm the %build section of the generated spec file
contains the following:

env CFLAGS="$RPM_OPT_FLAGS" python setup.py build

This works fine until the python is installed using altinstall. In this
situation the spec file will use the default python rather than the one
currently used.

I am currently using python3.0 with the default python being 2.5. As a
result the spec file is created which then calles python (2.5) and my
setup.py contains 3.0 code so the spec file fails.

When the above line is generated it should use the current interpreters
path and name rather than just "python"
msg82948 - (view) Author: Akira Kitada (akitada) * Date: 2009-02-28 22:52
There are two options for that in bdist_rpm.

  --python             path to Python interpreter to hard-code in the .spec
                       file (default: "python")
  --fix-python         hard-code the exact path to the current Python
                       interpreter in the .spec file
msg82957 - (view) Author: John5342 (John5342) Date: 2009-03-01 12:25
Thanks.

i had noticed those options since i filed this report but considering
the spec file is generated and then built immediately wouldn't it make
more sense to effectively enable --fix-python by default (perhaps with a
--no-fix-python option if people do in fact want to do something odd).
The rpm would then automatically be built using the same version of
python used for development which is in my experience almost always what
is intended.

I do at least have a workable workaround.

Thanks again.
msg113876 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-14 05:59
Considering that bdist_rpm is removed in distutils2, that its use in distutils is not encouraged (platform-specific tools are more adapted and can move quicker than the stdlib), that you have a workaround, and that we can’t change behavior for fear of breaking third-party tools (what happened all the time and lead Tarek to create distutils2), I’m closing this in one week unless Tarek objects.
msg119390 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-22 15:14
FYI, this is fixed in the new bdist_rpm2 command: https://bitbucket.org/tarek/pypi2rpm/changeset/ce6626df0225
msg337667 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-11 13:37
I reopen the issue. The command still needs --fix-python and distutils2 project has been abandonned.

Bug report in RHEL:
https://bugzilla.redhat.com/show_bug.cgi?id=1673325
History
Date User Action Args
2019-03-11 13:37:08vstinnersetstatus: closed -> open
versions: + Python 3.8, - Python 3.0
nosy: + vstinner

messages: + msg337667

resolution: rejected ->
2010-10-22 15:14:10eric.araujosetmessages: + msg119390
2010-09-08 03:04:11eric.araujosetstatus: pending -> closed
resolution: rejected
stage: resolved
2010-08-14 05:59:42eric.araujosetstatus: open -> pending

nosy: + eric.araujo
messages: + msg113876

assignee: eric.araujo
2009-03-03 13:36:52akitadasettitle: bdist_rpm assumes python -> bdist_rpm should enable --fix-python by default
2009-03-01 12:25:52John5342setmessages: + msg82957
2009-02-28 22:52:36akitadasetnosy: + akitada, tarek
messages: + msg82948
2008-11-29 14:42:30John5342create