Skip to content

Conversation

undingen
Copy link
Contributor

@undingen undingen commented Sep 2, 2021

Until now we always used our supplied 3rd party shared objects dependencies over
the distro supplied ones. But ours are likely older which causes problems.
E.g. issue #41: we load a thirdparty distro library compiled against a newer zlib but it's loading
our supplied older version which fails.

This patch changes the search order to use our supplied .so's only as fallback if the dist ones are not available.

This is noticable e.g. running pyston -c "import sqlite3; print(sqlite3.sqlite_version)"
will output 3.31.1 (on my ubuntu 20.04 system) instead of 3.11.0.

Why do we even supply this libraries?:
We do have to supply this libraries in case the user does not have the library installed
or it's not available in the required major version. E.g. if you use the portable release on latest fedora and ubuntu
openssl 1.0.x is not available anymore (it uses 1.1.x) so pip will fail with a SSL not available error if we don't supply 1.0.
Which means in order to have only one release which works on as much distros as possible we need to supply this
files but should make sure they are only used as fallback.

I verified that this fixes the problems in #41 and #76 on ubuntu, fedora and archlinux.

BTW: patchelf v0.10 supplied in ubuntu 20.04 contains a bug which corrupts files when modifying
already previously via patchelf modified executables. Not an issue for this script because it's not running patchelf twice on the same file but something to lookout if manually changing rpaths. Newer and older version seem to work fine.

Until now we always used our supplied 3rd party shared objects dependencies over
the distro supplied ones. But ours are likely older which causes problems.
E.g. issue 41: we load a thirdparty distro library compiled against a newer zlib but it's loading
our supplied older version which fails.

This patch changes the search order to use our supplied .so's only as fallback if the dist ones are not available.

This is noticable e.g. running `pyston -c "import sqlite3; print(sqlite3.sqlite_version)"`
will output 3.31.1 (on my ubuntu 20.04 system) instead of 3.11.0.

Why do we even supply this libraries?:
We do have to supply this libraries in case the user does not have the library installed
or it's not available in the required major version. E.g. if you use the portable release on latest fedora and ubuntu
openssl 1.0.x is not available anymore (it uses 1.1.x) so pip will not work if we don't supply 1.0.
Which means in order to have only one release which works on as much distros as possible we need to supply this
files but should make sure they are only used as fallback.

I verified that this fixes the problems in #41 and #76 on ubuntu, fedora and archlinux.

BTW: patchelf v0.10 supplied in ubuntu 20.04 contains a bug which corrupts files when modifying
already previously via patchelf modified executables.
@undingen undingen requested a review from kmod September 2, 2021 12:33
@kmod kmod merged commit 48686b8 into pyston_master Sep 2, 2021
@kmod
Copy link
Contributor

kmod commented Sep 2, 2021

👍

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

Successfully merging this pull request may close these issues.

2 participants