Bug 1251464 - build and install from version specific build directory
build and install from version specific build directory
Status: NEW
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Charalampos Stratakis
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks: 1076441
  Show dependency treegraph
 
Reported: 2015-08-07 07:40 EDT by Thomas Spura
Modified: 2017-07-26 07:36 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thomas Spura 2015-08-07 07:40:14 EDT
Description of problem:

- "python setup.py build" supports --build-lib
- "python setup.py install" does NOT supports --build-lib, so the files from above cannot be installed.
- "python setup.py install_lib" DOES support --build-lib

Please add the --build-lib argument also to the general install command, so that one can build and install in a specific (version aware) directory.

Version-Release number of selected component (if applicable):
python2 and python3

How reproducible:
always

Steps to Reproduce:
1. python setup.py build --build-lib=build/lib.%{_os}-%{_target_cpu}-%{python2_version}
2. python setup.py install --build-lib=build/lib.%{_os}-%{_target_cpu}-%{python2_version}


Actual results:
python setup.py install --build-lib=build/lib.%{_os}-%{_target_cpu}-%{python2_version}
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --build-dir not recognized

Expected results:
python setup.py install --build-lib=build/lib.%{_os}-%{_target_cpu}-%{python2_version}
just works


Additional info/background of problem:

python tries to detect if the package is a purelib and builds then when invoking "setup.py build" in the directory "build/lib". This works fine when building for only one python implementation but causes conflicts when building for python2 and python3 at the same time.

This can be seen when a project is calling 2to3 in the build phase. The steps that one would put into a spec file is:

1. Build with python2 # build/lib will contain python2 files
2. Build with python3 # build/lib will contain python3 files
3. Install with python2 # python3 files from build/lib are installed
4. Install with python3 # python3 files from build/lib are installed

One solution to this problem is to build with --build-lib=build/lib.%{_os}-%{_target_cpu}-%{python3_version} or the python2_version.
Comment 1 Miro Hrončok 2015-08-07 08:07:41 EDT
Should this really block bz1076441?
Comment 2 Thomas Spura 2015-08-07 08:17:09 EDT
This causes problems with the new py2_build and py3_build macros so is definitely a python2->python3 issue. Therefore, solving this will make the transition to python3 much easier.
Comment 3 Thomas Spura 2015-08-28 17:48:25 EDT
Hmm, while looking at implementing it I found this in the source code:
from Lib/distutils/command/install.py:
199         # These are only here as a conduit from the 'build' command to the      
200         # 'install_*' commands that do the real work.  ('build_base' isn't      
201         # actually used anywhere, but it might be useful in future.)  They      
202         # are not user options, because if the user told the install            
203         # command where the build directory is, that wouldn't affect the        
204         # build command.                                                        
205         self.build_base = None                                                  
206         self.build_lib = None    

So --build-lib is not an option on purpose because one must somehow trust the user to point to the correct build directory, which the author of these lines obviously doesn't.

Maybe having an option that does disable the pure python mode and does build in a version- (and arch-) specific directory by default would make more sense given the above comment?
What do you think?
Comment 4 Fedora Admin XMLRPC Client 2016-01-29 08:04:40 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Jan Kurik 2016-02-24 08:35:51 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 6 Fedora End Of Life 2017-07-25 15:08:03 EDT
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Note You need to log in before you can comment on or make changes to this bug.