This project aims to be able to compile & execute wicked from vscode by generating the RPM files and installing them onto a dynamically created container with systemd support, ultimately allowing to debug from the editor in a matter of seconds.
- There is a change in wickedd-nanny that I want to test
- launch.json and tasks.json allow to build and debug the wicked CLI binary only... so we need to create a VM or container to test
- Copy the RPMs to the container / VM
- install the RPMs on the VM or container
- manually debug using gdb
- There is a change in the code that I want to test
- launch.json and tasks.json take care of: a) Building the RPMs b) Starting a container using a pre-build Podman image with systemd installed c) Install wicked RPMs on top the existing image d) Use gdb & nsenter to attach to the process.
- Debug and profit!
- The integrated debugger uses gdb, and while gdb supports debugging multiple processes, it's not clear if vscode will support this
- Root access is required to start systemd containers (at least using podman), need to investigate this further
- Containers are not really a valid test environment for many cases.
What will probably happen
Because of limitation 1, it's probably going to be tricky to debug using the integrated debugger. If at least it's possible to compile and launch a new containers that is running the modified RPMs, that would be already a way of saving time when wanting to test a feature.
This project is one of its kind!