[Solved] Waf crashes on configure (--use-lld is at fault!)

Running my build config, it crashes your version of waf (on git head 7fad21d5172c994fc697ea593902ecfe844d700f) or something in waf doesnt like --use-lld

CC=gcc CXX=g++ ./waf configure --prefix=/opt/ard9 --use-lld --debug-symbols --freedesktop --no-nls --no-phone-home --qm-dsp-include=/usr/include/qm-dsp

generates;

Checking for header jpeglib.h                        : Traceback (most recent call last):                                                                     
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Scripting.py", line 119, in waf_entry_point                     
    run_commands()                                                                                                                                            
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Scripting.py", line 182, in run_commands                        
    ctx=run_command(cmd_name)                                                                                                                                 
        ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                 
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Scripting.py", line 173, in run_command                         
    ctx.execute()                                                                                                                                             
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Configure.py", line 85, in execute                              
    super(ConfigurationContext,self).execute()                                                                                                                
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Context.py", line 92, in execute                                
    self.recurse([os.path.dirname(g_module.root_path)])                                                                                                       
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/xxxxxxx/nas/outside/ardour/wscript", line 1488, in configure
    conf.recurse(i)
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/xxxxxxx/nas/outside/ardour/libs/tk/ydk-pixbuf/wscript", line 42, in configure
    conf.check_cc(header_name='jpeglib.h',
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
           ^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Tools/c_config.py", line 432, in check_cc
    return self.check(*k,**kw)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
           ^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Tools/c_config.py", line 432, in check_cc
    return self.check(*k,**kw)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
           ^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Tools/c_config.py", line 387, in check
    ret=self.run_build(*k,**kw)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Configure.py", line 175, in fun
    return f(*k,**kw)
           ^^^^^^^^^^
  File "/home/xxxxxxx/nas/outside/ardour/.waf3-2.0.26-57974d3e06a39c86466442182cfcf467/waflib/Configure.py", line 347, in run_build
    shutil.rmtree(dir)
  File "/usr/lib/python3.12/shutil.py", line 785, in rmtree
    _rmtree_safe_fd(fd, path, onexc)
  File "/usr/lib/python3.12/shutil.py", line 697, in _rmtree_safe_fd
    onexc(os.rmdir, fullname, err)
  File "/usr/lib/python3.12/shutil.py", line 695, in _rmtree_safe_fd
    os.rmdir(entry.name, dir_fd=topfd)
OSError: [Errno 39] Directory not empty: 'testbuild'

after lots of fussing around I’ve worked out that --use-lld is the cause of the problem. Removing it lets waf complete the configure

so this is more an FYI to anyone building with ‘–use-lld’

I use

./waf configure --strict --ptformat --cxx17 --use-lld --backtrace --libjack=weak --compile-database --address-sanitizer

without any issues. Do you have lld installed?

yep; I have llvm-23 + llvm-23 with lld. my default is

/usr/lib/llvm-23/bin/lld

I’ve been using my above config to build ardour for years, I hadnt done a build since feb (it worked back then). its odd. I tested forcing llvm-23 and llvm-23 verison of lld

LLD=/usr/lib/llvm-22/bin/lld CC=gcc CXX=g++ ./waf configure --prefix=/opt/ard9 --debug-symbols --freedesktop --no-nls --no-phone-home --qm-dsp-include=/usr/include/qm-dsp --use-lld

ok I did some more digging. this is weird and I dont know why. I moved the source tree off my NAS, and into a local disk, no errors with --use-lld.

so something doesnt like maybe the locking on an nfs build, where before I never had an issue…

so I think this is a non-issue and its just on my end. consider this resolved/closed and my bad lol.