Happy new year! On this post I am going to talk about my experience contributing to NetworkManager and how to set up your development environment. I will try to give all the details possible. Maybe there could be a follow up post.
Why should you contribute to NetworkManager?
There are plenty of reasons for contributing to NetworkManager.
- Widely used in a lot of Linux distributions (Ubuntu, Fedora, Archlinux).
- Free software and copy-left (LGPL-2.1+/GPL-2.0+).
- Simplifies Networking with clients like nm-applet or nmtui.
- There are other external clients like nmstate.
- The community is friendly and willing to help!
What do you need to know?
I think almost everything can be learnt when contributing but there are several skills that will help you during the process.
- C programming skills.
- Networking knowledge, specially network interfaces managing. Nice networking article
- Basic git knowledge. My git article!
- GLib programming experience. GLib documentation
First steps: Before contributing
One of the most important thing to do before starting to contribute is to decide what you would like to do. I would recommend to think on something that you miss on NetworkManager, or an issue that you have found there. Usually, to work on problems that are affecting you directly will motivate you even more!
If you don’t have any ideas on mind, you can check their Gitlab issues or ask on their IRC #nm channel on freenode.
Another important step is to read their CONTRIBUTING guidelines. It is very important to avoid wasting other people’s time.
Fork the project and clone it
NetworkManager project is hosted at [freedesktop Gitlab instance], you will need to log in and fork the NetworkManager project. After that you can clone it.
I strongly recommend to set the original repository as upstream git remote. This way you will be able to update and rebase your repository quite quickly.
Create a container for developing
I strongly recommend to use podman instead of docker for multiple reasons but in the end, you can use whatever you prefer. My container is being created with this template.
Run the container image sharing/mounting the NetworkManager project folder. After running the container image, you can get into the container with a shell prompt.
All the following steps will be done inside the container shell prompt.
Install Fedora required packages
There are some recommended packages that will be useful for you. NetworkManager team has prepared a script to install them quite fast on Fedora but also on debian and debian-based distributions.
Compile NetworkManager and run the unit tests
Now is the time to compile NetworkManager and check that everything is working as expected. I do recommend you to first compile it and then run the tests.
Everything is ready now!
Now you can work with you preferred editor in NetworkManager and use the container shell prompt in order to compile and test the changes. If you are willing to contribute to a GUI as nm-applet or nmtui, I recommend you to create a Fedora VM and test it there.
For other resources or help, you can contact me on #nmstate and #nm channels on freenode IRC.