stefanor / pypy3-snap

PyPy is a fast, compliant alternative implementation of the Python language
MIT License
0 stars 0 forks source link

snap runtime too old #3

Open mitshell opened 1 year ago

mitshell commented 1 year ago

Hi, I am currently using pypy3 on Ubuntu 20.04.1 through its snap package, and am failing to support numpy with it. After I install the pypy3 snap and numpy for it (as with snap run pypy3 -m pip install numpy), I get an error when trying to load numpy:

Traceback (most recent call last):
  File "/home/mich/test_pypy3/lib/pypy3.9/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/home/mich/test_pypy3/lib/pypy3.9/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/home/mich/test_pypy3/lib/pypy3.9/site-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/mich/test_pypy3/lib/pypy3.9/site-packages/numpy/core/_multiarray_umath.pypy39-pp73-x86_64-linux-gnu.so)

The issue seems very similar as https://github.com/stefanor/pypy3-snap/issues/1.

This is my snap info:

$ snap info pypy3
name:      pypy3
summary:   PyPy is a fast, compliant alternative implementation of the Python language
publisher: The PyPy Project (pypyproject)
store-url: https://snapcraft.io/pypy3
contact:   https://pypy.org/
license:   MIT
description: |
  PyPy is a replacement for CPython. It is built using the RPython language
  that was co-developed with it. The main reason to use it instead of CPython
  is speed; it runs generally faster.
commands:
  - pypy3
snap-id:      X9kiVzavueaRB7sgxmCtRscyX944vMoC
tracking:     latest/stable
refresh-date: 9 days ago, at 13:08 CET
channels:
  latest/stable:    7.3.11 2022-12-30 (116) 36MB classic
  latest/candidate: 7.3.11 2022-12-30 (116) 36MB classic
  latest/beta:      7.3.11 2022-12-30 (116) 36MB classic
  latest/edge:      7.3.11 2022-12-30 (116) 36MB classic
installed:          7.3.11            (116) 36MB classic

I did a quick verification on the snap runtime provided by Ubuntu. The base core relies on glibc 2.23:

$ /snap/core/current/usr/bin/ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu11.3+esm2) 2.23

While a glibc >= 2.29 is only available starting with the snap core 20:

$ /snap/core20/current/usr/bin/ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31

I have no clue on how snap works and how snap packages are built, but maybe a solution would be to link in some way the pypy3 snap package to the snap core 20 ?

Thanks in advance for your consideration.

stefanor commented 1 month ago

Yeah, it would probably make sense to use a newer core. I tried to match the core to the level that the PyPy project does their binary builds at, but I rarely check if it needs updating.

I'm afraid I can't reproduce the issue, though.