Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 611116 - dev-python/pypy3 and dev-python/pypy3-bin - sharedctypes: global name 'buffer' is not defined
Summary: dev-python/pypy3 and dev-python/pypy3-bin - sharedctypes: global name 'buffer...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-27 14:30 UTC by genoob
Modified: 2017-10-15 07:56 UTC (History)
3 users (show)

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


Attachments
emerge --info pypy3-bin (file_611116.txt,23.23 KB, text/plain)
2017-02-27 14:30 UTC, genoob
Details
tests with pypy-c-jit-90367-4618cb6fc961-linux64 and /usr/bin/pypy3 (file_611116.txt,940 bytes, text/plain)
2017-02-27 14:39 UTC, genoob
Details
test with pypy3 built locally from pypy3.5 branch from https://bitbucket.org/pypy/pypy (file_611116.txt,216 bytes, text/plain)
2017-03-04 12:48 UTC, genoob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description genoob 2017-02-27 14:30:10 UTC
Created attachment 465412 [details]
emerge --info pypy3-bin

Trying to use multiprocessing.sharedctypes.RawValue fails with:
NameError: global name 'buffer' is not defined

This can be reproduced with the following command:
pypy3 -c "from multiprocessing.sharedctypes import RawValue; a = RawValue(typecode_or_type='i'); print('success =)')" 

I have tried dev-python/pypy3-{5.5.0_alpha, 9999}::gentoo and dev-python/pypy3-bin-5.5.0_alpha::gentoo, and they all behave the same way.

However the test passes with the binary I downloaded from http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-latest-linux64.tar.bz2
so I think it has to do with the gentoo ebuild/patches, not with pypy3.

ERROR:
 $ pypy3 -c "from multiprocessing.sharedctypes import RawValue; a = RawValue(typecode_or_type='i'); print('success =)')" 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/pypy3/lib-python/3/multiprocessing/sharedctypes.py", line 45, in RawValue
    obj = _new_value(type_)
  File "/usr/lib64/pypy3/lib-python/3/multiprocessing/sharedctypes.py", line 38, in _new_value
    return rebuild_ctype(type_, wrapper, None)
  File "/usr/lib64/pypy3/lib-python/3/multiprocessing/sharedctypes.py", line 133, in rebuild_ctype
    obj = type_.from_buffer(buf)
  File "/usr/lib64/pypy3/lib_pypy/_ctypes/basics.py", line 88, in from_buffer
    buf = buffer(obj, offset, size)
NameError: global name 'buffer' is not defined
Comment 1 genoob 2017-02-27 14:39:22 UTC
Created attachment 465416 [details]
tests with pypy-c-jit-90367-4618cb6fc961-linux64 and /usr/bin/pypy3

Testing with the vanilla build from pypy3 repository vs pypy3-bin from gentoo repository. (I'm using bin currently because it's quicker to test, but I have also tried both versions of pypy3 from source and they also failed.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-03-04 08:27:58 UTC
EBUILD keyword is for bugs which include fixed ebuilds ;-). And we don't really use keywords much, so don't bother setting them.

As for this issue, I'll try to look at it in a few days. However, I can't promise you much since PyPy is a very complex thing. I don't think we really do anything around the build that could cause this -- which is more likely to be a generic problem when building on Gentoo.

If you have resources to test this, you can try building PyPy locally and seeing if it works.
Comment 3 genoob 2017-03-04 12:48:57 UTC
Created attachment 465930 [details]
test with pypy3 built locally from pypy3.5 branch from https://bitbucket.org/pypy/pypy

I have already done that too. I cloned the repository and built the py3.5 branch, test passed.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-10-15 07:56:55 UTC
Could you retry with 5.9.0? It succeeds (from -bin) on my system.