Get Involved/development: Difference between revisions

From KDE Community Wiki
(Revamp the new developer page for more user-friendliness)
Line 1: Line 1:
__NOTOC__
__NOTOC__
== Becoming a KDE Developer ==
= Becoming a KDE Developer =


[[File:Konqui dev close cropped.png|right|x200px|]]
[[File:Konqui dev close cropped.png|right|x200px|]]
By joining the ranks of KDE developers, you will get to implement new features and defeat daunting bugs, all while collaborating to make coherent and stable releases. Developers collaborate in teams based on what area they are working in. These can be small teams working on a single application, up to large teams working on group of related pieces of software. Many developers are in more than one team.
By joining the ranks of KDE developers, you will get to implement new features and defeat daunting bugs, all while collaborating to make coherent and stable releases. Developers collaborate in teams based on what area they are working in. These can be small teams working on a single application, up to large teams working on group of related pieces of software. Many developers are in more than one team.


KDE runs or participates in several mentoring programs to help new developers, including an informal list of people who are willing to help newcomers get started. See the [[Mentoring]] page for more details.
KDE runs or participates in several mentoring programs to help new developers, including an informal list of people who are willing to help newcomers get started. See the [[Mentoring]] page for more details.


==Choosing what to do==


= Choosing what to do =
A good place to start is with a small bug or feature in an existing piece of software that affects you personally ("scratch your own itch"). Get in touch with the existing developers (see [[#Communicating with the team|Communicating with the team]], below) and they can help you out, by pointing you to the right place in the code and giving advice about how to tackle the problem.
A good place to start is with a small bug or feature in an existing piece of software that affects you personally ("scratch your own itch"). Get in touch with the existing developers (see [[#Communicating with the team|Communicating with the team]], below) and they can help you out, by pointing you to the right place in the code and giving advice about how to tackle the problem.


Line 15: Line 14:


* [https://bugs.kde.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&keywords=junior-jobs&list_id=1340815 Junior Jobs] are small tasks that are suitable for beginners (both bugs and features)
* [https://bugs.kde.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&keywords=junior-jobs&list_id=1340815 Junior Jobs] are small tasks that are suitable for beginners (both bugs and features)
* [https://bugs.kde.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ASSIGNED&bug_status=REOPENED&keywords=usability&keywords_type=allwords&list_id=1493316&order=product%2Cchangeddate%20DESC%2Cbug_status%20DESC%2Cresolution%2Cpriority%2Cassigned_to%2Cbug_id&query_format=advanced Bugs related to] KDE's [https://phabricator.kde.org/T6831 Usability & Productivity initiative], many of which are small and easy
* [http://www.englishbreakfastnetwork.org/ The English Breakfast Network] searches out simple, common issues in code that should be fixed, and going through the problems on there can provide a good overview of the code
* [http://www.englishbreakfastnetwork.org/ The English Breakfast Network] searches out simple, common issues in code that should be fixed, and going through the problems on there can provide a good overview of the code


== Communicating with the team ==
= New to (C++/Qt) software development? =
Most KDE software is written in C++ using the [https://www.qt.io Qt framework]. There are many guides to C++ online, and which one works for you will depend on how you learn best and what previous programming experience you have.
 
For learning Qt, you can find [https://wiki.qt.io/Books a list of books for learning Qt] on the Qt wiki. Qt also provides [http://doc.qt.io/qt-5/qtexamplesandtutorials.html lots of examples] you can look at.


There are several ways to get in touch with KDE developers, and developers for a specific project. The two most important are:
Most KDE software is also built on other KDE software, particularly the KDE Frameworks. The [https://techbase.kde.org TechBase wiki] has documentation about using these libraries, and a [[Books | book]] is available. See also [[Guidelines and HOWTOs/Development]].


* the IRC channel [irc://irc.kde.org/kde-devel <nowiki>#kde-devel</nowiki>] on [http://freenode.net/ the freenode network] ([http://kde.org/support/#irc learn more about IRC]) is the core channel for developers
= Get the code =
* the primary development mailing list is the [https://mail.kde.org/mailman/listinfo/kde-devel kde-devel list] ([http://kde.org/support/#mailinglists learn more about mailing lists])
First you will need to use your distro's package manager to install some basic tools:
* Debian/Ubuntu/KDE Neon: <tt>sudo apt install git cmake</tt>
* Fedora: <tt>sudo dnf install git cmake</tt>
* openSUSE: <tt>sudo zypper install git cmake</tt>
* Arch/Antergos/Manjaro: <tt>sudo pacman -S git cmake</tt>


Next, create a folder to hold all the source code repositories you're going to be downloading!
<pre>
mkdir ~/repos
cd ~/repos
</pre>


Both of these are general KDE development communication channels, and you may get directed to a more appropriate place for the project you are interested in. There is a [http://www.kde.org/mailinglists/ list of mailing lists] if you want to find a mailing list for a specific team directly.
Now download the source code for the project you would like to work on. All the KDE git repositories can be found at [https://cgit.kde.org/ here]. If you are not familiar with [https://git-scm.com/ Git], the [https://git-scm.com/book Git Book] is a good introduction. For now, just clone the repo:
<pre>
git clone https://anongit.kde.org/<repository-name>.git
</pre>


You can also try looking for the team's section on the [[Main Page]] of this wiki. Many teams have information there for new contributors.


==New to (C++/Qt) software development?==
= Set up your development environment =
Next you will need to download the dependencies for the project you would like to patch, so that it will compile. The way to do this varies heavily according to your distro:


Most KDE software is written in C++ using the [https://www.qt.io Qt framework]. There are many guides to C++ online, and which one works for you will depend on how you learn best and what previous programming experience you have.
'''Recommended development platforms'''
* KDE Neon: <tt>sudo apt install <repo/package name></tt>
* openSUSE Tumbleweed: <tt>sudo zypper si -d <repo/package name></tt>
* Arch/Antergos/Manjaro/other Arch-based distro: <tt>sudo pacman -S git <repo/package name></tt>


For learning Qt, you can find [https://wiki.qt.io/Books a list of books for learning Qt] on the Qt wiki. Qt also provides [http://doc.qt.io/qt-5/qtexamplesandtutorials.html lots of examples] you can look at.
'''Development platforms that can work if you upgrade to use newer packages'''


Most KDE software is also built on other KDE software, particularly the KDE Frameworks. The [https://techbase.kde.org TechBase wiki] has documentation about using these libraries, and a [[Books | book]] is available. See also [[Guidelines and HOWTOs/Development]].
These platforms can work If you install newer versions of KDE frameworks, or else things won't build.
* Fedora: [Insert method of updating KDE packages here] <tt>sudo dnf builddep <repo/package name></tt>
* Kubuntu: First install the Kubuntu Backports PPA to get the latest versions of KDE Software. (Warning: this will also update Plasma and KDE Applications): <tt>sudo add-apt-repository ppa:kubuntu-ppa/backports && sudo apt update</tt>. Then you can run <tt>sudo apt install <repo/package name></tt>


==Getting the code==
Before you work on your patch, try to compile the software to make sure that your development environment is set up properly:


Source code for KDE projects can be found in the KDE Git repositories. These are listed in our [https://commits.kde.org/ repository browser], and the URLs you need to clone can be found there as well. If you are not familiar with [https://git-scm.com/ Git], the [https://git-scm.com/book Git Book] is a good introduction, although all you really need right now is
<pre>
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/kde/
make
</pre>
(Notice how we are telling CMake to install to <tt>/opt/kde/</tt> instead of <tt>/usr/</tt> (which is the normal location). This is because we don't want to overwrite the software provided by your distro, which could destabilize the system.


{{Input|1=git clone <nowiki>https://anongit.kde.org/<repository-name>.git</nowiki>}}
Did the project compile? Great! Move onto the next section. If you ran into problems, See this page for what to do about it.


For almost all KDE software projects, you will need to use [https://www.cmake.org CMake] to build them. On UNIX systems, the process is fairly straightforward:


{{Input|1=mkdir build
= Make your patch =
cd build
Now you can open your editor and get hacking! As before, make sure it compiles:
cmake -DCMAKE_INSTALL_PREFIX=/where/you/want/to/install/it ..
<pre>
make
make
make install}}
</pre>
 
 
= Test your patch =
At this point you have a patch, and the project still compiles. Now it's time to run the project's unit tests:
<pre>
make test
</pre>
 
If any test fail, that needs to be investigated before you can proceed. If the tests pass, then it's time to install your patched software:
<pre>
sudo make install
</pre>
 
This will install the software to <tt>/opt/kde/</tt>. To actually run it, you will need to set some environment variables to account for the non-standard location. First, create a file with the environment variables:
 
<pre>
cat >~/.kderc << EOF
export KF5=/opt/kde
export QTDIR=/usr
export CMAKE_PREFIX_PATH=$KF5:$CMAKE_PREFIX_PATH
export XDG_DATA_DIRS=$KF5/share:$XDG_DATA_DIRS:/usr/share
export XDG_CONFIG_DIRS=$KF5/etc/xdg:$XDG_CONFIG_DIRS:/etc/xdg
export PATH=$KF5/bin:$QTDIR/bin:$PATH
export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH
export QML2_IMPORT_PATH=$KF5/lib/qml:$KF5/lib64/qml:$KF5/lib/x86_64-linux-gnu/qml:$QTDIR/qml
export QML_IMPORT_PATH=$QML2_IMPORT_PATH
export KDE_SESSION_VERSION=5
export KDE_FULL_SESSION=true
export SASL_PATH=/usr/lib/sasl2:$KF5/lib/sasl2
EOF
</pre>
 
Now <tt>source</tt> it to pick up the new environment variables:
<pre>
source ~/.kderc
</pre>
 
Now you're ready to run your patched program!
<pre>
/opt/kde/bin/<the program>
</pre>


The CMake step will complain if you don't have the project's dependencies installed (don't forget that on many Linux distributions, you need to install the development version of packages). Once you have installed the things it tells you, re-run CMake so it picks them up. If you want a way to get the latest versions of all the dependencies easily, you might want to consider looking at [http://neon.kde.org.uk/ KDE Neon].
Does it Behave as you expect? If not, Go back and work on your patch some more, then re-compile and re-deploy, and test again, until the program does what you'd like it to do.


Hopefully the project has unit tests, which can be run with


{{Input|1=make test}}
= Submitting your first patch =
Once you're happy with your patch and have verified that it does what you want, you need to send it to other KDE developers for review. KDE uses [https://phabricator.kde.org Phabricator] for this. [[Infrastructure/Phabricator | Learn how to submit a patch with Phabricator]]


Now you can open your editor and get hacking!


=Submitting your first patch=
= Communicating with the team =
There are several ways to get in touch with KDE developers, and developers for a specific project. The two most important are:
* the IRC channel [irc://irc.kde.org/kde-devel <nowiki>#kde-devel</nowiki>] on [http://freenode.net/ the freenode network] ([http://kde.org/support/#irc learn more about IRC]) is the core channel for developers
* The primary development mailing list is the [https://mail.kde.org/mailman/listinfo/kde-devel kde-devel list] ([http://kde.org/support/#mailinglists learn more about mailing lists])


Once you have made a change, you need to send it to someone on the team to review it and (hopefully) apply it. You should find out from the team what their preferred method is, but for most teams it will be uploading the patch to [https://phabricator.kde.org Phabricator]. You will need a [https://identity.kde.org KDE Identity] account to log in.
Both of these are general KDE development communication channels, and you may get directed to a more appropriate place for the project you are interested in. There is a [http://www.kde.org/mailinglists/ list of mailing lists] if you want to find a mailing list for a specific team directly. Many teams have their own [[Telegram]] rooms, too.


; [https://phabricator.kde.org Phabricator]
You can also try looking for the team's section on the [[Main Page]] of this wiki. Many teams have information there for new contributors.
: The preferred way to submit a patch is through the [https://secure.phabricator.com/book/phabricator/article/arcanist/ Arcanist] command line too. You can also use the Phabricator web interface (after logging in, go to [https://phabricator.kde.org/differential/ Differential] (on the left menu), choose [https://phabricator.kde.org/differential/diff/create/ Create Diff] (in the top right) and follow the instructions), but then be prepared to communicate your email address if the patch is accepted, so that it can have the proper credits. More detailed documentation about the KDE instance of Phabricator [https://community.kde.org/Infrastructure/Phabricator is available].


==Next steps==


After you have had several patches accepted, a KDE developer is likely to suggest you get a [[Infrastructure/Get a Developer Account|Developer account]], which will allow you to commit directly to KDE projects. There will be very few limits on where you can commit, so you are expected to act responsibly. At this point, congratulations! You are officially a KDE developer!
== Next steps ==
After you have had several patches accepted, a KDE developer is likely to suggest you get a [[Infrastructure/Get a Developer Account|Developer account]], which will allow you to commit directly to KDE projects. With very few limits on where you can commit, you will be expected to act responsibly. At this point, congratulations! You are officially a KDE developer!


You may also want to set up a more permanent or advanced development environment, which will be very handy to start working on KDE Frameworks or Plasma itself. See [[Guidelines and HOWTOs/Build from source]]
You may also want to set up a more permanent or advanced development environment, which will be very handy to start working on KDE Frameworks or Plasma itself. See [[Guidelines and HOWTOs/Build from source]]

Revision as of 19:11, 8 February 2018

Becoming a KDE Developer

By joining the ranks of KDE developers, you will get to implement new features and defeat daunting bugs, all while collaborating to make coherent and stable releases. Developers collaborate in teams based on what area they are working in. These can be small teams working on a single application, up to large teams working on group of related pieces of software. Many developers are in more than one team.

KDE runs or participates in several mentoring programs to help new developers, including an informal list of people who are willing to help newcomers get started. See the Mentoring page for more details.


Choosing what to do

A good place to start is with a small bug or feature in an existing piece of software that affects you personally ("scratch your own itch"). Get in touch with the existing developers (see Communicating with the team, below) and they can help you out, by pointing you to the right place in the code and giving advice about how to tackle the problem.

Other starting points are:

New to (C++/Qt) software development?

Most KDE software is written in C++ using the Qt framework. There are many guides to C++ online, and which one works for you will depend on how you learn best and what previous programming experience you have.

For learning Qt, you can find a list of books for learning Qt on the Qt wiki. Qt also provides lots of examples you can look at.

Most KDE software is also built on other KDE software, particularly the KDE Frameworks. The TechBase wiki has documentation about using these libraries, and a book is available. See also Guidelines and HOWTOs/Development.

Get the code

First you will need to use your distro's package manager to install some basic tools:

  • Debian/Ubuntu/KDE Neon: sudo apt install git cmake
  • Fedora: sudo dnf install git cmake
  • openSUSE: sudo zypper install git cmake
  • Arch/Antergos/Manjaro: sudo pacman -S git cmake

Next, create a folder to hold all the source code repositories you're going to be downloading!

mkdir ~/repos
cd ~/repos

Now download the source code for the project you would like to work on. All the KDE git repositories can be found at here. If you are not familiar with Git, the Git Book is a good introduction. For now, just clone the repo:

git clone https://anongit.kde.org/<repository-name>.git


Set up your development environment

Next you will need to download the dependencies for the project you would like to patch, so that it will compile. The way to do this varies heavily according to your distro:

Recommended development platforms

  • KDE Neon: sudo apt install <repo/package name>
  • openSUSE Tumbleweed: sudo zypper si -d <repo/package name>
  • Arch/Antergos/Manjaro/other Arch-based distro: sudo pacman -S git <repo/package name>

Development platforms that can work if you upgrade to use newer packages

These platforms can work If you install newer versions of KDE frameworks, or else things won't build.

  • Fedora: [Insert method of updating KDE packages here] sudo dnf builddep <repo/package name>
  • Kubuntu: First install the Kubuntu Backports PPA to get the latest versions of KDE Software. (Warning: this will also update Plasma and KDE Applications): sudo add-apt-repository ppa:kubuntu-ppa/backports && sudo apt update. Then you can run sudo apt install <repo/package name>

Before you work on your patch, try to compile the software to make sure that your development environment is set up properly:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/kde/
make

(Notice how we are telling CMake to install to /opt/kde/ instead of /usr/ (which is the normal location). This is because we don't want to overwrite the software provided by your distro, which could destabilize the system.

Did the project compile? Great! Move onto the next section. If you ran into problems, See this page for what to do about it.


Make your patch

Now you can open your editor and get hacking! As before, make sure it compiles:

make


Test your patch

At this point you have a patch, and the project still compiles. Now it's time to run the project's unit tests:

make test

If any test fail, that needs to be investigated before you can proceed. If the tests pass, then it's time to install your patched software:

sudo make install

This will install the software to /opt/kde/. To actually run it, you will need to set some environment variables to account for the non-standard location. First, create a file with the environment variables:

cat >~/.kderc << EOF
export KF5=/opt/kde
export QTDIR=/usr
export CMAKE_PREFIX_PATH=$KF5:$CMAKE_PREFIX_PATH
export XDG_DATA_DIRS=$KF5/share:$XDG_DATA_DIRS:/usr/share
export XDG_CONFIG_DIRS=$KF5/etc/xdg:$XDG_CONFIG_DIRS:/etc/xdg
export PATH=$KF5/bin:$QTDIR/bin:$PATH
export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH
export QML2_IMPORT_PATH=$KF5/lib/qml:$KF5/lib64/qml:$KF5/lib/x86_64-linux-gnu/qml:$QTDIR/qml
export QML_IMPORT_PATH=$QML2_IMPORT_PATH
export KDE_SESSION_VERSION=5
export KDE_FULL_SESSION=true
export SASL_PATH=/usr/lib/sasl2:$KF5/lib/sasl2
EOF

Now source it to pick up the new environment variables:

source ~/.kderc

Now you're ready to run your patched program!

/opt/kde/bin/<the program>

Does it Behave as you expect? If not, Go back and work on your patch some more, then re-compile and re-deploy, and test again, until the program does what you'd like it to do.


Submitting your first patch

Once you're happy with your patch and have verified that it does what you want, you need to send it to other KDE developers for review. KDE uses Phabricator for this. Learn how to submit a patch with Phabricator


Communicating with the team

There are several ways to get in touch with KDE developers, and developers for a specific project. The two most important are:

Both of these are general KDE development communication channels, and you may get directed to a more appropriate place for the project you are interested in. There is a list of mailing lists if you want to find a mailing list for a specific team directly. Many teams have their own Telegram rooms, too.

You can also try looking for the team's section on the Main Page of this wiki. Many teams have information there for new contributors.


Next steps

After you have had several patches accepted, a KDE developer is likely to suggest you get a Developer account, which will allow you to commit directly to KDE projects. With very few limits on where you can commit, you will be expected to act responsibly. At this point, congratulations! You are officially a KDE developer!

You may also want to set up a more permanent or advanced development environment, which will be very handy to start working on KDE Frameworks or Plasma itself. See Guidelines and HOWTOs/Build from source