Bug 704 - libunbound is linked against libpython even this does not seem to be needed
libunbound is linked against libpython even this does not seem to be needed
Product: unbound
Classification: Unclassified
Component: server
x86_64 Linux
: P5 normal
Assigned To: unbound team
Depends on:
  Show dependency treegraph
Reported: 2015-09-03 13:51 CEST by Tomas Hozza
Modified: 2015-09-22 12:26 CEST (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hozza 2015-09-03 13:51:30 CEST
In Fedora we are moving to Python3 by default. However we are building Unbound with Python2 and Python3 at the same time.

We discovered that some binaries in Unbound are linked with libpython even this seems to be unnecessary. The problem is then these are bringing unneeded dependencies to the system when installed.

For example

$ ldd /usr/sbin/unbound-anchor
	linux-vdso.so.1 (0x00007fff117b1000)
	libunbound.so.2 => /lib64/libunbound.so.2 (0x00007ff4d811a000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00007ff4d7ef0000)
	libssl.so.10 => /lib64/libssl.so.10 (0x00007ff4d7c80000)
	libevent-2.0.so.5 => /lib64/libevent-2.0.so.5 (0x00007ff4d7a38000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007ff4d7834000)
-->	libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007ff4d746a000)
	libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007ff4d7082000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff4d6e66000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ff4d6aa5000)
	libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007ff4d6858000)
	libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007ff4d6573000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007ff4d636e000)
	libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007ff4d613b000)
	libz.so.1 => /lib64/libz.so.1 (0x00007ff4d5f25000)
	/lib64/ld-linux-x86-64.so.2 (0x000055afe901c000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007ff4d5d21000)
	libm.so.6 => /lib64/libm.so.6 (0x00007ff4d5a19000)
	libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007ff4d580a000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007ff4d5605000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00007ff4d53ea000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007ff4d51c5000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007ff4d4f55000)

The problem seems that the Makefile's variable $LIBS includes -lpythonX.Y and is used everywhere.

It would be great to get rid of this unnecessary linking.

Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1254566
Comment 1 Wouter Wijngaards 2015-09-22 12:26:16 CEST
Hi Tomas,

If you use --with-pythonmodule then unbound compiles the python module that can be used by people to extend unbound's processing of queries.  That is then also compiled into libunbound (that can then also perform such python based query processing, just like the daemon).

Best regards, Wouter