user-avatar
Today is Tuesday
May 22, 2012

Category: Gentoo

November 10, 2009

Wonders from a KDE fan and developer about some KDE design choices

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , 43 Comments

Technologies going forward..

Twenty years ago, I was reading some books about Unix at the local library. By the time, it was really difficult for me to see, touch, or test an actual unix system and reading books was the closest I could get.

I remember that among the numerous very good ideas ™ in this system, one totally buzzed me : processes and memory protection. A piece of software was protected from other pieces. If one crahes, the other ones could still keep on doing their stuff. Amazing feature, isn’t it ??

Years later, and until very recently, I could proudly say to my friends: “I use linux, I don’t have such problems that you have in Windows and MacOS”. Well, of course, now at least MacOS is based on a serious kernel and the Windows kernel is far better in this regard. But still, unix has had it for very long, and among them, my favourite Unix : Linux.

… forward …

And then, people started to talk about plasma. It is cool, it is great, it is beautiful. One of the reasons I like KDE so much, is that I am very happy with the technology choices made by the project over the time (do you remember the drop of CORBA ?). I’m not into buzz and fancy desktop, so I did not pay much attention to plasma at the beginning. Later on,  I started to try KDE trunk again. For months, it was about: compile, start, wait few seconds, plasma crashed, and the whole desktop/X session restarted.

Then, it got better : plasma crashing would not make the whole session crash, and plasma would handle its own crashes gracefully by restarting. Trust me, I really like KDE, but I could NOT resist to think “Hey, they now handle crashes as well as MS Word do!, great job!”. Well, of course, It was still pre-alpha times, you are not supposed to expect more at this time.

.. and backward

Still some months pass by, and came the beta time. I could finally get into KDE and plasma would not crash on startup. So I tried this new plasmoid thinguy. I added few plasmoids, played with them, even configured some. I tried to add a new one… and WLANG, suddently the whole thing crashed.

Do you see my point ? One of the plasmoids made the whole plasma thing crash. We are back 30 years ahead in time. End of process separation and memory protection. Back to the “don’t try to touch anything, it WORKS, don’t disturb it” and “I do not dare trying this new cool stuff because it could crash it all”.

Design

This sounded weird. Really, really weird. I wondered, and learned that indeed plasma was only one process. It seemed to me like a very bad design choice, but I do not know much about all of this, so I just kept my faith in KDE and did not worry too much. I don’t know anything about internals. I talked to a few people, on IRC, in real life… but nobody seems concerned. Nothing about that on the FAQ, not even on the (short) architecture documentation.

As time goes by, people put almost anything into plasma. I mean it : anything. Developers and users for once seem to agree, and everybody is happy. I still do not really understand the need to put a browser in a plasmoid, but if people enjoy that, I don’t have a problem with this. Free software is all about fun, isn’t it ?

After I updated to KDE 4.2.1, I’ve spent one hour to fix it, finally removing the plasma configuration files to get a usable system. I did not look further, but I guess I could have removed only one part of one file, or maybe even just remove a faulty plasmoid.

I don’t mind the hour I’ve spent… but I worry about the design of plasma. I do not dare asking plasma people, as it seems so.. deeply obvious. They MUST have thought about it, mustn’t they ?

A trend in KDE ?

Today I had to kill one of my konsole because one of the software I’m working on was eating all the memory. I used the great CTRL-ALT-ESCAPE kill feature and that saved my computer. Once recovered, I was really surprised to see that all my konsoles were dead. “ps” could confirm this. I usually have 4 or 5 konsoles with 5 or 6 tabs each. Lot of opened vi inside and so on. A doubt came to me and i started several new konsole, and then issued a “ps aux | grep konsole”. You’ve guessed it, only one was present. I rushed on konsole source code and konsole/src/main.cpp confirmed my fears : konsole uses only one process on purpose, through the use of KUniqueApplication.

I don’t understand and I’m sad about this.

Conclusion

Don’t get me wrong , I still think that a lot of things are still done right in plasma (and KDE in general): separation between data and views (nothing new, but still a great thing to do), packaging (though it’s not done yet, I like the ideas). And it looks darn good, that’s right, too.

I just feel very uncomfortable with this. This is the first time ever in more than 10 years  that I am not happy with a KDE design choice, and a blog post looked like a great way to release this embarassment. As usual I’m afraid that people will read this post lightly, will feel insulted, and will answer with even more insults.

