tons of uselib_local warnings in waf

Michael Tokarev mjt at tls.msk.ru
Sun Apr 3 04:52:29 UTC 2022


when doing samba configure/build with waf verbosity
level >= 1 (to see what it is doing), there's a *ton*
(about 2000) of warnings like this:

  compat: "uselib_local" is deprecated, replace by "use"

apparently this comes from buildtools/wafsamba/samba_deps.py
(and samba_conftests.py), - that's where uselib_local
is used  (the warning itself is apparently in
buildtools/wafsamba/samba_waf18.py).

I tried to dig there, but weren't able to figure out how
it all works.  The following change does eliminate the
warning, but I'm not sure the resulting thing actually
does what it is supposed to do.  For one, there's no
function like "apply_use()" in samba_waf18.py which does
something similar to "apply_uselib_local()", - I don't
see where this "use" attribute is processed.

What would be the right fix for this?

Also, where to look for some basic docs about waf
internals?

Thank you!

/mjt

diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index ef632ba9033..59b1258c7de 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -315,7 +315,7 @@ def CHECK_LIBRARY_SUPPORT(conf, rpath=False, version_script=False, msg=None):
     o = bld(features='c cprogram',
             source='main.c',
             target='prog1',
-            uselib_local='lib1')
+            use='lib1')
 
     if rpath:
         o.rpath=os.path.join(bdir, 'default/libdir')
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 9c922f7e036..cf59827f7ba 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -79,7 +79,7 @@ def build_dependencies(self):
 
     if self.samba_type in ['LIBRARY', 'PLUGIN', 'BINARY', 'PYTHON']:
         self.uselib        = list(self.final_syslibs)
-        self.uselib_local  = list(self.final_libs)
+        self.use  = list(self.final_libs)
         self.add_objects   = list(self.final_objects)
 
         # extra link flags from pkg_config
@@ -98,8 +98,8 @@ def build_dependencies(self):
             for f in self.env.undefined_ignore_ldflags:
                 self.ldflags.append(f)
 
-        debug('deps: computed dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
-              self.sname, self.uselib, self.uselib_local, self.add_objects)
+        debug('deps: computed dependencies for target %s: uselib=%s use=%s add_objects=%s',
+              self.sname, self.uselib, self.use, self.add_objects)
 
     if self.samba_type in ['SUBSYSTEM', 'BUILTIN']:
         # this is needed for the cflags of libs that come from pkg_config
@@ -331,7 +331,7 @@ def check_group_ordering(bld, tgt_list):
 
     ret = True
     for t in tgt_list:
-        tdeps = getattr(t, 'add_objects', []) + getattr(t, 'uselib_local', [])
+        tdeps = getattr(t, 'add_objects', []) + getattr(t, 'use', [])
         for d in tdeps:
             t2 = bld.get_tgen_by_name(d)
             if t2 is None:
@@ -355,8 +355,8 @@ def show_final_deps(bld, tgt_list):
     for t in tgt_list:
         if not targets[t.sname] in ['LIBRARY', 'PLUGIN', 'BINARY', 'PYTHON', 'SUBSYSTEM', 'BUILTIN']:
             continue
-        debug('deps: final dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
-              t.sname, t.uselib, getattr(t, 'uselib_local', []), getattr(t, 'add_objects', []))
+        debug('deps: final dependencies for target %s: uselib=%s use=%s add_objects=%s',
+              t.sname, t.uselib, getattr(t, 'use', []), getattr(t, 'add_objects', []))
 
 
 def add_samba_attributes(bld, tgt_list):
@@ -1038,7 +1038,7 @@ savedeps_version = 3
 savedeps_inputs  = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags',
                     'source', 'grouping_library', 'samba_ldflags', 'allow_undefined_symbols',
                     'use_global_deps', 'global_include' ]
-savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes',
+savedeps_outputs = ['uselib', 'use', 'add_objects', 'includes',
                     'cflags', 'ldflags', 'samba_deps_extended', 'final_libs']
 savedeps_outenv  = ['INC_PATHS']
 savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES', 'EXTRA_CFLAGS', 'EXTRA_LDFLAGS', 'EXTRA_INCLUDES' ]



More information about the samba-technical mailing list