Waf doesn't work

I’m currently trying to setup building enviroment on Win10 using WSL. I follow steps described in “Setting up the Build Environment (Linux/Ubuntu)”, also tried some youtube video. Unfortunately, ./waf doesn’t work for me whatever I do.

Here’s example:

./waf list_boards
/usr/bin/python3: can’t open file ‘<…>’: [Errno 2] No such file or directory
Missing waf submodule. Trying to get it
error: could not lock config file .git/config: Permission denied
error: could not lock config file .git/config: Permission denied
fatal: Failed to register url for submodule path ‘modules/waf’
Could not update submodule

What do I do?

I’ve solved my problem by myself. su root → git submodule update --init --recursive --force. That’s it.

that is bad .. you shouldn’t need root for anything related to software development …

I would advice you to start again the installation as a normal user, and to clone the repo into wsl and not windows filesystem ! (that is far faster and prevent permission mess)

3 Likes

Thank you. Actually I’m very new to ardupilot software development. I followed this guide (https://youtu.be/PLGezPQYMrs?feature=shared). As shown there, person has even cloned ardupilot to root folder. I’m not sure if it is right or wrong, but anyway I cloned it to home directory.

Also I faced another problem.

/waf configure --board Pixhawk4
<…>
Could not find the program [‘arm-none-eabi-ar’]
(complete log in /home/dmitry/ardupilot_gs/build/config.log)

I’ve installed GCC compilier as it described, but it didn’t help.

That video is outdated and also very incorrect if anything other than installing some system wide packages was done as root. If ever the command su root is used, you should pretty much ignore whatever else that person has to say.

Start over with a fresh environment.

Follow the actual documentation provided by ArduPilot and not a 7 year old video by an enthusiast with good intentions and bad habits.

1 Like

Thank you! I will. Sorry for my incompetence, but how do I delete everything I downloaded and reset all settings to start from beginning? Can I use sudo rm -rf for that? I use WSL

If you’re using WSL, you might be best suited to completely reinstall WSL (google that).

If you’re using a dedicated Linux distro, delete the cloned ardupilot directory and any other cruft that the video had you create.

1 Like

Once you’ve reinstalled WSL (to avoid any conflicts created by following that old video), clone the repository to your user’s home folder. You DO NOT need to execute any routine build tasks as root. Use sudo sparingly, and mostly for installing system wide packages with apt.

2 Likes