July 27, 2009

Installing an avr cross compiler in gentoo

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

One could think that this is as easy as

crossdev avr

but it is not, so i write here how I did it for future reference, and hopefully this will also be useful to other people.

The first problem is that it does not check compatibility between toolchain members (binutils, gcc, …). Understandably, this is somehow difficult, and i don’t blame crossdev. The second problem is that by default crossdev install headers, which are needed  for libc, which is needed for gcc… and headers requires gcc… so you have a loop and if fails.

Finally, i needed the c++ part, and by default crossdev only go as far as stage 3 (plain C), so i’m asking him to go farther with ‘-s4′

Finally i did:
sudo crossdev --b 2.19.51.0.8 --g 4.4.1 --without-headers --target avr -s4

June 15, 2009

tags displayed in hg activity extension

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , 2 Comments

Today i have added a feature to my hg activity extension. I have wanted to have this for long : the tags are now displayed on the graph. Here are two examples, one of the project itself, and another one on the mercurial repository, but only  for the last months.

The first one was generated by:

hg activity --splitauthors --maxauthors 5 --width 1500 --height 900

hgactivity

And the second one by:

 hg activity --datemin 2008-01-01 --splitauthors --maxauthors 5 --width 1500 --height 900

mercurial

May 7, 2009

mercurial and ipv6

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

Today I needed to use mercurial over IPv6 in order to share a repository which is on a computer behind an (ipv4) firewall, but that can be reached over ipv6.

The naive

  • hg clone ssh://orzel@ipv6computername/hg/dir
  • hg clone ssh://orzel@[ipv6::address]/hg/dir

miserably failed. But i was hinted on IRC (thanks ‘Ry4an’ !) on how to do this, and thought I should share this knowledge until mercurial get better ipv6 support.

First for the clone call, do

hg --config ui.ssh='ssh -6' clone ssh://orzel@ipv6computername

then you will not be able to push/pull until you add to the repository .hg/hgrc the lines:

[ui]
ssh=ssh -6

Enjoy mercurial on IPv6 :-)

March 10, 2009

Fixing qmake missing rule for *.ts -> *.qm

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , 9 Comments

We are used to polished and great tools from the trolls, but qmake has always been the big exception to this: ugly documentation, lot of undocumented tricks, and missing features.

For me the biggest one was that it would not automatically create the rule to transform *.ts to *.qm in the generated Makefile. I have been trying for very long to fix this problem. This is especially a shame because this is Qt’s very own translation stuff, and qmake should really knows about it.

Today, thanks to ‘luks’ on #qt, I know have the solution, and I think it’s really worth a blog entry, for my own record, and to help all those having the same problem. : put this in a file updateqm.pri and include it from your *pro(s).

isEmpty(QMAKE_LRELEASE) {
    win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
    else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
}
updateqm.input = TRANSLATIONS
updateqm.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += updateqm
PRE_TARGETDEPS += compiler_updateqm_make_all

March 6, 2009

updating to KDE 4.2.1 : delete your plasma files (again)

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: 14 Comments

Thanks to the great work of the gentoo KDE packaging team, I have been able to update to KDE 4.2.1 yesterday. And since then, a couple of processes  suck up all my CPUs.

The first one is a well-known issue : lancelot does that when used with Qt 4.5. Ok, this one was quick to remove.

The second one is plasma. Somehow I was not really surprised : it often happens. I usually first blame gentoo for that, and I’ve tried to re-install a few things in order to fix it (like emerge @preserved-ebuilds, and so on…). But actually, that was not the problem. On #gentoo-kde, some other people seem to have either this very same problem, or worse (crashes). Removing your ~/.kde4.2 directory is said to help. That’s too much a loss for me so I have spent a little time to narrow the solution a bit.

And finally the solution is to remove only share/config/plasma*. How come did I not first think about it ?

So if you have the same problem, hopefully now you know how to fix it.

March 5, 2009

Support for ‘long double’ in Qt tests.

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , 3 Comments

Qt supports most types for most compilers…… but long double.  I do not know why. When asking on #qt (IRC), people say that nobody seems to care. Well… I do. long double have some use in scientific software at least. If you ever need to use long double in QTest, you will need to add this somewhere in some of your headers used by unit tests.

