[PATCH] wafsamba: Remove code which is not used in most cases

Amitay Isaacs amitay at gmail.com
Fri Jun 26 00:49:22 MDT 2015


I recently found strange behavior with standalone CTDB build.

  $ cd ctdb
  $ ./configure --prefix=/tmp/ctdb
  $ make
  $ make install

During the install, waf is supposed to re-link all the binaries with
correct -rpath flags.

  $ ldd /tmp/ctdb/bin/ctdb
    linux-vdso.so.1 (0x00007ffe64571000)
    libtdb-wrap-ctdb.so => not found
    libtime-basic-ctdb.so => not found
    libsocket-blocking-ctdb.so => not found
    libtdb.so.1 => /lib64/libtdb.so.1 (0x00007f89a050c000)
    libtevent.so.0 => /lib64/libtevent.so.0 (0x00007f89a02fe000)
    libsamba-debug-ctdb.so => not found
    libreplace-ctdb.so => not found
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f89a00fa000)
    [... stuff deleted ...]

It looks like the correct flags are not getting passed to the linker.
Running "make install V=1" confirms that.

The problem originates in the function needs_private_lib() in
This function is supposed to check if the target depends on any private
However, the function returns False since getattr(target, "final_libs", [])
always returns [].
In install_rpath(), the PRIVATELIBDIR is not added to the list of

The real culprit is seen with the folllowing command:

  $ ../buildtools/bin/waf --zones=deps install
  Waf: Entering directory `/home/amitay/samba/samba-master/ctdb/bin'
  * creating /tmp/ctdb/var/log
  * creating /tmp/ctdb/var/run/ctdb
  * creating /tmp/ctdb/var/lib/ctdb
  16:32:21 deps checking saved dependencies           <----
  16:32:21 deps loaded saved dependencies               <----
  * installing ctdb/bin/default/ctdb/ctdb.pc as
  * installing ctdb/bin/default/ctdb/ctdb_run_tests.sh as
  [... stuff deleted ...]

For standalone CTDB build, "make install" ends up loading the stored
dependencies instead of calculating them again.  In the top-level build or
in the standalone ldb, dependencies are always re-calculated.

Here is the output from top-level build:

  $ ./buildtools/bin/waf --zones=deps install
  Waf: Entering directory `/home/amitay/samba/samba-master/bin'
  * creating /home/amitay/samba/prefix1/etc
  * creating /home/amitay/samba/prefix1/private
  * creating /home/amitay/samba/prefix1/var
  * creating /home/amitay/samba/prefix1/private
  * creating /home/amitay/samba/prefix1/var/lib
  * creating /home/amitay/samba/prefix1/var/locks
  * creating /home/amitay/samba/prefix1/var/cache
  * creating /home/amitay/samba/prefix1/var/lock
  * creating /home/amitay/samba/prefix1/var/run
  * creating /home/amitay/samba/prefix1/var/run
      Selected embedded Heimdal build
  16:24:45 deps checking saved dependencies         <-----
  Checking project rules ...
  16:24:45 deps project rules checking started          <-----
  16:24:45 deps expand_subsystem_deps: 0.000659
  [... stuff deleted ...]

The function load_samba_deps() in buildtools/wafsamba/samba_deps.py
always return False for top-level "make install" or standalone ldb "make

Since saving and loading dependencies code is broken and not getting used
in most cases, it may be a good idea to drop that code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wafsamba-Remove-code-which-is-not-used-in-most-cases.patch
Type: text/x-patch
Size: 6231 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150626/fb9d5f14/attachment.bin>

More information about the samba-technical mailing list