Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPy 5.7.x (non-portable) broken on Ubuntu 12.04 #925

Closed
JayH5 opened this issue Jun 5, 2017 · 6 comments
Closed

PyPy 5.7.x (non-portable) broken on Ubuntu 12.04 #925

JayH5 opened this issue Jun 5, 2017 · 6 comments

Comments

@JayH5
Copy link
Contributor

JayH5 commented Jun 5, 2017

First off, I know Ubuntu 12.04 is EOL, but it is still what you get when you use Travis CI most of the time.

pyenv versions used:

  • Unreleased git sha acbd736
  • 1.0.10

Steps to reproduce:

You can do the following inside an ubuntu:12.04 Docker container:

apt-get update
apt-get install --no-install-recommends curl ca-certificates git bzip2
git clone --depth=1 https://github.com/pyenv/pyenv.git
export PYENV_ROOT=/pyenv
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
pyenv install pypy2-5.7.1

And you'll get the message:

Downloading pypy2-v5.7.1-linux64.tar.bz2...
-> https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux64.tar.bz2
Installing pypy2-v5.7.1-linux64...
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python zlib extension was not compiled. Missing the zlib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems

Doing the exact same steps with the ubuntu:14.04 image gets you a perfectly working PyPy2 5.7.1.

I don't think this is an issue with libraries-- I actually discovered this inside a Travis CI build environment, not a Docker container, and that has all the libraries. Here's an example of a failed build: https://travis-ci.org/praekeltfoundation/travis-pyenv/jobs/239501707

And then after specifying dist: trusty in the Travis file, things work again: https://travis-ci.org/praekeltfoundation/travis-pyenv/jobs/239537667

Thank you :)

@BanzaiMan
Copy link
Contributor

I think this is indeed a library problem, but that of libc, not any other.

$ /opt/python/pypy3.5-5.7.1-beta/bin/python -c 'import bz2'
/opt/python/pypy3.5-5.7.1-beta/bin/python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by /opt/python/pypy3.5-5.7.1-beta/bin/libpypy3-c.so)

The version of libc on Precise is 2.15:

$ dpkg -l | grep -w libc6
ii  libc6                               2.15-0ubuntu10.18                                   Embedded GNU C Library: Shared libraries
ii  libc6-dev                           2.15-0ubuntu10.18                                   Embedded GNU C Library: Development Libraries and Header Files

So I don't think we can resolve this at all.

@Samureus
Copy link
Contributor

The problem seems to be libbz2, in the latest releases of PyPy2 and PyPy3 (5.8) the output of ldd -v libpypy(3).so requires GLIBC of at least 2.3:

	/lib/x86_64-linux-gnu/libbz2.so.1.0:
		libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6

I think it might also affect Portable PyPy, it seems to me that links against the system libbz2 instead of bundling it like it does with libssl, libcrypto, libexpat and libtinfo.

@squeaky-pl
Copy link

The problem is glibc version, portably pypy switched from Centos5 to Centos6 since Centos5 is also EOL. That means that you need a distro with glibc 2.17 or newer.

@JayH5 JayH5 changed the title PyPy installs seem to be broken on Ubuntu 12.04 PyPy 5.7.x (non-portable) broken on Ubuntu 12.04 Jun 10, 2017
@JayH5
Copy link
Contributor Author

JayH5 commented Jun 10, 2017

I did some more experimentation with different versions of PyPy, and the issue is actually just with the compiled PyPy 2/3 5.7.0 and 5.7.1 provided by the PyPy people, not the portable version.

PyPy 2/3 5.7.x (non-portable) reports the message that @BanzaiMan quoted above (they want glibc 2.17).

PyPy 2/3 5.7.0 portable work fine.

PyPy 2 5.6.0 and PyPy 2/3 5.8.0 all work fine.

I've updated the issue title to reflect this.

@squeaky-pl I don't know too much about compiling against different glibc versions, but all the versions of portable PyPy I've tried with Ubuntu 12.04 (which has glibc 2.15) work just fine.

Overall, this looks like an issue with 2 specific releases of PyPy, not with pyenv itself, so whoever is in charge here, feel free to close this issue if you'd like.

@Samureus
Copy link
Contributor

@JayH5 @squeaky-pl thanks for the reply, I'll adjust #932 accordingly.

@Samureus
Copy link
Contributor

Just putting the result of docker fighting for future reference:

$ docker run -it ubuntu:precise /bin/sh
# apt-get update
# apt-get install wget bzip2 libbz2-dev libexpat1-dev lsb-release
# lsb_release --a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.5 LTS
Release:	12.04
Codename:	precise
# wget --no-check-certificate https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux64.tar.bz2
# tar xvjf pypy2-v5.7.1-linux64.tar.bz2
# cd opt/pypy2-v5.7.1-linux64/bin
# ls -la
total 66576
drwxr-xr-x 2 root root     4096 Mar 31 11:11 .
drwxr-xr-x 7 root root     4096 Mar 31 11:11 ..
-rwxr-xr-x 1 root root 68153656 Mar 31 11:11 libpypy-c.so
-rwxr-xr-x 1 root root     6288 Mar 31 11:11 pypy
# ./pypy
./pypy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by /opt/opt/pypy2-v5.7.1-linux64/bin/libpypy-c.so)

with PyPy 5.8.0:

# ./pypy
Python 2.7.13 (c925e7381036, Jun 05 2017, 21:20:51)
[PyPy 5.8.0 with GCC 6.2.0 20160901] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> import bz2
>>>> import binascii
>>>> original_data = "This is the original text"
>>>> compressed = bz2.compress(original_data)
>>>> print 'Compressed   :', len(compressed), binascii.hexlify(compressed)
Compressed   : 61 425a6839314159265359507b73c800000213804000040022e59c4020002223d468d3c48400005ba0cf81cd3525743117a8bf8bb9229c2848283db9e400
>>>> decompressed = bz2.decompress(compressed)
>>>> print 'Decompressed :', len(decompressed), decompressed
Decompressed : 25 This is the original text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants