Bug 678690

Summary: Provide support for multi-python byte compiling
Product: [Fedora] Fedora EPEL Reporter: BJ Dierkes <derks>
Component: python26Assignee: BJ Dierkes <derks>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: derks, dmalcolm, gholms
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python26-2.6.5-6.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-16 18:17:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 672951, 672953, 672956    

Description BJ Dierkes 2011-02-18 21:22:10 UTC
Description of problem:

See: https://bugzilla.redhat.com/show_bug.cgi?id=672951


Bascally, same as Fedora has 'python-xxxx' packages that also provide a subpackage for 'python3-xxxx', we need the same functionality in EPEL for python26.  Currently, as you see in the above tracker, having a python26-xxxx subpackage is not feasible becasue the python26 files are still byte compiled by stock python2.4.  

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

python26-2.6.5-5


I propose adding an alternative to __python26_os_install_post called __multiple_python_os_install_post or similar... that is essentially the same... but calls a different script for byte compiling (likely just back port the one from fedora).

Comment 1 BJ Dierkes 2011-02-22 00:38:48 UTC
I have added the following changes, but have not committed to fedora git just
yet as I wanted to confirm them with you (dmalcolm) first:

* Fri Feb 18 2011 BJ Dierkes <wdierkes> - 2.6.5-6
- Added support for packages that build against stock python, and python26
  Resolves BZ#678690
- Added brp-multiple-python-bytecompile
- Added __multiple_python_os_install_post macro to macros.python26
- Added --without tests option to make building without tests optional
- Added Patch119: Python-2.6.5-parallel_build.patch.  Resolves Python
  bug #10013: undefined reference to `_PyParser_Grammar` in parallel builds
  http://bugs.python.org/issue10013
- Added Patch120: Python-2.6.5-ioctl_test.patch.  Resolves Python
  bug #7564: test_ioctl may fail when run in background.
  http://bugs.python.org/issue7564
- Use 'make test' to run test suite, passing known failures via
  EXTRATESTOPTS env variable. (deprecates ./runtests.sh)


I've tested this with python-elixir (BZ#672951) which is pending review and
needs this functionality.  The following is the result with this version of
python26 installed to the Mock root:


$ cd /var/lib/mock/epel-5-i386-wdierkes/result/

$ rpm2cpio python-elixir-0.7.1-3.el5.noarch.rpm | cpio -id
1016 blocks

$ rpm2cpio python26-elixir-0.7.1-3.el5.noarch.rpm | cpio -id
1048 blocks

$ file usr/lib/python2.4/site-packages/elixir/entity.pyc
usr/lib/python2.4/site-packages/elixir/entity.pyc: python 2.4 byte-compiled

$ file usr/lib/python2.6/site-packages/elixir/entity.pyc
usr/lib/python2.6/site-packages/elixir/entity.pyc: python 2.6 byte-compiled



Previously, all files would have been byte compiled by python2.4 (and using
__python26_os_install_post forced all files to be byte compiled as python2.6).

All of my commits are available on github, and I can push them to
fedora/el5/master as soon as you agree to the changes.

https://github.com/derks/python26


I've also submitted a scratch build for testing:

http://koji.fedoraproject.org/koji/taskinfo?taskID=2856027

Thanks!

Comment 2 Dave Malcolm 2011-02-28 18:11:07 UTC
Many thanks for writing this.

The various changes within that git repo look good.  I didn't review the rpm script in detail, but I believe it's essentially the same change as in bug 531117; the testing from comment #1 confirms the sanity of the change.  Passing in %{__python} to the script allows for extra flexibility in specfile authoring.

The other changes all look good.

Please push these changes to the EPEL5 repository (let me know if you need the ACL bits set).

We'll probably need to write some packaging guidelines to cover the writing of multi-python packages, but I don't want the writing of such guidelines to block adding the support to the specfile.

Ideally we should include a comment for each of the selftests, explaining why they're failing.  I think I need to work on a patch for upstream's regrtest.py to allow the developer to specify a list of expected failures or exclusions within each suite, so that we can be more fine-grained about this.

Comment 3 Fedora Update System 2011-02-28 22:23:21 UTC
Package python26-2.6.5-6.el5:
* should fix your issue,
* was pushed to the Fedora EPEL 5 updates-testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python26-2.6.5-6.el5'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/python26-2.6.5-6.el5
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2011-02-28 23:59:27 UTC
python26-2.6.5-6.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python26'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/python26-2.6.5-6.el5

Comment 5 Fedora Update System 2011-03-16 18:17:50 UTC
python26-2.6.5-6.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.