[pypy-dev] Installation layout of the PyPy 3.8 Fedora package

Michał Górny mgorny at gentoo.org
Sat Dec 4 05:31:24 EST 2021


On Thu, 2021-12-02 at 23:48 +0100, Armin Rigo wrote:
> Hi,
> 
> On Thu, 2 Dec 2021 at 21:10, Michał Górny <mgorny at gentoo.org> wrote:
> 
> > > 4) The /usr/bin/libpypy3-c.so file is *not* namespaced and seems misplaced
> > 
> > TBH I've never really understood the purpose of this file.
> > We've stopped using it at some point and nothing really changed for us.
> 
> It is needed for "embedding" situations, which nowadays means
> https://cffi.readthedocs.io/en/latest/embedding.html.  If we want to
> go the full CPython way, we need to rename and move
> "$localdir/libpypy3-c.so" to something like "/usr/lib/libpypy38.so"
> and have /usr/bin/pypy3.8 be a program that is linked to
> "libpypy38.so" instead of "$localdir/libpypy3-c.so".  This would have
> consequences for my own habits---e.g. the executable would no longer
> find its .so if it lives simply in the same directory.  Arguably not a
> big issue :-)  A freshly translated pypy would not work without
> LD_LIBRARY_PATH tricks, just like a freshly compiled CPython does not.
> The CPython solution to that annoyance is to compile statically by
> default, if no option is passed to ./configure; you need to give the
> --enable-shared option explicitly, and all distributions do.  So if we
> want to copy all of that for PyPy, we could.

Well, I'm not sure how portable it is (but quite likely portable to all
major platforms) but you can use something like

  -Wl,-rpath,$ORIGIN/../lib64

to make PyPy find the library in the correct directory relative to its
executable.  I think this shouldn't cause any major issues neither for
running from extracted tarball, nor for system-wide installs.

-- 
Best regards,
Michał Górny



More information about the pypy-dev mailing list