The existence of (to use a real example) an up-to-date system tdb with python2.7 bindings means the python3 tdb bindings won't be built. In buildtools/wafsamba/samba_bundled.py, we have: @conf def CHECK_BUNDLED_SYSTEM_PYTHON(conf, libname, modulename, minversion='0.0.0'): '''check if a python module is available on the system and has the specified minimum version. ''' if conf.LIB_MUST_BE_BUNDLED(libname): return False # see if the library should only use a system version if another dependent # system version is found. That prevents possible use of mixed library # versions minversion = minimum_library_version(conf, libname, minversion) try: m = __import__(modulename) except ImportError: found = False else: try: version = m.__version__ except AttributeError: found = False else: found = tuplize_version(version) >= tuplize_version(minversion) if not found and not conf.LIB_MAY_BE_BUNDLED(libname): Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion)) sys.exit(1) return found So the python running waf decides whether the library exists. It would be better to run the check in a subprocess, and do it with each python.
I'm going to mark this WONTFIX, given python 2 is history. It is possible people will face a related problem when using virtual Python environments, if the system Python 3.x is different from the venv Python 3.y, and the for some reason they run waf as 3.x. So don't do that.