Debian 12 Build Environment?

I’m toying a bit with a “HomeLab” server of sorts on a rather powerful machine within which I can easily spin up VMs under Proxmox. For ArduPilot and other dev projects, I installed a minimal Ubuntu instance but quickly tired of the stupid “Pro subscription” nag messages, and I’m not much a fan of their forcing the use of Snap, so I thought I’d try plain old Debian, instead.

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

(look at post history if you want to see the “wrong” way to do it)

1 Like

Nice work Yuri. Yes, I would like a Debian 12 support PR.

normally we are already supporting debian ! May just need to add the latest version (bookworm ?) on the install script .

Latest test result :

You can see that buster and bulleye are working well!

PR welcome if you already know what package are needed, otherwise I could do it.

As most recent distro a moving to pyenv, we can probably set this are the default behavior, that would allow to support most unknown distribution without modification of the install script.

Do you agree that use of pipx is the desired mechanism for maintaining user installed modules?

pipx isn’t standard so best to avoid it for the mass, pip is the current way. On recent Ubuntu version we are using venv so that don’t have issue with system libs anymore, pretty much the same as pipx

I don’t know it much, but from its docs, if we do mavproxy and pymavlink installation in isolation that will create issue for developper as mavproxy won’t use the pymavlink instalation (didn’t try, just guessing from the docs)

1 Like

I’ll see what I can do to test/refine based on your input here. Should be able to snapshot a base install VM and revert to it multiple times to ensure we capture what’s required.

Somehow I missed that other Debian distros are already supported and sorta rolled my own with some kludges that can easily be refined.

generally, I test the pre-install scripts into docker. That is pretty simple to do (should not forget steps here : https://github.com/ArduPilot/ardupilot/blob/master/.github/workflows/test_environment.yml#L87)

We should then add the new debian version into the weekly CI test !

2 Likes

PR pending

Happy to have you take a look to see if I missed a detail or nuance. Seems to be working well for me!


Slightly off topic, if you want all the goodies that are included by the script (in ~/.profile) to actually function in a VS Code remote terminal, including automatic venv activation, the following entries in settings.json are quite helpful:

  "terminal.integrated.defaultProfile.linux": "bash",
  "terminal.integrated.profiles.linux": {
    "bash": {
        "path": "bash",
        "args": [
            "-l"
        ]
    },
1 Like

Thx.

I don’t use vscode, but feel free to make another PR to add it !

I guess it could be added as a local setting in the AP clone. I don’t know how much we want to dictate user IDE settings, though…

Maybe an optional settings edit by the prereqs script?

we already have bunch of things … if that something standard to make the default terminal better with our tools, I think that is worth it to have it. Most user use whatever we give them anyway

1 Like

Same situation here. Debian bullseye is ok, but not Debian bookworm …

We have a .vscode folder on ardupilot if you want to contribute it there.

I found it to be a little problematic when added as a local/workspace setting. I don’t know why that is…

I had completely forget about this. I will review the pr tomorrow, should be merge Wednesday

support merged ! Thanks @Yuri_Rage

1 Like

How about jonas PR to plotfuggler?

Hope it is OK to post here.

Found a fresh installation script for Debian 12 here (just 7h old)

Have a uncluttered bookworm in a VM. The test run with that fresh script stopped here

~/ardupilot$ ./waf configure

Waf: The wscript in ‘/home/kalle/ardupilot’ is unreadable
Traceback (most recent call last):
File “/home/kalle/ardupilot/modules/waf/waflib/Scripting.py”, line 140, in waf_entry_point
set_main_module(os.path.normpath(os.path.join(Context.run_dir, Context.WSCRIPT_FILE)))
File “/home/kalle/ardupilot/modules/waf/waflib/Scripting.py”, line 190, in set_main_module
Context.g_module = Context.load_module(file_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kalle/ardupilot/modules/waf/waflib/Context.py”, line 665, in load_module
code = Utils.readf(path, m=‘rU’, encoding=encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kalle/ardupilot/modules/waf/waflib/Utils.py”, line 231, in readf
with open(fname, m) as f:
^^^^^^^^^^^^^^
ValueError: invalid mode: ‘rUb’

Full terminal protocol attached

New File.txt (120.8 KB)

A sudo apt install python-is-python3 is missing in that script

br Karl

Use Tools/environment_install/install-prereqs-ubuntu.sh on a fresh Bookworm install.

Tested by multiple users/devs without issue.

If you answer yes to all of the bash options during install, you should then log out and log back in or source ~/.profile to activate the environment.

Works now on a clean Debian 12 in a VM!!

See Installation problems on Ubuntu

That are the commands (by Yuri) needed

sudo apt install git
git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git
cd ardupilot
./Tools/environment_install/install-prereqs-ubuntu.sh
source ~/.profile

My faults:

  • loaded the ‘install-prereqs-ubuntu.sh’ separately and run that one.

  • might have missed 1 or 2 YES inputs in the script. ALL questions have to be answered with Y

br KH