Sunday, July 20, 2014

My way to develop with git in KDE repos

From time to time there is the discussion of which workflow is better to develop with git, etc.

I'm not going to try to convince anyone on which workflow to use, i'm just going to explain what i do and explain why i think it's useful (and even more in the multi-developer KDE environment).

Let's picture the scenario we had a few days ago where there were lots of projects with three "live" branches, i.e. KDE/4.13, KDE/4.14 and master.

What is my way to develop?
* Bugfixes go to oldest "live" stable branch
* Features go to oldest "live" non frozen branch
* Branches are merged up

So let's say that I develop a new feature to support a whole new document format to Okular. Since that is a new feature it would go to the "oldest live non frozen branch", that in this case was master since KDE/4.13 and KDE/4.14 where already feature frozen. So I commit it to master and then "Branches are merged up" which in this case means nothing since there's no branch "up" from master.

Now let's say there's a crash bug when opening a file with three monitors. Since that is a bugfix, it'd go to the "oldest live stable branch", that in this case would be KDE/4.13. And then "Branches are merged up", so i would mean 4.13 into 4.14 and after that 4.14 into master. Ensuring that 4.14 and master also have the bugfix.

I think that this is a very useful way of developing using git branches for a lot of reasons, but the biggest of them is that for a random person it is easy to know if a "branch high in the hiearchy" has all the bugfixes or not, he just have to go to KDE/4.14 and to "git merge origin/KDE/4.13", if no change is brought over, it means that for sure all the bugfixes and code that was in the 4.13 release will be in the 4.14 release, otherwise it is hard to know.

So now that 4.13 is not going to be released anymore and 4.14 is a very young fork of master, i suggest that for every push you do to KDE/4.14 you go to the master branch and merge origin/KDE/4.14. This way you will have a master that is always fully merged with 4.14 and a third party person looking at your code (like the release manager) won't have to worry if it contains all the code or not.

Happy hacking!

And of course if you disagree with me, that's fine, not that i'm happy if my reasons did not convince you :)

Wednesday, July 09, 2014

KDE/4.14 branch forked

KDE/4.14 branch forked, master is now open. Next applications release will be a kdelibs4 and KF5 mix!

http://mail.kde.org/pipermail/kde-cvs-announce/2014/000147.html

Tuesday, May 20, 2014

KDE is a nice community, but we can do better!

Since a long time KDE.org has been referring to KDE as a team of people, a community, and not the software products we make.

I agree with this but sadly sometimes we struggle in being a nice community to live in.

There's a few things I think we can improve:
  • Being better 'winners': We are a big community, at some point we have to take community-wide decisions, and it's impossible we will all agree on something. If you are part of the 'winning' group, be gentle with the people that 'lost', sure you think you are right, but they think the same and think the rest is doing a terrible mistake, so when you talk with them be polite and point out that the majority is going in the other direction, but that you still appreciate all the other stuff they do, etc. They already 'lost' so there's no need to put their head under your foot and do an evil laugh.
  • Being better 'losers': We are a big community, at some point we have to take community-wide decisions, and it's impossible we will all agree on something. If you are part of the 'losing' group, be accepting that you 'lost' and try to carry on with the amazing work you do in other areas. Sure you are allowed to some venting, but it should be all within the limits of not trying to drag the discussion forever and not trying to destroy the project just because you disagree in one decision, so yes, you're allowed to some small complaining but understand that the majority decided different than what you think it's better, accept it and carry on, you'll be happier :)
  • Assuming good by default: If a sentence can be read in two ways, do not assume it was said in the worse way, assume it was said in the good. Will help keeping the discussion sane and constructive.
  • Not workarounding by default: If you find a bug or shortcoming in kdelibs, KF5, Qt or any other library, don't workaround it by default, please report it to the library people and try to work with them to fix it. Library code is not that hard and if you fix it in the source, everyone will benefit from the fix, not just the users of your software because you workarounded it and kept quiet about it to upper layers.
  • Not caring enough for the global: We produce zillions of different projects of software. It's almost impossible to have a global overview of "what the bad bugs are", so if you know there is a bug that is bad, and it's affecting quite a bit of people, don't say "someone else will fix it" and ignore it, share it with the wider community and if the current maintainers are missing or overworked I'm pretty sure we can find someone to have a look and fix that bug that is making people sad.

This doesn't happen all the time, but it happens more than I would like, so I'm just raising it up so that people think about it and try to improve :)

Of course I'm not saying I'm not guilty of the things I mentioned, but as the wise-man said: "Don't do what i do, do what i say"

Wednesday, May 14, 2014

Web developer: Help KDE with a few hours of work

