Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 372701 - python.eclass: Add support for PyPy
Summary: python.eclass: Add support for PyPy
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on: 372639 373487
Blocks:
  Show dependency tree
 
Reported: 2011-06-23 19:39 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2011-11-30 11:52 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log dev-python/setuptools-0.6.19 (build.log,69.22 KB, text/plain)
2011-06-29 16:54 UTC, Mads
Details
pypy_test.sh (pypy_test.sh,369 bytes, text/plain)
2011-06-29 17:37 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-23 19:39:29 UTC
Support for PyPy is now present in python.eclass in python overlay, but needs more testing. Small additional changes might be needed.

PyPy users should test random packages with python.eclass from python overlay.

Existence of /usr/bin/pypy-c1.5 symlink is required (bug #372639). Until fixing of that bug and reinstallation of PyPy, users can manually create this symlink:
ln -s ../lib64/pypy1.5/pypy-c /usr/bin/pypy-c1.5

For ebuilds using currently supported EAPIs, users should set USE_PYTHON variable in /etc/make.conf. Example:
USE_PYTHON="2.7-pypy-1.5 2.7 3.2"
(USE_PYTHON variable needs to enable at least 1 Python ABI for CPython. Support for installation only for Jython/PyPy without CPython is outside of scope of this bug.)

After installation of python overlay, users should create /etc/portage/repos.conf file with the following content (2 lines):
[DEFAULT]
eclass-overrides = python

app-admin/python-updater-0.9 does not support PyPy. Users should temporarily use app-admin/python-updater-9999.
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-28 13:50:43 UTC
Somebody please install dev-python/setuptools for PyPy 1.5, attach build log and show output of the following command:
ls -l /usr/lib64/pypy1.5/site-packages/setuptools
Comment 2 Mads 2011-06-29 09:35:57 UTC
I'll be able to try the setuptools emerge with PyPy later today.

How can I test PyPy as the default python2 interpreter? Since eselect cannot select it, do I have to resort to manually make the symlink? Will that be enough?
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-29 10:48:12 UTC
(In reply to comment #2)

Making /usr/bin/python2 use PyPy would probably break some things. I suggest to explicitly call scripts with "-2.7-pypy-1.5" suffix (e.g. "nosetests-2.7-pypy-1.5").
Comment 4 Mads 2011-06-29 16:54:32 UTC
Created attachment 278627 [details]
build.log dev-python/setuptools-0.6.19
Comment 5 Mads 2011-06-29 16:54:56 UTC
mad ~ # ls -l /usr/lib64/pypy1.5/site-packages/setuptools
total 220
-rw-r--r-- 1 root root  5927 mai   16 14:04 archive_util.py
-rw-r--r-- 1 root root  6300 juni  29 18:52 archive_util.pyc
drwxr-xr-x 2 root root  4096 juni  29 18:52 command
-rw-r--r-- 1 root root  6209 mai   16 14:04 depends.py
-rw-r--r-- 1 root root  7417 juni  29 18:52 depends.pyc
-rw-r--r-- 1 root root 30309 mai   26 12:13 dist.py
-rw-r--r-- 1 root root 33809 juni  29 18:52 dist.pyc
-rw-r--r-- 1 root root  1278 mai   16 14:05 extension.py
-rw-r--r-- 1 root root  1836 juni  29 18:52 extension.pyc
-rw-r--r-- 1 root root  3744 mai   16 14:05 __init__.py
-rw-r--r-- 1 root root  4394 juni  29 18:52 __init__.pyc
-rw-r--r-- 1 root root 30435 juni   2 01:59 package_index.py
-rw-r--r-- 1 root root 32320 juni  29 18:52 package_index.pyc
-rw-r--r-- 1 root root  8756 mai   26 12:13 sandbox.py
-rw-r--r-- 1 root root 12993 juni  29 18:52 sandbox.pyc
drwxr-xr-x 2 root root  4096 juni  29 18:52 tests
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-29 17:37:56 UTC
Created attachment 278629 [details]
pypy_test.sh

Somebody please show output of the following script.
Comment 7 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-29 17:38:30 UTC
(In reply to comment #6)

s/following/attached/
Comment 8 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-29 17:58:39 UTC
Bug #373487 is for incorrect location of scripts installed by distutils.

The output of script from comment #6 is still needed.
Comment 9 Mads 2011-06-29 20:20:19 UTC
mad ~ # sh pypy_test.sh 
+ rm -fr /tmp/pypy_test
+ mkdir -p /tmp/pypy_test/sources
+ cd /tmp/pypy_test/sources
+ echo '#!/usr/bin/python'
+ cat
+ pypy-c1.5 setup.py install --root=/tmp/pypy_test/installation_image
running install
running build
running build_scripts
creating build
creating build/scripts-2.7
copying and adjusting test_script -> build/scripts-2.7
changing mode of build/scripts-2.7/test_script from 644 to 755
running install_scripts
creating /tmp/pypy_test/installation_image
creating /tmp/pypy_test/installation_image/usr
creating /tmp/pypy_test/installation_image/usr/lib64
creating /tmp/pypy_test/installation_image/usr/lib64/pypy1.5
creating /tmp/pypy_test/installation_image/usr/lib64/pypy1.5/bin
copying build/scripts-2.7/test_script -> /tmp/pypy_test/installation_image/usr/lib64/pypy1.5/bin
changing mode of /tmp/pypy_test/installation_image/usr/lib64/pypy1.5/bin/test_script to 755
running install_egg_info
Creating /tmp/pypy_test/installation_image/usr/lib64/pypy1.5/site-packages/
Writing /tmp/pypy_test/installation_image/usr/lib64/pypy1.5/site-packages/UNKNOWN-0.0.0-py2.7.egg-info
+ cd /tmp/pypy_test/installation_image
++ find -name test_script
+ cat ./usr/lib64/pypy1.5/bin/test_script
#!/usr/bin/pypy-c1.5
Comment 10 Mads 2011-06-29 20:22:22 UTC
Maybe interesting to se how my run of python-updater -- --keep-going went too?

 * The following 16 packages have failed to build or install:
 * 
 *  (dev-libs/libxml2-2.7.8-r1::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-libs/libxml2-2.7.8-r1/temp/build.log'
 *  (dev-python/pycrypto-2.3::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/pycrypto-2.3/temp/build.log'
 *  (dev-vcs/mercurial-1.8.3::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-vcs/mercurial-1.8.3/temp/build.log'
 *  (dev-libs/libxslt-1.1.26-r1::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-libs/libxslt-1.1.26-r1/temp/build.log'
 *  (dev-python/pygobject-2.28.6::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/pygobject-2.28.6/temp/build.log'
 *  (dev-python/gst-python-0.10.21::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/gst-python-0.10.21/temp/build.log'
 *  (sys-libs/cracklib-2.8.18::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/sys-libs/cracklib-2.8.18/temp/build.log'
 *  (dev-python/numpy-1.6.0::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/numpy-1.6.0/temp/build.log'
 *  (app-text/gnome-doc-utils-0.20.6::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/app-text/gnome-doc-utils-0.20.6/temp/build.log'
 *  (dev-python/pygame-1.9.2_pre3082::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/pygame-1.9.2_pre3082/temp/build.log'
 *  (dev-python/pygtk-2.24.0-r1::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/pygtk-2.24.0-r1/temp/build.log'
 *  (dev-python/twisted-11.0.0::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/twisted-11.0.0/temp/build.log'
 *  (gnome-base/gnome-menus-2.30.5::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/gnome-base/gnome-menus-2.30.5/temp/build.log'
 *  (dev-python/twisted-web-11.0.0::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/twisted-web-11.0.0/temp/build.log'
 *  (dev-python/notify-python-0.1.1-r2::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/dev-python/notify-python-0.1.1-r2/temp/build.log'
 *  (net-im/emesene-9999::gentoo, ebuild scheduled for merge), Log file:
 *   '/tmp/portvar/portage/net-im/emesene-9999/temp/build.log'
Comment 11 Mads 2011-06-29 20:25:10 UTC
Is it possible to build portage with PyPy? Would be very interesting to see how that would work out...
Comment 12 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-30 22:39:29 UTC
(In reply to comment #11)
> Is it possible to build portage with PyPy?

You might test: pypy-c1.5 /usr/bin/emerge ...
Comment 13 Dirkjan Ochtman (RETIRED) gentoo-dev 2011-11-30 11:52:58 UTC
I succesfully included pypy-1.7 in USE_PYTHON and installed a few packages, so the basics seem to work fine. Closing this bug, we should work out new issues as we encounter them.