Waf error when buliding on linux (ubuntu)

lately (for the last couple months on 22.04 and 22.10 ubuntu), I see the following error when I try to install a newly built ardorur.

sly@redbox:~/src/ardour$ sudo ./waf install
Waf: The wscript in '/home/sly/src/ardour' is unreadable
Traceback (most recent call last):
  File "/home/sly/src/ardour/.waf3-2.0.23-8ba091fb015bc715bba24c9cf03ec913/waflib/Scripting.py", line 102, in waf_entry_point
    set_main_module(wscript)
  File "/home/sly/src/ardour/.waf3-2.0.23-8ba091fb015bc715bba24c9cf03ec913/waflib/Scripting.py", line 142, in set_main_module
    Context.g_module=Context.load_module(file_path)
  File "/home/sly/src/ardour/.waf3-2.0.23-8ba091fb015bc715bba24c9cf03ec913/waflib/Context.py", line 362, in load_module
    exec(compile(code,path,'exec'),module.__dict__)
  File "/home/sly/src/ardour/wscript", line 202, in <module>
    other = parts[1].split('-', 1)

Any suggestions? Thanks!

I assume compilation works… So does it work without sudo?

DESTDIR=/tmp/ardour ./waf install

Yes, that works. Somehow root’s python must be doing something wrong. My python skills are lacking…

Under the hood the issue is that git describe does not return a valid revision.

in ardour’s src-tree (where you call ./waf) does

sudo git describe

work and return a revision like 7.0-pre0-2619-g280e7d9f4c ?

–

PS. it is not usually a good idea to install git versions system-wide. Mainly because ./waf uninstall only works correctly for the current revision and current configuration.
It is preferable to run it from the source tree:

./gtk2_ardour/ardev

or

cd gtk2_ardour
./ardev

If git describe returns “fatal: No names found, cannot describe anything.” you probably cloned Ardour initially using the --depth parameter.

If so you can convert it to a full clone by running

git fetch --unshallow && git pull

Hi!

I’ve prepared a 3 small scripts for Kubuntu (I hope they work in Ubuntu too) to make the Ardour compilation process as easy as possible.

arconfig - creates a config file that contains paths for sources and installation directories, how many threads can be used for compilation, how many compiled previous versions to keep before delete, all dependencies installation, etc.

argit - gets the latest Ardour sources from Github.

arcompile - Ardour compilation and installation command. It creates application menu entry on first run This is the step I’ve tested under KDE and I don’t know how it works in Gnome or XFCE or anything else.

There are two language versions: Polish (my native) and English.
Let me know if you find any errors in English translation, this is not my forte.

Link: Argit

In this case compilation would also have failed already.

Could be I tell rubbish, but I tried to install Ardour7 and had the same problem. Seems to me that in wscript, shortly before line 202, the variable “rev” is empty. This leads to “IndexError: list index out of range”.

Installing development versions is not a good idea at this point since Ardour pre-7.0 is changing so quickly. The recommended method for development versions is to run from the build directory using the ardev script.

1 Like

That that assessment is correct. The odd issue is that this is only the case when using sudo.

rev is set by calling git describe HEAD, which is why I’m interested what
sudo git describe shows.

sudo git config --global --add safe.directory did the trick. Seems something changed in the way git handles this. I did sudo ./waf install a few times before without any trouble. Security issue?

BTW this is a test machine, so I don’t bother something breaking :wink:

fatal: unsafe repository ('/home/werner/src/ardour' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory /home/werner/src/ardour

Compiling works because I do it as normal user, only install with sudo.

1 Like

Yes, git released a fix for CVE-2022-24765, which deals with the issue that one person shouldn’t run git commands in another person’s repository.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.