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

setup.py: use plyvel==1.2.0 instead of 1.0.5 #3357

Closed
wants to merge 1 commit into from

Conversation

belikor
Copy link
Contributor

@belikor belikor commented Jul 10, 2021

As indicated in INSTALL.md, setting up the virtual environment and running make.

# 5.12.14-arch1-1 #1 SMP PREEMPT Thu, 01 Jul 2021 07:26:06 +0000 x86_64 GNU/Linux

python3.9 -m venv lbry-venv9
make install

The process errors in the compilation of plyvel.

ERROR: Command errored out with exit status 1:
     command: /opt/git/lbry-sdk/lbry-venv9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ne_ytn2l/plyvel_462f51d795a34180a99f8ad88be3ebc2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ne_ytn2l/plyvel_462f51d795a34180a99f8ad88be3ebc2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cylvo3wk/install-record.txt --single-version-externally-managed --compile --install-headers /opt/git/lbry-sdk/lbry-venv9/include/site/python3.9/plyvel

...
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fno-semantic-interposition -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/opt/git/lbry-sdk/lbry-venv9/include -I/usr/include/python3.9 -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-3.9/plyvel/_plyvel.o -Wall -g
    plyvel/_plyvel.cpp: In function ‘int __Pyx_modinit_type_init_code()’:
    plyvel/_plyvel.cpp:21100:34: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    21100 |   __pyx_type_6plyvel_7_plyvel_DB.tp_print = 0;
          |                                  ^~~~~~~~

To avoid this error, we can set plyvel==1.2.0 or plyvel==1.3.0 in setup.py. Then the installation completes fine.

I don't know if there is a particular reason for using plyvel==1.0.5 (July 17, 2018), as it is currently. This version compiles fine with Python 3.7 and 3.8, but only 3.7 truly works correctly (see #2769, #2145).

I tried plyvel==1.2.0 (January 22, 2020) because it's the version available in Ubuntu 20.04, and plyvel==1.3.0 (October 10, 2020) because it's the latest stable version available in Arch.


If this is merged, then maybe we don't need to install libleveldb-dev, as proposed in #3349.

This fix is also included in #3205, so if #3205 is merged, this pull request is not needed. Otherwise this can be merged already.

@belikor belikor changed the title setup.py: use plyvel=1.2.0 instead of 1.0.5 setup.py: use plyvel==1.2.0 instead of 1.0.5 Jul 11, 2021
Compilation of `plyvel` 1.0.5 (July 17, 2018)
proceeds when using Python 3.7 and 3.8, but fails with 3.9.

If using `plyvel` 1.2 or 1.3, no compilation is necessary,
as the packages are downloaded from `pip` without issue.

Version 1.2.0 (January 22, 2020) is available in Ubuntu 20.04,
and 1.3.0 (October 10, 2020) is available in Arch,
so these are good versions to use as reference.
@eukreign
Copy link
Member

As already mentioned, #3205 already includes this fix, let's just wait for that to merge instead of doing this upgrade separately.

@eukreign eukreign closed this Jul 19, 2021
@belikor belikor deleted the plyvel-new branch July 19, 2021 22:47
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.

None yet

2 participants