At KDE we're trying to get people to donate more (I hope I don't have to explain to this audience why), one of the ideas floating around is adding a small "impulse donate" button to kde.org similar to the one at http://www.videolan.org/ (only with euros and without a "why?" link for now)

I'm not a web devel by far (though have done my fair share of copy&pasting php, html and css for KDE and other personal projects) but I understand it should not be "that hard"™, it would be basically doing some modifications of the kde.org sources, the capacity framework and doing some reuse of the existing paypal donation page code.

Anyone up for the work? If so, please contact me!

Tuesday, May 06, 2014

Commit your approved Review Requests!

By looking at KDE git Review Board I realize we have over 4 pages of "ship it"-ed review requests that are still marked as not commited.

This is nuts!

I know some of them are still work in progress (yes, it sucks that reviewboard does not let you "unship it" when you find something wrong or when some newbie mistakenly gives himself a +1) but I am pretty sure at least 3 of those 4 pages are stuff that was coded, reviewed, approved and then no one committed it :/

So please go through your reviewboard changes and commit them, or ping the maintainer of the app if you don't have commit rights (and if the maintainer is unresponsive for some reason and it's obvious you had his "Ship it" just come to me and I'll commit it for you).

Wednesday, April 16, 2014

KDE Applications 4.13 released

Today we've released 4.13 which is probably the best KDE Applications release ever :)

It also marks the second release we do with a four months schedule instead of a six month one. I think we've ended up with a pretty nice cadence in which we are faster delivering features and bugfixes to users, which at the end is what is important, since the earlier people get the features the earlier they'll find the bugs (let's accept it, all software has bugs) and the earlier the bugs are found the earlier they can be fixed. So basically it's faster progress :)

We have also made good our promise to keep our tests passing, as you can see everything from this release is green (kde-workspace is not green but is not part of the 4.13 release). So kudos to all developers for being awesome in that regard too.

Let's all celebrate on this release but not forget we need to keep working full steam ahead on the releases of KDE Frameworks 5, Plasma 2014.06 and KDE Applications 4.14.

Finally I'd like to remind you that most of the people doing KDE development are volunteers and they invest their time in making this awesome software for you to use for free.

Lots of them even spend time to travel abroad to meet each other in Sprints were they do concentrated hacking for a few days, so if you appreciate the work they do in those Sprints please donate some money so we can actually help them travel and we can make more Sprints happen :-) http://www.kde.org/community/donations/

As anecdote, I had the pleasure of meeting the guys from the KTP Sprint this Friday and after dinner they went back to hacking instead of joining some of us for some beers. That is dedication!

Tuesday, March 25, 2014

ASAN and libraries (2nd part)

In ASAN and libraries I claimed you didn't need to compile a library with -fsanitize=address to get ASAN to work over it. Well it turns out that is only true in some cases and in some others like the one in this example you actually need it. So here comes a different example and the differences of using -fsanitize=address and not in the library code.

shared.cpp
#include "shared.h"

Foo::Foo()
{
int a[1];
a[2] = 3;
}



shared.h
class Foo
{
public:
Foo();
};



main.cpp
#include "shared.h"

int main(int, char **)
{
Foo f;
return 0;
}

Let's see what happens if we do
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
export ASAN_OPTIONS=symbolize=1
g++ -Wl,--no-undefined -shared -o libshared.so shared.cpp -g3
g++ -fno-omit-frame-pointer -fsanitize=address main.cpp -lshared -L . -g3
LD_LIBRARY_PATH=. ./a.out
As the suggested in the previous blog entry.

Nothing, no error detected.

But if we change to
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
export ASAN_OPTIONS=symbolize=1
g++ -fno-omit-frame-pointer -fsanitize=address -Wl,--no-undefined \
    -shared -o libshared.so shared.cpp -g3 -lasan -fPIC
g++ -fno-omit-frame-pointer -fsanitize=address main.cpp -lshared -L . -g3
LD_LIBRARY_PATH=. ./a.out

==13069== ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffe74fafa8
at pc 0x7fb0ef71f792 bp 0x7fffe74faf60 sp 0x7fffe74faf58
WRITE of size 4 at 0x7fffe74fafa8 thread T0
    #0 0x7fb0ef71f791 in Foo::Foo() /home/tsdgeos/test/shared.cpp:6
    #1 0x40074a in main /home/tsdgeos/test/main.cpp:5
    #2 0x7fb0ef37aec4 (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
    #3 0x400638 in _start (/home/tsdgeos/test/a.out+0x400638)
Address 0x7fffe74fafa8 is located at offset 40 in frame <__base_ctor> of T0's stack:

Boom! We get the error :-) So my conclusion that ASAN wasn't needed on libraries was bad. You need it. Thanks Zecke for pointing me to my wrongness :-)