Skip to content


Non-recursive automake

A while back, I was toying with the idea of adding gcov support to libgdata, to give metrics on the code coverage of the test suite. I played around with adding it, but my attempts were thwarted by the fact that I couldn’t easily get a list of all C files which were to be compiled, in all source directories, to use in the top-level Makefile.

I recently found a little time to work on this some more and, as usually happens, it ballooned into something bigger, and I ended up redoing the entire build system for libgdata. It now uses non-recursive automake, which makes things a lot simpler in many respects. The diffstat was favourable (“21 files changed, 641 insertions(+), 833 deletions(-)”), and it has made the autogen/clean/build cycle about 20 seconds faster (on average, from some very rough tests). Accomplishing this was largely possible due to the (fairly) recent literature on the subject from Murray Cumming and Daniel Elstner, which proved rather useful; so many thanks to them.

As a result of all this, I now know that only just over 50% of libgdata’s code was actually being exercised before by the test suite. I’ve now pushed this up to 60%, and uncovered a few buglets in the process. I dread to think what other problems lie in the remaining 40%; there’s certainly lots of work left to be done.

Anyway, since all the snippets of automake magic I could find were subtly incompatible with non-recursive automake, I ended up with a slightly different one (based on gobject-introspection’s gcov support). Hopefully it’s useful to someone, though it could probably do with some tidying up:

