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

Python binding rebuilds whole libtorrent, it should reuse pre-installed libtorrent #6017

Closed
yurivict opened this issue Feb 28, 2021 · 5 comments

Comments

@yurivict
Copy link

Building in bindings/python fails to find libtorrent-rasterbar-2.0.2 installed in the system.

How to make build use preinstalled libtorrent-rasterbar?

@arvidn
Copy link
Owner

arvidn commented Feb 28, 2021

if you're invoking b2 directly, add libtorrent-link=prebuilt to the command line.

If you're calling setup.py, you can specify --libtorrent-link=prebuilt (or --b2-args="libtorrent-link=prebuilt")

@arvidn
Copy link
Owner

arvidn commented Feb 28, 2021

note that setup.py is sensitive to argument order. You need to specify build first, then the arguments to the build step, and if you want to install as well, the install command has to come after the build options

@yurivict
Copy link
Author

Both variants fail like this:

/usr/bin/env XDG_DATA_HOME=/usr/ports/net-p2p/py-libtorrent-rasterbar/work-py37 XDG_CONFIG_HOME=/usr/ports/net-p2p/py-libtorrent-rasterbar/work-py37 HOME=/usr/ports/net-p2p/py-libtorrent-rasterbar/work-py37 PATH=/usr/ports/net-p2p/py-libtorrent-rasterbar/work-py37/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LDSHARED=cc -shared PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= PREFIX=/usr/local LOCALBASE=/usr/local CC=cc CFLAGS=-O2 -pipe -fno-omit-frame-pointer  -DTORRENT_DISABLE_LOGGING -fPIC -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  CPP=cpp CPPFLAGS=-fno-omit-frame-pointer -DLIBICONV_PLUG -isystem /usr/local/include LDFLAGS= -fstack-protector-strong -L/usr/local/lib  LIBS= CXX=c++ CXXFLAGS=-O2 -pipe -fno-omit-frame-pointer -DTORRENT_DISABLE_LOGGING -fPIC -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fno-omit-frame-pointer  -DLIBICONV_PLUG -isystem /usr/local/include  MANPREFIX=/usr/local BSD_INSTALL_PROGRAM=install  -s -m 555 BSD_INSTALL_LIB=install  -s -m 0644 BSD_INSTALL_SCRIPT=install  -m 555 BSD_INSTALL_DATA=install  -m 0644 BSD_INSTALL_MAN=install  -m 444 /usr/local/bin/python3.7 -c import sys; import setuptools;  __file__='setup.py'; sys.argv[0]='setup.py';  exec(compile(open(__file__, 'rb').read().replace(b'\r\n', b'\n'), __file__, 'exec')) build --b2-args=libtorrent-link=prebuilt
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --b2-args not recognized
*** Error code 1

@arvidn
Copy link
Owner

arvidn commented Feb 28, 2021

the --b2-args option was added after the 2.0.2 release and is currently only available in git. However, --libotrrent-link should be available for the build_ext command (I was wrong about that name earlier):

$ python3 setup.py build_ext --libtorrent-link=prebuilt

I'm hitting a different issue on linux with that right now though. I'm looking

@arvidn
Copy link
Owner

arvidn commented Feb 28, 2021

I believe this fixes it: #6018

@yurivict yurivict changed the title Python binding rebuilds whole libtorrent, it shoud reuse pre-installed libtorrent Python binding rebuilds whole libtorrent, it should reuse pre-installed libtorrent Mar 2, 2021
@arvidn arvidn closed this as completed Mar 6, 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

No branches or pull requests

2 participants