Building Copter-4.4 on Debian Bookworm

Hello,

Currently I am building ardupilot/arducopter source on Debian Bookworm. My set up entails using…

  1. Python3-venv
  2. Not allowing user on my venv for building

I am receiving an error for building:

When building with venv sourced, I get:

Traceback (most recent call last):
  File "/home/gar/ardupilot/modules/waf/waf-light", line 167, in <module>
    Scripting.waf_entry_point(cwd, VERSION, wafdir)
  File "/home/gar/ardupilot/modules/waf/waflib/Scripting.py", line 80, in waf_entry_point
    env.load(os.path.join(cur, Options.lockfile))
  File "/home/gar/ardupilot/modules/waf/waflib/ConfigSet.py", line 315, in load
    code = Utils.readf(filename, m='rU')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gar/ardupilot/modules/waf/waflib/Utils.py", line 231, in readf
    with open(fname, m) as f:
         ^^^^^^^^^^^^^^
ValueError: invalid mode: 'rUb'

The value error is understood on my part but I do not know how to get around it without changing source within ardupilot C/C++ ware. 

and...

When building without the venv sourced, I get:

+ pip3 install --user -U future lxml pymavlink MAVProxy pexpect flake8 geocoder empy==3.3.4 dronecan pygame intelhex

Those amounts of repos do not play nice with Bookworm for now because they do not like externally managed packages.

I know I have had trouble in the past with building and making it work. I am trying now to update the build.

Seth

Hello Again,

Sorry. I figured it out. It took a while but it seems some build options in the building file for ubuntu is not quite what I needed.

Seth

Open PR that adds Bookworm support to the prereqs script:

Tools: add Debian 12 support to prereqs script by yuri-rage · Pull Request #25712 · ArduPilot/ardupilot (github.com)

I see you guys have a PR. Okay, nice. The build works if some additional parameters in the script are take away or added.

Seth

P.S. For instance…

"-U"

For upgrading the pip3 installs will work further down the script and putting in Bookworm instead of bullseye will work alongside the required files for building. Also, argparse is not available in form.

I used python3-argparse-manpage which probably does not include what I need.

I could not find the proper pkg-config either. This is because people are moving away from 32-bit data and to 64-bit (I am guessing)…

This is the line I was discussing:

ardupilot/Tools/environment_install/install-prereqs-ubuntu.sh at master · ArduPilot/ardupilot (github.com)

That line needs some work for Bookworm to work.

The PR covers all of that and creates a venv that is appropriate and functional.

If you don’t want to use a Python virtual environment for the Python dependencies, then you should probably explore building within Docker.

1 Like