This is tested with Qt 4.4.2 and 4.5, on linux(gcc 4.3.3) and windows (mingw/gcc 3.4.5).

Once you have this code, you can do things like QCOMPARE() between long double and so on.

namespace QTest {

    template <>

    inline char *toString<long double>(const long double &t)

    {

        char *msg = new char[128];

        ::snprintf(msg, 128, "%.123Lg", t);

        return msg;

    }

    static inline bool qFuzzyCompare(long double p1, long double p2)

    {

        return (qAbs(p1 - p2) <= 0.00000000000001 * qMin(qAbs(p1), qAbs(p2)));

    }

    template <>

    inline bool Q_TESTLIB_EXPORT qCompare<long double>(long double const &t1,

            long double const &t2, const char *actual, const char *expected, const char *file, int line)

    {

        return qFuzzyCompare(t1, t2)

            ? compare_helper(true, "COMPARE()", file, line)

            : compare_helper(false, "Compared long doubles are not the same (fuzzy compare)",

                    toString(t1), toString(t2), actual, expected, file, line);

    }

}

February 21, 2009

Quest for gdc in gentoo

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: Leave a comment

It took me quite some time (and some grep) to find out how to install gdc on gentoo, so here is the answer for those facing the same problem.

gdc is a gcc font-end for the D language, which has some advantages over other ones like dmd, but don’t ask which. (something like ‘support for 64-bit’).

If you google for it, you will either find an old bug (2004) with some gdc ebuilds, or some people telling you that it’s enough to emerge gcc with the ‘d’ USE flag. Fair enough : I try, and it fails.

The reason is that without telling you, this will only work with gcc-4.1.2, I don’t why. Anyway, the following did manage to install it:

USE=”d” emerge -vta =sys-devel/gcc-4.1.2

Even this way, the build fails with some error mentionning ‘D’ and some gcc 4.3.3 symbols (4.3.3 is my current gcc). The real solution was to FIRST emerge gcc-4.1.2 without D support, and then again with D support.

Update: moreover, once installed, you cannot switch back (using gcc-config) gcc4.3.3, as ‘gdc’ will not be available at the command line anymore. As a conclusion, I’m happy not to program in D seeing the very bad support from Gentoo :-(

February 12, 2009

First release candidate for Opale

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , Leave a comment

One of my pet projects (A simple bank account manager focused on graphs and planning) is about to reach 1.0. This first release candidate has been tested on several Linux systems and Windows. It can compile against KDE, but Qt is enough. (no, i have not yet tested with KDE/Windows…).

So far, the only big problem with this RC is that translations are broken. This will be fixed in -rc2, to be released soon.

By the way, I could use some help with:

  • getting a logo
  • translations
  • writing an ebuild for gentoo
  • compilation/tests on MacOS X
  • compilation using msvc on Windows

If you feel like you could help me, please contact me.

November 14, 2008

Mercurial bulk update

by Thomas Capricelli — Categories: Admin, Gentoo, KDE — Tags: 6 Comments

I don’t know about you, but I have on a lot of different places a directory called ‘hg’ with lot of different mercurial clones inside. Whether on the home of my several computers for my own projects, or inside other directories for external projects, and so on.

Now, remember one important aspect of distributed source control : your clone is actually both a repository and a working directory. This is why you usually (git and others do the same) have two different commands : one to synchronize the  repository (pull) and one to update the working directory (update).

Updating comes with a risk : you can have conflicts. This is why I never update a svn repository without thinking first (do I have local modifications ?). But pulling is a lot less problematic. And, especially on my laptop, I often want to ‘sync them all’ as soon as I have some internet connection. Until now i had a script syncall with the path of all (svn,unison and) mercurial repositories hardcoded. This does not scale, and I now need that in at least 5 different places. I dont feel like maintaining such scripts.

And now comes the magic alias that made my day. I’m usually lame at shell scripting, so I’m sure there are better ways. But it works, now, on my computer. And this is so useful.

alias hgbulk '\ls */.hg -d | cut -d\/ -f1 | xargs -i bash -c  "(cd {}; hg pull )"'

(yes, I use tcsh, but i’ve tested that in bash too. Don’t ask why I use tcsh.)

© 2012 Thomas Capricelli All rights reserved - Wallow theme v0.46.5 by ([][]) TwoBeers - Powered by WordPress - Have fun!