if GCOV_ENABLED
gcov-report.txt: gcov-clean all check
	$(AM_V_GEN)(rm -f $@; \
	echo -e "Test coverage for libgdata:\n" >> $@; \
	total_covered=0; total_actual=0; \
	for file in $(filter %.c,$(gdata_libgdata_la_SOURCES)); do \
	  file2=<img src="http://tecnocode.co.uk/wp-content/cache/tex_5b43d20d47d246a4680408f29847a0bd.png" class="tex" alt="{file##*/}; \
	  cd $(abs_srcdir)/" />{file%/*}; \
	  gcov -o `find -newer <img src="http://tecnocode.co.uk/wp-content/cache/tex_c305e55754b41014ba478d150327b8f8.png" class="tex" alt="file2 -name &quot;*-" />{file2/.c/.gcda}&quot; -print0 | sed -e 's/\.gcda/\.o/'` <img src="http://tecnocode.co.uk/wp-content/cache/tex_ac7d7d6aec88d938586455487b5c7f63.png" class="tex" alt="file2 &gt; /dev/null; \
	  if test -f " />file2.gcov; then \
	    actual=`grep -v '        -:' <img src="http://tecnocode.co.uk/wp-content/cache/tex_6d68b3f5e0449d2de6fb926f43fc3051.png" class="tex" alt="file2.gcov  | wc -l`; \
	    uncovered=`grep '#####:' " />file2.gcov | wc -l`; \
	    covered=<img src="http://tecnocode.co.uk/wp-content/cache/tex_52fdc3dd188ffe6847ad9b87216e4754.png" class="tex" alt="((actual - uncovered)); \
	    total_covered=" />((total_covered + covered)); \
	    total_actual=<img src="http://tecnocode.co.uk/wp-content/cache/tex_b1877f671216e62580fcca89d4c0aeb5.png" class="tex" alt="((total_actual + actual)); \
	    echo -e &quot;" />file:\t<img src="http://tecnocode.co.uk/wp-content/cache/tex_f992080d4cd0457d0915c0bacf7a461b.png" class="tex" alt="covered / " />actual\t(<img src="http://tecnocode.co.uk/wp-content/cache/tex_ea22576e6972c53ed46c97426f82ea52.png" class="tex" alt="(((" />covered * 100) / <img src="http://tecnocode.co.uk/wp-content/cache/tex_86c3048c1ebd7d52bf1a3fe2339917e4.png" class="tex" alt="actual))%)&quot;; \
	  fi \
	done &gt;&gt; $@; \
	cd $(abs_srcdir); \
	echo -e &quot;\nSource lines: " />total_actual\nCovered statements: <img src="http://tecnocode.co.uk/wp-content/cache/tex_7adb937a093a5f806c2ff23104e6097e.png" class="tex" alt="total_covered\nTotal coverage: " />(((<img src="http://tecnocode.co.uk/wp-content/cache/tex_d58616f586dbc63f3f3d9264640881d1.png" class="tex" alt="total_covered * 100) / " />total_actual))%&quot; &gt;&gt; $@)

gcov: gcov-report.txt
	@cat gcov-report.txt

clean: gcov-clean
gcov-clean:
	@find . -name &quot;*.gcda&quot; -o -name &quot;*.gcov&quot; -delete

MAINTAINERCLEANFILES += gcov-report.txt

.PHONY: gcov gcov-clean gcov-report.txt
else
gcov:
	@echo &quot;Need to reconfigure with --enable-gcov&quot;
endif

It will output a code coverage report of the test suite (`make check`) when `make gcov` is called, and will also save it as “gcov-report.txt” in the root source directory.

Posted in GNOME.

Tagged with , , .


Introspectable libgdata

Now that full term at university has finished, I have a little free time (inbetween sleeping, doing all the holiday work, and that celebration thing that people seem to do) to spend on projects. Today, I got round to adding GObject introspection support to libgdata. I think some of the Makefile changes I made were a little hacky, but they seem to work. If anyone wants to use libgdata from an interpreted language which has GIR support, it should now be possible.

In university news, things have gone well this term, and I managed to (precariously) stay on top of the rolling mountain of work. I’ve now got two weeks’ stay in Cambridge to help shepherd interviewees around for their application interviews before I go home and do Christmassy things.

It took me until about half way through the term to notice that I was actually walking past Collabora’s UK office every morning (opposite King’s College). It was quite a shock when I noticed. It was also a shock to see they weren’t at the computer lab’s recent careers fair. Perhaps missing a trick there?

Posted in GNOME, General.

Tagged with , , , .


Unicode in GNOME

This is something I’ve been meaning to write about for a while and, I must admit, something I should have written about before I started pushing through changes in GNOME applications. I’m talking about the use of Unicode in GNOME: the use of the proper ellipsis character (“…”), proper en- and em-dashes (“–” and “—”, respectively) and fancy quotation marks.

This is something which has been brought up before, so I’ll try not to reignite the old arguments, and instead concentrate on the unresolved issues. Here are the main points:

  • Proper Unicode characters look nicer than the ASCII versions which substitute for them. The ellipsis is correctly spaced (if one were to use full stops instead, they should technically have non-breaking spaces between them), and the quotation marks are pleasantly curved. This looks nicer, to my eye at least. The difference between en- and em-dashes and the ASCII hyphens used to simulate them is considerable.
  • They’re harder to type on a conventional keyboard, though are easily accessible through the use of the compose key.
  • There are questions about the level of font support for such characters. On my Fedora 11 system, all the fonts except one (“PakTypeTehreer”) have the expected characters (ellipsis, dashes and quotation marks) at the right codepoints, although many of the glyphs are ugly and unloved (e.g. in Hershey and Khmer). DejaVu and Bitstream have excellent support for these characters. There is a suggestion that Pango should be extended to support decomposing the Unicode characters into their ASCII equivalents if a font doesn’t support them.
  • There was confusion over what exactly was allowed in source code, and whether UTF-8 characters were allowed in C-locale strings (regardless of their representation in source code). It was decided that they were, but that the most portable way to represent them in C was to use octal slash escaping (e.g. “\342\200\246” instead of “…”). We’ve had Unicode characters in source code since GNOME 2.22, and (apparently) there have been no bug reports on the matter, but there was no conclusive answer about how embedded C compilers (and other, less well-known compilers) cope with such things.

Obviously, I’m thoroughly in the pro-Unicode camp. I believe it would make our desktop look more professional, and improve legibility of the interface in places. I’ve spoken to Calum Benson of HIG fame and he has no particular objections to mandating use of the appropriate Unicode characters by the HIG.

In the meantime, I’ve been filing bugs against applications to convert them to using proper Unicode characters; this probably wasn’t the best way to go about things, but at least it is a move in the right direction (in my view anyway). Unfortunately, this has come at the cost of inconsistency in the desktop. Most of the changes have been applied after branching for gnome-2-28, however, so if we can work out some guidelines about use of Unicode characters early in the 2.30 cycle (i.e. now), consistency could be maintained in the desktop for the 2.30 release. We might even be able to brag about nice typography for (dare I say it?) GNOME 3.0!

So, should we be expending effort on dealing with fonts which don’t support various Unicode characters, extending Pango to support the appropriate decompositions? Are there any problems with embedded C compilers and Unicode string literals? If we decide to go with a uniform usage of certain Unicode characters, what guidelines shall we go with, and how can we educate translators in how to type them?

Sources:

Posted in GNOME.

Tagged with , , .


University happenings

One of the lovely Austrian trains.

One of the lovely Austrian trains.

It’s the end of a busy summer and I’ve just stumbled over the finishing line with some (very) late patches to Totem for the 2.28 release. Let’s hope it’s a good one.

This horrendous timing on my behalf for getting around to doing these patches is mainly due to tacking an InterRail trip onto the end of my busiest summer ever. Ten days travelling around sunny Europe with friends went surprisingly well, with only one person attempting to rob us. The highlight of the trip had to be the Austrian train system: easily the best out of the ones we used (French, German, Austrian, Dutch and Belgian). Photos of the trip are up on my PicasaWeb account.

And now for something completely different: university! I’ve got just under two weeks left before I leave to start my BA in computer science at Gonville and Caius college, Cambridge. The pile of stuff to take with me is starting to grow, all my computers are reinstalled with Fedora (which should hopefully last for three years without needing too much time spent on keeping it going), and most of my former schoolmates have already left for their respective universities.

I don’t know how much time I’ll have for GNOME stuff — I’ll have to see how the workload is when I get there. It is, however, at the top of my free time priority list, along with learning all the funny language Cambridge has for things, punting, debating and drinking Pimm’s. OK, I was kidding about the last three.

Posted in General.

Tagged with , , .


Red Hat and Bloodstock

Nibbs Carter of Saxon.

Nibbs Carter of Saxon.


Just over a week ago, I finished my month’s work experience at Red Hat UK, and I’m pleased to say it went well. I learnt lots about how Red Hat works, dived into the kernel for the first time (and worked on some kernel patches!), got an RHCT qualification, and generally had a good time with our resident frockney. Hopefully he’s managed to clean his house up sufficiently after my departure.

Woo! Poster!

Woo! Poster!


The reason for leaving Red Hat mid-week is so that I could go to Bloodstock! It was a brilliant weekend, with the highlights being Die Apokalyptischen Reiter, Saxon, Satyricon, Turisas and Amon Amarth. Photos are up on PicasaWeb.

While sorting out the photos of Bloodstock, I also went through all the photos I took while in Gran Canaria for GCDS, so they’re also now up on PicasaWeb.

Posted in General.

Tagged with , , .


Reviewing and applying a patch

I’ve been fortunate enough to have been reviewing a lot of patches recently. Fortunate, because it means other people are contributing to my library. However, few of these contributions are without their problems; as with all contributions, each patch generally goes through two or three iterations before I think it’s near enough to being ready that it’s easier for me to apply the patch than it is to comment on it and request an updated version.

Generally, when patches get to this stage, it’s just the really small, nitpicky things which are still wrong. Rogue whitespace, quirky indentation, typos in documentation…these are all really minor things, but they take time to check through and correct. One of the latest libgdata patches was, I think, a bit of a rushed job; and so there were more of these niggly problems than usual. Instead of going through and fixing all the problems and never giving detailed feedback about them to the patch contributor – as is usually the way, since the changes are so trivial, albeit cumulatively not inconsiderate – I decided to make a screencast of the process I go through when reviewing a patch.

Reviewing and applying a patch

It’s about half an hour long, unscripted and unedited, so there are a couple of mistakes and omissions in there (for example, I later noticed I’d forgotten to mention the lack of input validation on the new function). However, I think it’s quite comprehensive. It’s aimed at those who are getting used to the open-source patch submission and development process, though those more talented than me welcome to watch it and lambast me for not using Emacs. Hopefully it’s useful to someone, anyway. It’s licenced under cc-by-sa 2.0.

Posted in GNOME, Tutorials.

Tagged with , , .


libgdata 0.4.0 released

This blog seems to be an endless stream of release announcements, which is unfortunate. Here’s another one!

libgdata 0.4.0 has just been released. This release brings support for PicasaWeb and Google Documents, courtesy of Richard Schwarting and Thibault Saunier, respectively. The core API is slowing tending towards becoming stable, and the changes to the core API in this release should (hopefully) be the last really disruptive ones.

In a desparate attempt to make this post more than just a release announcement, here’s a little update on my work experience with Red Hat. Things are going well; I’ve spent a while doing hardware testing, and I’m now doing some code review in anticipation of being given something else interesting to do tomorrow.

Posted in GNOME, General.

Tagged with , .


Back from GCDS

With GCDS winding down on Friday, I made my way home on Saturday (again, courtesy of those nice people at the GNOME Foundation), and got back sometime late in the evening, thankfully without Iberia-caused delays. The conference was good, and it was great to meet more of those interesting people from all over the planet. I even managed to get some work done, with Thibault Saunier’s Google Documents branch for libgdata landing in master sometime in the next few days.

Next up: four weeks of work experience at Red Hat UK. I’m currently occupying some stranger’s house in a foreign part of the country, ready for my first day in Farnborough tomorrow. Should be fun.

Posted in GNOME, General.

Tagged with , .


Rogues’ gallery

So far in my travels, I have met, for the first time, many gnomeshackers. One of the people I met was Tim-Philipp Müller and… Two of the people I’ve met were Tim-Philipp Müller, Matthew Garrett and Lennart Poettering… Amongst the many people I’ve met are such (in)famous hackers as: Vincent Untz, Alexander Larsson, Germán Póo Caamaño, Tim-Philipp Müller, Lennart Poettering, Matthew Garrett…

The truth is, there are too many people to name (and listing more would just destroy the joke). The conference is going great, apart from a minor incident with some snails, and I’ve enjoyed the talks I’ve been to so far.

Somehow, miraculously, my lightning talk on libgdata (slides) went OK (as far as I was concerned), and it even resulted in someone coming and talking to me about libgdata. How brilliant is that?

Still, my littlebig library pales in comparison to some of the interesting things which are being shown off at GCDS. Here’s to GNOME 3.0!

Posted in GNOME.

Tagged with , , , .


Gran Canaria!

Here I am, somehow successfully arrived in Gran Canaria, despite Iberia’s best efforts. My first plane was delayed not quite long enough to give me hope that I’d catch my connection, but just too long for me to do so comfortably. Thankfully, the second plane was also delayed, so my running down the entire length of Madrid’s Terminal 4 was somewhat unnecessary.

A GNOME Foundation sponsorship badge.

A GNOME Foundation sponsorship badge.

How am I here? I’m only here because of the nice people at the GNOME Foundation, who decided to sponsor me. Thank you, nice people!

Posted in GNOME.

Tagged with , .