Hello PyPy folks,

I co-maintain the PyPy and CPython interpreter packages in Fedora and I am excited but a bit puzzled by a certain change that happened in PyPy 3.8.
The installation layout of PyPy 3.8 was changed to be more like the CPython 
layout:

https://doc.pypy.org/en/latest/release-v7.3.6.html

> The 3.8 package now uses the same layout as CPython, and many of the
> PyPy-specific changes to sysconfig, distutils.sysconfig,
> and distutils.commands.install.py have been removed. The stdlib now is
> located in <base>/lib/pypy3.8 on posix systems, and in <base>/Lib on Windows.
> The include files on windows remain the same, on posix they are in
> <base>/include/pypy3.8 . Note we still use the pypy prefix to prevent mixing
> the files with CPython (which uses python).

Up until now (e.g. with PyPy 3.7) the installation layout of the Fedora package looked like this:

/usr/lib64/pypy3.7/
├── bin
│   └── ...
├── include
│   └── *.h
├── lib_pypy
│   └── ...
├── lib-python
│   └── 3
│       └── ...
└── site-packages
    └── ...
/usr/bin/pypy3.7 -> /usr/lib64/pypy3.7/bin/pypy3.7
(sometimes) /usr/bin/pypy3 -> /usr/bin/pypy3.7

We basically took the advice from https://doc.pypy.org/en/latest/build.html

> To install PyPy system wide on unix-like systems, it is recommended to put
> the whole hierarchy alone (e.g. in /opt/pypy) and put a symlink to the pypy
> executable into /usr/bin or /usr/local/bin.

Where we used "/usr/lib64/pypy3.7" instead of "/opt/pypy".
Several different versions of pypy (e.g. 3.6 and 3.7) could be installed alongside each other, as long as only one of them "owned" /usr/bin/pypy3.

Now with PyPy 3.8, if we are to keep this scheme, the entire tree gets a bit more nested:

/usr/lib64/pypy3.8/
├── bin
│   └── ...
├── include
│   ├── PyPy.h
│   └── pypy3.8
│       └── *.h
└── lib
    └── pypy3.8
        ├── ...
        └── site-packages
            └── ...
(/usr/bin setup remains the same)

This e.g. means that the standard library is installed in:

 /usr/lib64/pypy3.8/lib/pypy3.8/

Or the header files are in:

 /usr/lib64/pypy3.8/include/pypy3.8/

Double namespacing like this seems a bit overengineered, and since the idea was to resemble CPython, I was aiming at this setup:

/usr/
├── bin
│   └── ...
├── include
│   └── pypy3.8
│       └── *.h
└── lib(64)
    └── pypy3.8
        ├── ...
        └── site-packages
            └── ...

Which would be the exact copy of our CPython setup | sed s/python/pypy/

However, I found 4 problems:

1) The PyPy install scheme only has "lib", not "lib64"

I think we could sort this by a tiny patch that we used to carry in CPython 3.8 before configurable platlibdir was introduced in 3.9.


2) The /usr/include/PyPy.h file is *not* namespaced with PyPy Python version

I don't know if we even need to ship this file. It seems deprecated. Maybe it can be in /usr/include/pypy3.8/PyPy.h?


3) /usr/bin/pypy3.8 is a symbolic link to /usr/bin/pypy3

I would expect it to be the other way around, so both /usr/bin/pypy3.X and /usr/bin/pypy3.Y can co-exist and /usr/bin/pypy3 is an (optional) symbolic link to one of them (as is the situtaion with CPython). I guess I can somehow reverse the order manually, but I have not tested if it breaks anything.


4) The /usr/bin/libpypy3-c.so file is *not* namespaced and seems misplaced

This is the one thing I cannot wrap my head around. I do not wish to install this file "globally" to /usr/bin for two reasons:

 a) it conflicts between different PyPy Python versions
 b) it ends up on $PATH but segfaults when executed


So, I am asking on this list: How should we package PyPy 3.8 for Fedora? Do we need to install it to /usr/lib64/pypy3.8/ prefix even thou most (but not all) of the directories within would contain a "pypy3.8" subdirectory? Or is there a better option I do not yet see?

Thanks for your help.

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok

_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to