<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Flameeyes's Weblog</title>
    <link>http://blog.flameeyes.eu</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Proud to be European</description>
    <item>
      <title>Blast from the recent past; two years ago</title>
      <description>&lt;p&gt;Today I was feeling somewhat blue, mostly because I&amp;#8217;m demotivated to do most stuff, and I wanted to see what it was like to work in Gentoo two years ago.&lt;/p&gt;


	&lt;p&gt;One thing I read is that a little shy of exactly two years ago, &lt;a href="http://blog.flameeyes.eu/articles/2006/07/11/problems-with-kopete-and-icq"&gt;&lt;span class="caps"&gt;ICQ&lt;/span&gt; broke Kopete&lt;/a&gt;, just like they did yesterday. Interestingly enough, even though a workaround has been found for Kopete 0.12 (the one shipped with &lt;span class="caps"&gt;KDE 3&lt;/span&gt;.5), there is no bump I see in the tree this time. Sign that the &lt;span class="caps"&gt;KDE&lt;/span&gt; support in Gentoo has changed, most likely.&lt;/p&gt;


	&lt;p&gt;There is also the whole thing with &lt;span class="caps"&gt;ALSA&lt;/span&gt; problems, which span so many posts that it&amp;#8217;s not worth listing all them. The current &lt;span class="caps"&gt;ALSA&lt;/span&gt; maintainer simply gave up on providing something that, at least for some users, ended up being quite important.&lt;/p&gt;


	&lt;p&gt;And all the work on Gentoo/FreeBSD! Although Javier is doing a huge work now to support FreeBSD 7.0, he&amp;#8217;s not prone to blog about it, and you can see that Gentoo/FreeBSD is easily ending up in the &amp;#8220;historical&amp;#8221; memory, rather than being discussed and tried out by users daily.&lt;/p&gt;


	&lt;p&gt;What didn&amp;#8217;t change at all is my insomnia, it&amp;#8217;s almost 2AM and I&amp;#8217;m still up. And this time I don&amp;#8217;t even have &lt;a href="http://en.wikipedia.org/wiki/Antiques_Roadshow"&gt;Antiques Roadshow&lt;/a&gt; to watch. I&amp;#8217;m currently working on xine, just like two years ago.&lt;/p&gt;


	&lt;p&gt;In general, I think a lot of areas in Gentoo did go downhill from two years ago, rather than improving. While Portage is certainly improved, thanks to Zac, Genone and the rest of the team, and we can see that in the new extended repoman checks, that also helps QA. But the general user support seems, to me, lacking.&lt;/p&gt;


	&lt;p&gt;This is a direct consequence, in my opinion, of leaving open doors for people who are just driving Gentoo&amp;#8217;s energy away, by taking over projects to make them stall, by discussing details over and over and over, by repeating the same request even when people reject it as it stands, and so on.&lt;/p&gt;


	&lt;p&gt;I hope things will improve in the next months, thanks to a new council that can finally grow some balls, straightening up the situation, but if this does not happen, I&amp;#8217;m already preparing for my plan B&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Wed, 02 Jul 2008 23:36:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b336a183-ab8e-4ca5-8c8e-020d9a50bbc6</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/07/02/blast-from-the-recent-past-two-years-ago</link>
      <comments>http://blog.flameeyes.eu/articles/2008/07/02/blast-from-the-recent-past-two-years-ago#comments</comments>
      <category>Gentoo</category>
      <category>Personal</category>
      <category>English</category>
      <category>FreeBSD</category>
      <category>ALSA</category>
      <category>KDE</category>
      <category>Kopete</category>
      <category>ICQ</category>
      <category>GentooFreeBSD</category>
      <category>Past</category>
    </item>
    <item>
      <title>Again about .la files (or why should they be killed off sooner rather than later)</title>
      <description>&lt;p&gt;I&amp;#8217;ve been working as an experiment on rewriting &lt;code&gt;xclip&lt;/code&gt; to use &lt;a href="http://xcb.freedesktop.org/"&gt;&lt;span class="caps"&gt;XCB&lt;/span&gt;&lt;/a&gt; rather than Xlib. This is mostly because I always have been interested in &lt;span class="caps"&gt;XCB&lt;/span&gt; but I never had time to learn the internals too much.&lt;/p&gt;


	&lt;p&gt;To make my task easier I ended up using some funcitons that are not available in the currently-released version of xcb-util, the side-package of &lt;span class="caps"&gt;XCB&lt;/span&gt; that contains some higher-level functions that make it easier to replace Xlib.&lt;/p&gt;


	&lt;p&gt;Beside the fact that xcb-util still haven&amp;#8217;t bumped its version, which makes it impossible to check for the right version with pkg-config, there is one interesting point in using the latest available version through the x11 overlay.&lt;/p&gt;


	&lt;p&gt;Letting alone some problems with being able to actually fetch and install the packages I need (Donnie, I&amp;#8217;ll send you the patches later if I can polish them a bit), over the actual &lt;span class="caps"&gt;GIT&lt;/span&gt; tree there are a few patches applied, coming from Jamey Sharp (an &lt;span class="caps"&gt;XCB&lt;/span&gt; developer) from March 2008. These remove one library (libxcb-xlib) and change the locking method used to make Xlib use the same socket as &lt;span class="caps"&gt;XCB&lt;/span&gt;. These changes not only break &lt;span class="caps"&gt;ABI&lt;/span&gt; (without changing the soname, alas!) but also make it impossible to build the old libX11 against the new libxcb. Using the live version of libX11 (that is also patched to use the new hand-out mechanism) fixes this problem, but the result is a way bigger trouble.&lt;/p&gt;


	&lt;p&gt;First of all, this is a perfectly good example of &lt;a href="http://blog.flameeyes.eu/articles/2008/06/30/a-few-risks-i-see-related-to-the-new-portage-2-2-preserve-libs-behaviour"&gt;what I said about preserve-libs&lt;/a&gt;. If you are not using &lt;code&gt;--as-needed&lt;/code&gt;, and you had libX11 built with xcb &lt;span class="caps"&gt;USE&lt;/span&gt; flag enabled, you&amp;#8217;ll have libxcb.so.1 links on almost all X-using binaries in your system; after rebuilding the new libxcb and libX11 (which respectively would install libxcb.so.2, in theory, and let libX11 link to that), all the binaries will have in their process space both the old and the new libxcb. With different ABIs. And that&amp;#8217;s a huge problem on itself.&lt;/p&gt;


	&lt;p&gt;Then there is the other problem, that is related to &lt;a href="http://blog.flameeyes.eu/articles/2008/04/14/what-about-those-la-files"&gt;the .la files&lt;/a&gt; I discussed a few months back. As a huge amount of &lt;span class="caps"&gt;KDE&lt;/span&gt; modules (and not limited to) linked to Xlib, they also had libxcb-xlib listed in their .la files dependencies. Which causes &lt;em&gt;everything&lt;/em&gt; to fail linking with libtool as it&amp;#8217;s looking for the missing &lt;code&gt;libxcb-xlib.la&lt;/code&gt; file.&lt;/p&gt;


	&lt;p&gt;I suppose it&amp;#8217;s time to spend time to get a script to fix this situation, but I admit I&amp;#8217;m not much motivated at the moment. Especially since my system is pretty slow when it comes to rebuild stuff for testing, and my employer is not going to pay me anytime soon to allow me getting a newer box.&lt;/p&gt;


	&lt;p&gt;Once the script is available, it should probably be much much easier to get rid of .la files in ebuilds, as we could just say to the users to run the fixing script and be done with that..&lt;/p&gt;


	&lt;p&gt;But I admit I was planning on doing some different things in the next days, I had little time for myself lately to begin with, and I&amp;#8217;m following way too many things at once. Sigh.&lt;/p&gt;</description>
      <pubDate>Wed, 02 Jul 2008 13:43:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0c48316a-83f8-4906-bb48-bb5a35278ac3</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/07/02/again-about-la-files-or-why-should-they-be-killed-off-sooner-rather-than-later</link>
      <comments>http://blog.flameeyes.eu/articles/2008/07/02/again-about-la-files-or-why-should-they-be-killed-off-sooner-rather-than-later#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>Xorg</category>
      <category>XCB</category>
      <category>libtool</category>
      <category>X11</category>
      <category>lafiles</category>
      <category>Lives</category>
      <category>xcbutil</category>
      <category>Xlib</category>
    </item>
    <item>
      <title>A few risks I see related to the new portage 2.2 preserve-libs behaviour</title>
      <description>&lt;p&gt;Fellow developer &lt;a href="http://feeds.feedburner.com/~r/r0bertz/~3/321227612/portage-22-preserve-libs-features.html"&gt;Zhang Le&lt;/a&gt; wrote about the new preserve-libs feature from Portage 2.2 that removes the need for revdep-rebuild.&lt;/p&gt;


	&lt;p&gt;As I wrote on gentoo-dev mailing list when Marius asked for comments, there are a few prolems with its implementation as it is, in my not-so-humble opinion. (Not-so-humble because I know exactly what I&amp;#8217;m talking about, and I know it&amp;#8217;s a problem).&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s take a common scenario, a system where &lt;code&gt;--as-needed&lt;/code&gt; as never used, that is updating a common library from &lt;span class="caps"&gt;ABI 0&lt;/span&gt; to &lt;span class="caps"&gt;ABI 1&lt;/span&gt; (so with a change of soname). This library might be, for instance, &lt;code&gt;libexpat&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t want to discuss here what an &lt;span class="caps"&gt;ABI&lt;/span&gt; is and what an &lt;span class="caps"&gt;ABI&lt;/span&gt; bump consists of. Let&amp;#8217;s just say that when you make an &lt;span class="caps"&gt;ABI&lt;/span&gt; bump you either remove functions, or you change the meaning of some functions (like the parameters, the behaviour or other things like those).&lt;/p&gt;


	&lt;p&gt;In the first case the bump is annoying but not much of a problem, executables stop being loaded because symbols are undefined; with lazy-loaded executables, they might die in the middle at the moment the undefined symbols is called, but that&amp;#8217;s not our concern here.&lt;/p&gt;


	&lt;p&gt;The problem comes when a function with the same exact name changes meaning, parameters or return type. In this case, the executable might pass too much or too little data to the function, he pointers might be referring to something completely different, or might be truncated. In general, when you change the interface or the meaning of a function, if the executables built to use the previous version are executed with the new version, they&amp;#8217;ll either crash down or behave in a corrupted manner. Which are two subtle issues which we should be looking forward to, as they are hard to debug unless you know about them.&lt;/p&gt;


	&lt;p&gt;So let&amp;#8217;s return to our library changing &lt;span class="caps"&gt;ABI&lt;/span&gt;. Let&amp;#8217;s say we have &lt;code&gt;libfooA.so.0&lt;/code&gt; and &lt;code&gt;libfooA.so.1&lt;/code&gt; installed, the first is preserved by preserved-libs, the second is the new one. &lt;code&gt;libfooB.so.$anything&lt;/code&gt; links to &lt;code&gt;libfooA&lt;/code&gt; as it uses it directly, so it will be in the set of packages to rebuild.&lt;/p&gt;


	&lt;p&gt;Introducing &lt;code&gt;libfooC.so.$anything&lt;/code&gt; that links to &lt;code&gt;libfooB.so.$anything&lt;/code&gt;, but as destiny wishes, is also using &lt;code&gt;libfooA&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;At this point before the &lt;span class="caps"&gt;ABI&lt;/span&gt; bump we have &lt;code&gt;libfooB&lt;/code&gt; depending on &lt;code&gt;libfooA.0&lt;/code&gt;, and &lt;code&gt;libfooC&lt;/code&gt; depending on &lt;code&gt;libfooB&lt;/code&gt; and &lt;code&gt;libfooA.0&lt;/code&gt;; after the bump, we decide to rebuild only &lt;code&gt;libfooB&lt;/code&gt;, which means that &lt;code&gt;libfooB&lt;/code&gt; now depends on &lt;code&gt;libfooA.1&lt;/code&gt; while &lt;code&gt;libfooC&lt;/code&gt; is still depending on &lt;code&gt;libfooA.0&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;What this means is that, minus symbol versioning, the same symbol would have two (probably different) definitions, which will collide one with the other, leading to subtle crashes, misbehaviour and other fun-to-debug problems.&lt;/p&gt;


	&lt;p&gt;The problem is that the two ABIs of the libraries are both being loaded in the same userspace, which is a very bad thing, unless the symbols are versioned. On the other hand, symbol versioning is a bit of a mess, it&amp;#8217;s not implemented by all operating systems, and &lt;a href="http://blog.flameeyes.eu/articles/2007/05/18/new-results-from-my-elven-script"&gt;I find it quite convoluted&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;At the moment I don&amp;#8217;t see anything in portage that stops you from shooting in your own foot by doing a partial rebuild. I hope I&amp;#8217;m mistaken, but if I&amp;#8217;m not, please remember to &lt;em&gt;always&lt;/em&gt; do a full rebuild, rather than a partial one. Instead of having programs not starting, you might have programs corrupting your data, otherwise.&lt;/p&gt;</description>
      <pubDate>Mon, 30 Jun 2008 16:48:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:219cbe20-1e56-4f02-8af0-e6e95aec43e0</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/30/a-few-risks-i-see-related-to-the-new-portage-2-2-preserve-libs-behaviour</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/30/a-few-risks-i-see-related-to-the-new-portage-2-2-preserve-libs-behaviour#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>portage</category>
      <category>ELF</category>
      <category>Linking</category>
      <category>Versioning</category>
      <category>ABI</category>
    </item>
    <item>
      <title>Bricolage Break</title>
      <description>&lt;p&gt;I&amp;#8217;m taking a break. Enterprise has been turned off for two days by now, I actually spent the whole of today laying in bed with a fan pointed at me, watching National Geographic and Discovery Channel.&lt;/p&gt;


	&lt;p&gt;I was actually planning to spend a week working on a few &lt;span class="caps"&gt;DIY&lt;/span&gt; projects. The first should have been a very simple one, just some walls for a drawer that&amp;#8217;s too big to store stuff in it properly. My idea was to take some plywood, cut it in properly sized rectangles, then cut some slots in them so that they plug one into the other.&lt;/p&gt;


	&lt;p&gt;I was able to cut slots in two pieces, and was working on the third yesterday, when the mini-mandrel I was using started losing power. I thought it was just overheated but today when I resumed working on the slot it did the same trick, and started having a bad burning smell. I opened it to find the cables looking strangely brown. If you ever seen electrical cables burning, you know the colour.&lt;/p&gt;


	&lt;p&gt;So now I am without a mandrel to finish the job, which is quite annoying actually, as I use that when I have to fit the new plug modules in the place of the old ones (the old ones were smaller, so the tiles, in the kitchen and the bathrooms, weren&amp;#8217;t cut exactly around the boxes).&lt;/p&gt;


	&lt;p&gt;I suppose this is what happens when you rely on cheap-o-tools. I suppose ecology (and probably economy) would be glad if I actually started buying good tools that last rather than stupid tools that break down in less than two years. Indeed the mini toolset I was using I only paid &#8364;18, while a similar set from Dremel (Bosch) is available at around &#8364;70.&lt;/p&gt;


	&lt;p&gt;The problem is that I was planning on buying a router (the powertool, not the network appliance) as I was hoping to work, this summer, on building a bookshelf. Having to replace the toolset is bad news.&lt;/p&gt;


	&lt;p&gt;So my break is going to be less bricolage-oriented than I hoped. I&amp;#8217;ll probably read &lt;a href="http://www.amazon.co.uk/exec/obidos/ASIN/1857230655/flameeyessweb-21"&gt;The Dragon Reborn&lt;/a&gt;, although I was hoping to read more society and political books (like the ones I have in &lt;a href="http://amazon.co.uk/gp/registry/265AZ8JI6XHFA"&gt;my wishlist&lt;/a&gt; but I guess that the powertools will use the money I was hoping to use for those.&lt;/p&gt;


	&lt;p&gt;And I still have to find a way to replace Enterprise.&lt;/p&gt;</description>
      <pubDate>Thu, 26 Jun 2008 20:15:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ef2f604f-5922-47c7-bce6-868f56355947</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/26/bricolage-break</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/26/bricolage-break#comments</comments>
      <category>Personal</category>
      <category>English</category>
      <category>DIY</category>
      <category>Bricolage</category>
      <category>PowerTools</category>
    </item>
    <item>
      <title>Disk images</title>
      <description>&lt;p&gt;As I &lt;a href="http://blog.flameeyes.eu/articles/2008/06/22/i-bought-a-software-license"&gt;wrote before&lt;/a&gt; I&amp;#8217;m currently converting my video archive to a format compatible with iTunes, AppleTV and PlayStation3. To do so, I&amp;#8217;m archiving it directly on my &lt;span class="caps"&gt;OSX&lt;/span&gt;-compatible partitions, so that iTunes can access it. I&amp;#8217;m actually thinking about moving it on an &lt;span class="caps"&gt;NFS&lt;/span&gt;-shared &lt;span class="caps"&gt;XFS&lt;/span&gt; partition, but for now it&amp;#8217;s just &lt;span class="caps"&gt;HFS&lt;/span&gt;+.&lt;/p&gt;


	&lt;p&gt;To do so, though, I had to repartition the external 1TB hard disk, to give more space for the iTunes Library partition. For a series of reasons, I had to backup the content of the disk before, and now I&amp;#8217;m restoring the data. To do the backup, I used the &lt;span class="caps"&gt;DMG&lt;/span&gt; image format that is native to &lt;span class="caps"&gt;OSX&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;The nice thing of &lt;span class="caps"&gt;DMG&lt;/span&gt; is that it transparently handles encrypted images, compressed images, read-only images and read-write images. The compressed image format, that is what I used, was able to cut in half the space used up in the partition.&lt;/p&gt;


	&lt;p&gt;Now of course I know &lt;span class="caps"&gt;DMG&lt;/span&gt; is just a glorified raw image format, and that there are a lot of alternatives for Linux, but this made me think a bit about what the average user knows about disk and partition images.&lt;/p&gt;


	&lt;p&gt;I know lots of people who think that a raw image taken with &lt;code&gt;dd&lt;/code&gt;(1) is good enough to be stored and used for every use. I don&amp;#8217;t agree with that, but I can understand what the problem is with understanding &lt;em&gt;why&lt;/em&gt; a raw image taken with &lt;code&gt;dd&lt;/code&gt; is not just &amp;#8220;good enough&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;The problem is that a lot of users ignore the fact that in a partition, together with the actual files&amp;#8217; data, there is space occupied by the filesystem metadata, the journal, and of course all the unused space is not always contiguous and it&amp;#8217;s not always zeroed out.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s take a common ad easy example that a lot of users who had to use Windows at one time will have no problem understanding: the &lt;span class="caps"&gt;FAT32&lt;/span&gt; filesystem.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;FAT&lt;/span&gt; filesystems tend to fragment &lt;em&gt;a lot&lt;/em&gt;. Fragmentation does not only mean that files are sparse around the disk, but also that the free space is sparse between the fragments of files. Also, when you delete a file, its content is not removed from the disk, as you can guess if you ever used undelete-like tools to restore files that were deleted.&lt;/p&gt;


	&lt;p&gt;When you compress with tools like &lt;code&gt;bzip2&lt;/code&gt; or similar a file, the fact that it&amp;#8217;s fragmented does not get in the way of the compression: if the file contains the same data repeated over and over it will be compressed quite easily. If the file is fragmented the same does not apply.&lt;/p&gt;


	&lt;p&gt;The fact that the free space is not zeroed out can cause lots of problems because a perfectly defragmented partition with 40GB of unused space cannot describe the unused space as &amp;#8220;40GB of 0s&amp;#8221;&amp;#8230; unless.&lt;/p&gt;


	&lt;p&gt;Unless the compression algorithm knows about the filesystem. If, when you take an image of the partition, you use a tool that knows about the format of the partition, it starts to be much more useful. For &lt;span class="caps"&gt;FAT&lt;/span&gt;, that would mean that a tool could just move all the files&amp;#8217; data at the start of the partition, put all the unused space at the end, and consider it empty, zeroed out. The result is no more a 1:1 copy, but it&amp;#8217;s probably good enough.&lt;/p&gt;


	&lt;p&gt;Now of course an alternative is just to use an archiving tool that can actually get all the files&amp;#8217; metadata (attributes, permissions, and so on), then you don&amp;#8217;t have to worry about unused space at all. But that assumes you can use custom tools both for creating the image and to restore it. Creating an image of a partition could be quite easy to do with an already set-up complex tool, but there might be the need for the restore part of the code to be as lightweight as possible.&lt;/p&gt;


	&lt;p&gt;Now, I&amp;#8217;m no expert on filesystems myself, so I might be wrong, or there might be the software doing this already out there. I don&amp;#8217;t know. But I think it wouldn&amp;#8217;t be too far fetched to think that there might be a software capable of taking an hard drive with an &lt;span class="caps"&gt;MBR&lt;/span&gt; partition table, with two &lt;span class="caps"&gt;FAT32&lt;/span&gt; filesystems on it, both fragmented, with the unused space not zeroed out at all, and creating an image file that only needs bzip2 to be uncompressed, and dd to be written, but still providing a much smaller image file than a simple raw image compressed with bzip2, or maybe even rzip.&lt;/p&gt;


	&lt;p&gt;Such a tool could easily find duplicated files (which happens a lot on Windows because of duplicated DLLs, but can easily happen on Linux too because of backup copies for instance), and put them one near the other so to improve compression.&lt;/p&gt;


	&lt;p&gt;I know this post is quite vague on details, and that&amp;#8217;s because as I said I&amp;#8217;m not much of an expert on the field. I just wanted to make some users reflect on the fact that a simple raw image is just not always the perfect solution if what you need is efficiency in storage space.&lt;/p&gt;</description>
      <pubDate>Tue, 24 Jun 2008 00:44:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f3abc67a-5ce3-45a7-af5e-01f96878239c</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/24/disk-images</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/24/disk-images#comments</comments>
      <category>Technical</category>
      <category>English</category>
      <category>Filesystems</category>
      <category>OSX</category>
      <category>apple</category>
      <category>Partitions</category>
      <category>Images</category>
      <category>DMG</category>
      <category>dd</category>
    </item>
    <item>
      <title>rbot and Gentoo</title>
      <description>&lt;p&gt;One nice thing about rbot is certainly, to me, the fact that installing it is mostly just an emerge away. For quite a while there has been a live ebuild of rbot that fetched first from Subversion and now from &lt;span class="caps"&gt;GIT&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;The only problem was that the ebuild fetched the sources, then made a gem, installed it, and then removed some files. Not exactly the shortest way around.&lt;/p&gt;


	&lt;p&gt;Thanks to the guys in #rbot, this has been solved. Now rbot installs itself without using gems, but by simple &lt;code&gt;setup.rb&lt;/code&gt;. This means not only that you won&amp;#8217;t need rake and zip to install it, but also that the installed files have decent path, rather than being buried inside the rubygems directories.&lt;/p&gt;


	&lt;p&gt;An additional advantage comes from the size of the installed files; when you install a gem, a copy of the sources is left in the rubygems tree; this can be quite a waste. The size of the rbot binpkg has halved:&lt;/p&gt;


&lt;pre&gt;
-rw-r--r-- 1 root root 959426 May 24 12:08 /usr/portage-packages/All/rbot-9999-r8.tbz2
-rw-r--r-- 1 root root 425034 Jun 23 20:18 /usr/portage-packages/All/rbot-9999-r9.tbz2
&lt;/pre&gt;

	&lt;p&gt;Add to this that the ruby-gettext dependency is gone too, now you got a nls &lt;span class="caps"&gt;USE&lt;/span&gt; flag that allows you to choose whether you want localised bots or not, and if you don&amp;#8217;t want them, it won&amp;#8217;t ask you for ruby-gettext at all. Nice, uh?&lt;/p&gt;


	&lt;p&gt;But it&amp;#8217;s not finished here. I was hacking at the ebuild today for a different reason. rbot has a &lt;code&gt;figlet&lt;/code&gt; plugin, that executes the &lt;code&gt;figlet&lt;/code&gt; command and copy the output on &lt;span class="caps"&gt;IRC&lt;/span&gt;. The ebuild, though, didn&amp;#8217;t have an option to pull in figlet, and I wanted to fix that.&lt;/p&gt;


	&lt;p&gt;So together with the removal of rubygems dependency, the new ebuild also has &lt;span class="caps"&gt;USE&lt;/span&gt; flags to enable the figlet, cal, host and fortune plugins. So you either get your dependencies pulled in, or the bot has the plugins disabled out of the ebuild. Cool!&lt;/p&gt;


	&lt;p&gt;And talking about the fortune plugin, listing the categories didn&amp;#8217;t work on Gentoo, as we install the database in a different directory than rbot expected them to be. This is fixed in rbot upstream repository by yours truly.&lt;/p&gt;


	&lt;p&gt;Always a pleasure to fix rbot on Gentoo ;) &lt;a href="http://www.ohloh.net/accounts/Flameeyes"&gt;Kudos welcome&lt;/a&gt; as well as &lt;a href="http://www.amazon.co.uk/gp/registry/265AZ8JI6XHFA"&gt;bribes&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 23 Jun 2008 20:29:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:efed51af-17b6-4e08-8c24-df3f73d4e512</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/23/rbot-and-gentoo</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/23/rbot-and-gentoo#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>Ruby</category>
      <category>rbot</category>
      <category>Ebuilds</category>
      <category>RubyBot</category>
      <category>Figlet</category>
    </item>
    <item>
      <title>I bought a software license</title>
      <description>&lt;p&gt;I finally decided to convert my video library to Mpeg4 containers, H.264 video and &lt;span class="caps"&gt;AAC&lt;/span&gt; audio, rather than mixing and matching what I had before that. This is due to the fact that I hardly use Enterprise to watch video anymore. Not only because my office is tremendously hot during the summer, but more because I have a 32&amp;#8221; TV set in my bedroom. Nicer to use.&lt;/p&gt;


	&lt;p&gt;Attached to that TV set there is an Apple TV (running unmodified software 2.0.2 at the moment) and a &lt;span class="caps"&gt;PS3&lt;/span&gt;. If you add to that all the other hardware that can play video I own, the only common denominator is H.264/AAC in &lt;span class="caps"&gt;MP4&lt;/span&gt; container. (I also &lt;a href="http://blog.flameeyes.eu/articles/2007/06/04/my-pragmatic-view-on-multimedia-container-formats"&gt;said before that I like the &lt;span class="caps"&gt;MP4&lt;/span&gt; format more than &lt;span class="caps"&gt;AVI&lt;/span&gt; or Ogg&lt;/a&gt;). It might be because I do have a few Apple products (iPod and AppleTV), but also Linux handle this format pretty well, so I don&amp;#8217;t feel bad about the choice. Beside, new content I get from youtube (like videos from &lt;a href="http://www.beppegrillo.it/"&gt;Beppe Grillo&amp;#8217;s blog&lt;/a&gt;) are also in this format&amp;#8212;you can get them with &lt;code&gt;youtube-dl -b&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Unfortunately, as I discussed before with Joshua, and as I tried last year before the hospital already, converting video to this format with Linux is a bit of a mess. While &lt;code&gt;mencoder&lt;/code&gt; has very good results for the audio/video stream conversions, producing a good &lt;span class="caps"&gt;MP4&lt;/span&gt; container is a big issue. I tried fixing a few corner cases in FFmpeg before, but it&amp;#8217;s a real mess to produce a file that QuickTime (thus iTunes, and thus the Apple TV) can accept.&lt;/p&gt;


	&lt;p&gt;After spending a couple more days on the issue I decided my time is worth more than what I&amp;#8217;ve been doing, and finally gave up to buy a tool that I have been told does the job, &lt;a href="http://www.techspansion.com/visualhub/"&gt;VisualHub&lt;/a&gt; for &lt;span class="caps"&gt;OSX&lt;/span&gt;. It was less than &#8364;20, and that is usually what I&amp;#8217;m paid by the hour for my boring jobs.&lt;/p&gt;


	&lt;p&gt;I got the software, tried it out, the result was nice. Video and audio quality on par with mencoder&amp;#8217;s but a properly working &lt;span class="caps"&gt;MP4&lt;/span&gt; container that QuickTime, iTunes, AppleTV, iPod and even more importantly xine can play nicely. But the log showed a reference to &amp;#8220;libavutil&amp;#8221;, which is FFmpeg. Did I just pay for Free Software?&lt;/p&gt;


	&lt;p&gt;I looked at the Bundle, it includes a &lt;code&gt;COPYING.txt&lt;/code&gt; file which is, as you might have already suspected, the text of &lt;span class="caps"&gt;GPL&lt;/span&gt; version 2. Okay, so there is free software in here indeed. And I can see a lot of well-known command line utilities: lsdvd, mkisofs, and so on. One nice thing to see is, though, an FFmpeg &lt;span class="caps"&gt;SVN&lt;/span&gt; diff. A little hidden, but it&amp;#8217;s there. Good.&lt;/p&gt;


	&lt;p&gt;The doubt then was if they were hiding the stuff or if it was shown and I did just miss it. Plus it has to have the sources of everything, not just a diff of FFmpeg&amp;#8217;s. And indeed in the last page of the documentation provided there is a link to &lt;a href="http://techspansion.com/sources/"&gt;this&lt;/a&gt; that contains all the sources of the Free software used. Which is actually quite a lot. They didn&amp;#8217;t limit themselves to take the software as it is though, I see at least some patches to taglib that I&amp;#8217;d very much like to take a look to later&amp;#8212;I&amp;#8217;m not sharing confidential registered-users-only information by the way, the documentation is present in the downloadable package that acts as a demo too.&lt;/p&gt;


	&lt;p&gt;I thought about this a bit. They took a lot of Free Software, adapted it, written a frontend and sold licenses for it. Do I have a problem with this? My conclusion is that I don&amp;#8217;t. While I would have preferred is they made it more clear on the webpage that they are selling a Free Software-based package, and that they would have made the frontend Free Software too, I think they are not doing anything evil with this. They are playing well by the rules, and they are providing a working software.&lt;/p&gt;


	&lt;p&gt;They are not trying to exploit Free Software without giving anything back (the sources are there) and they did something more than just package Free Software together, they tested and prepared presets to use for encoding for various targets, included Apple TV which is my main target. They are, to an extent, selling a service (their testing and presets choices), and their license is also quite acceptable to me (it&amp;#8217;s like a family license, usable on all the household&amp;#8217;s computers as well as a work computer in an eventual office).&lt;/p&gt;


	&lt;p&gt;At the end of the day, I&amp;#8217;m happy of spending this money as I suppose it&amp;#8217;s also going to further develop the Free Software part of the software too, although I would have been happier to chip in a bit more if it was fully Free Software.&lt;/p&gt;


	&lt;p&gt;And most importantly, it worked out of the tarball solving me a problem I was having for more than an year now. Which means, for me, a lot less time spent trying to get the whole thing working. Of course if one day I could just do everything with simply FFmpeg I&amp;#8217;ll be very happy, and I&amp;#8217;ll dedicate myself a bit more on &lt;span class="caps"&gt;MP4&lt;/span&gt; container support, both in writing and parsing, in the future, but at least now I can just feed it the stuff I need converted and dedicate my time and energy toward more useful goals (for me, as in paid jobs, and for the users with Gentoo).&lt;/p&gt;</description>
      <pubDate>Sun, 22 Jun 2008 18:11:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:4b00c8da-fb6e-4ff5-b99d-591882ce4a7e</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/22/i-bought-a-software-license</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/22/i-bought-a-software-license#comments</comments>
      <category>Technical</category>
      <category>English</category>
      <category>OSX</category>
      <category>FreeSoftware</category>
      <category>iTunes</category>
      <category>AAC</category>
      <category>ffmpeg</category>
      <category>H264</category>
      <category>GPL</category>
      <category>mp4</category>
      <category>conversion</category>
      <category>AppleTV</category>
      <category>iPod</category>
      <category>VisualHub</category>
      <category>ProprietarySoftware</category>
    </item>
    <item>
      <title>Debuking ccache myths</title>
      <description>&lt;p&gt;Doing support work in #gentoo-it is probably one of the most user-facing tasks I&amp;#8217;ve been doing lately, it&amp;#8217;s nice because you can often gather common misconceptions about problems and tools.&lt;/p&gt;


	&lt;p&gt;One of these is related to &lt;code&gt;ccache&lt;/code&gt;. Some users seem to think that &lt;code&gt;ccache&lt;/code&gt; will improve their compile speed in any situation. This couldn&amp;#8217;t be more wrong.&lt;/p&gt;


	&lt;p&gt;First of all, in the situation of an always different source file, &lt;code&gt;ccache&lt;/code&gt; will make build take a &lt;em&gt;longer&lt;/em&gt; time than a non-cached build. The reason is pretty simple once you think of it. The cache is indexed by an hash, the md5 of the preprocessed source file; and the content of the cache is the resulting object file. When you build a given source file, &lt;code&gt;ccache&lt;/code&gt; will have to take an md5 hash of the preprocessor&amp;#8217;s result. Then it should look for it on the cache tree, and if it&amp;#8217;s not found, it will have to compile it and write the output twice (once as the output of the build and once in the cache). It might not be a huge overhead but it&amp;#8217;s an overhead nonetheless.&lt;/p&gt;


	&lt;p&gt;So there has to be a benefit to use &lt;code&gt;ccache&lt;/code&gt; for it to be useful. The benefit is that, when you build the same sources twice, the hash, lookup and copy takes less time than the build, usually. But when do you actually build the same sources twice?&lt;/p&gt;


	&lt;p&gt;The first myth to debunk is that it&amp;#8217;s helpful for packages using libtool as they build sources twice (one &lt;span class="caps"&gt;PIC&lt;/span&gt; and one non-PIC). While it&amp;#8217;s true they build the same sources twice, they are not compiled in the same way, so the cache is not saving anything. If they were built the same way, there would be no reason to actually build it twice, no?&lt;/p&gt;


	&lt;p&gt;The second is that &lt;code&gt;ccache&lt;/code&gt; helps when you change your &lt;span class="caps"&gt;CFLAGS&lt;/span&gt;. The idea of &lt;code&gt;ccache&lt;/code&gt; is that it gives you the exact output the compiler would give you. And this means that changing &lt;span class="caps"&gt;CFLAGS&lt;/span&gt; will change the resulting output too. If it was ignoring the change in &lt;span class="caps"&gt;CFLAGS&lt;/span&gt; and returning data from cache it would be breaking your setup by disallowing you to change &lt;span class="caps"&gt;CFLAGS&lt;/span&gt;. Again, &lt;code&gt;ccache&lt;/code&gt; is not helping you.&lt;/p&gt;


	&lt;p&gt;The third myth is that &lt;code&gt;ccache&lt;/code&gt; makes changing &lt;span class="caps"&gt;USE&lt;/span&gt; flags a matter of seconds rather than hours. While it&amp;#8217;s true that this is a case where commonly you do have an advantage on using &lt;code&gt;ccache&lt;/code&gt;, it&amp;#8217;s not that simple. Changing &lt;span class="caps"&gt;USE&lt;/span&gt; flags usually means changing the compiled code; there are rare cases (like xorg-server PDEPENDs) that allows you to keep the same exact sources when changing &lt;span class="caps"&gt;USE&lt;/span&gt; flags.&lt;/p&gt;


	&lt;p&gt;Even then, if you change versions of the libraries used by the software, then the preprocessed sources will change, and we&amp;#8217;re back to square one.&lt;/p&gt;


	&lt;p&gt;All in all, ccache is not bad, it&amp;#8217;s helpful in various situations, it&amp;#8217;s quite useful for developers. But it&amp;#8217;s not a panacea for Gentoo users.&lt;/p&gt;</description>
      <pubDate>Sat, 21 Jun 2008 20:22:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c9179622-309e-40fc-8348-d314cc3c868c</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/21/debuking-ccache-myths</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/21/debuking-ccache-myths#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>ccache</category>
      <category>panacea</category>
      <category>myths</category>
    </item>
    <item>
      <title>My take on Genji: Days of The Blade</title>
      <description>&lt;p&gt;So, I named &lt;a href="http://www.amazon.co.uk/exec/obidos/ASIN/B000FN9OEA/flameeyessweb-21"&gt;Genji&lt;/a&gt; before, and I said it&amp;#8217;s a cool game. Well, I have some details to fix up on that statement.&lt;/p&gt;


	&lt;p&gt;The game in itself looks tremendously cool. Very nice graphics, nice characters, nice story. But it has some pitfalls in the actual implementation.&lt;/p&gt;


	&lt;p&gt;First of all I have to say that the graphics is &lt;em&gt;not&lt;/em&gt; a way to get the eyes off from the actual gameplay. The gameplay is nice. Of the four playable characters, none is the perfect character: this means that you &lt;strong&gt;have&lt;/strong&gt; to switch between them to balance the game. This is very good to me, otherwise I end up fixating myself on one playable character and use just that. The fact that the mini-bosses need to be hit on the back otherwise they just won&amp;#8217;t come down is a very nice touch in gameplay. And in general the whole game is well designed.&lt;/p&gt;


	&lt;p&gt;The problem comes on levels design. I&amp;#8217;m in what is probably the third &amp;#8220;area&amp;#8221; (not third level), the checkpoints where you recharge and save are very distant one with the other, which isn&amp;#8217;t bad on its own, but it starts to be a problem when you don&amp;#8217;t provide more than a couple of health-restoring items, and you start having something like six mini-bosses to fight (with their team of minions) before you can get near a new checkpoint.&lt;/p&gt;


	&lt;p&gt;Sometimes it&amp;#8217;s just a waste of time because you have to get back to the previous checkpoint to save and recharge your health. Sometimes it&amp;#8217;s simply a pointless exercise because you end up fighting more and more minions, as they re-appear every time you come around the same corner, even though you fought and killed them all.&lt;/p&gt;


	&lt;p&gt;Now this is not entirely bad, as you can&amp;#8217;t just turn back and pass again a level to become stronger before challenging a boss. Which is quite annoying when you have a savegame in the boss&amp;#8217;s lair, and you come to think your characters are not strong enough to cope with that.&lt;/p&gt;


	&lt;p&gt;So what do I think of the game, all things considered? A bit frustrating. Not only because of the distance of checkpoints, but even more because it is tremendously well designed in other areas that this frustration is not easy to explain.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m not regretting spending money to get this game though, of that I can be sure.&lt;/p&gt;</description>
      <pubDate>Thu, 19 Jun 2008 19:08:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b5152b55-6fd0-4900-ada2-260670075518</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/19/my-take-on-genji-days-of-the-blade</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/19/my-take-on-genji-days-of-the-blade#comments</comments>
      <category>Personal</category>
      <category>English</category>
      <category>Games</category>
      <category>PlayStation3</category>
      <category>PS3</category>
      <category>Genji</category>
      <category>DoTB</category>
      <category>Videogames</category>
    </item>
    <item>
      <title>I guess my next phone is not going to be a Nokia</title>
      <description>&lt;p&gt;I wrote a few times before about my experience with my Nokia &lt;span class="caps"&gt;E61&lt;/span&gt; phone. WIth the iPhone 3G coming to Italy, and the &lt;span class="caps"&gt;E71&lt;/span&gt; being announced, I started to think whether to change my phone, and which one to get.&lt;/p&gt;


	&lt;p&gt;The first issue would be, do I want to keep going with Nokia or not? Nokia is being felt as &amp;#8220;great&amp;#8217; in the Free Software world, although there has been some trouble with &lt;a href="http://technocrat.net/d/2008/6/11/43198"&gt;Ari Jaaksi&amp;#8217;s words lately&lt;/a&gt; but I&amp;#8217;m very much disliking their policies related to phones.&lt;/p&gt;


	&lt;p&gt;The first problem is something &lt;a href="http://blog.flameeyes.eu/articles/2007/03/01/ranting-about-nokias-development-kits"&gt;I wrote before&lt;/a&gt; about, and it&amp;#8217;s their &lt;span class="caps"&gt;SDK&lt;/span&gt; policies. Not only the S60v3 &lt;span class="caps"&gt;SDK&lt;/span&gt; is not usable under Linux, but also the most complete SDKs are just overpriced.&lt;/p&gt;


	&lt;p&gt;Yes, I know Apple&amp;#8217;s &lt;span class="caps"&gt;SDK&lt;/span&gt; isn&amp;#8217;t much better, but this is just &lt;em&gt;one&lt;/em&gt; issue I have with Nokia.&lt;/p&gt;


	&lt;p&gt;The other big issue with Nokia is that even the most basic annoyances you might have with the phone&amp;#8217;s software will never get fixed in your phone&amp;#8217;s software release. For instance, &lt;span class="caps"&gt;E61&lt;/span&gt; has a pretty useless home screen, it shows you the next appointments in the calendar and &lt;em&gt;a single&lt;/em&gt; TODO item. With the huge screen real estate in the phone, it&amp;#8217;s kinda pointless to have just these things in there.&lt;/p&gt;


	&lt;p&gt;The problem has being partly solved in the E61i version, which has the same exact screen size, but has a more interesting home screen, which includes the number of new unread email messages, and the presence of Wireless &lt;span class="caps"&gt;LAN&lt;/span&gt; connections. I don&amp;#8217;t think that to implement the new home screen you need any new hardware the E61i has and the &lt;span class="caps"&gt;E61&lt;/span&gt; doesn&amp;#8217;t. But Nokia is &lt;strong&gt;not&lt;/strong&gt; going to update the firmware of &lt;span class="caps"&gt;E61&lt;/span&gt; with that, as it&amp;#8217;s a service release of the OS.&lt;/p&gt;


	&lt;p&gt;The problem is that there are tons of little annoyances in Nokia&amp;#8217;s Symbian, but to get those fixed your only choice is for you to buy a &lt;em&gt;new&lt;/em&gt; phone. Which would be just a waste of money. They really should start updating the OS for old models too, not just for the last version they released of every model.&lt;/p&gt;


	&lt;p&gt;Now, as I was saying the other day talking with DanielW on the Amarok developers&amp;#8217; channel, unfortunately the most open platform currently in use and with a decent price tag is Windows Mobile. Actually, Windows Mobile phones do look nice, but I need to sync with &lt;span class="caps"&gt;OSX&lt;/span&gt; at the moment (Address Book beats Kontact a million times, for now, once &lt;span class="caps"&gt;KDE&lt;/span&gt; gets a decent address book application, then I&amp;#8217;ll have &lt;span class="caps"&gt;KDE&lt;/span&gt; as main sync I suppose), and I heard so many bad things about Windows Mobile (and one I seen with my eyes, my brother-in-law was receiving a photo of my nephew with his Windows Mobile &lt;span class="caps"&gt;PDA&lt;/span&gt; via bluetooth, it ended up stuck, he tried shutting it off, it didn&amp;#8217;t work, he removed the battery and put it back, and it reset itself entirely&amp;#8230;).&lt;/p&gt;


	&lt;p&gt;Sadly, there isn&amp;#8217;t so much choice here. I want a smartphone, as I grew used to have email support while I&amp;#8217;m on the go, for job and other things; also, being able to browse some e-shops when I&amp;#8217;m at an actual shop, to check for prices did save me quite a bit of money before. There are only three choices for smartphones out there: Symbian OS, Windows Mobile and iPhone. The first, as I said, is a huge pain in the ass as it is almost never updated; the second is just not something I&amp;#8217;d be glad to be using, so at the moment my best choice is the third.&lt;/p&gt;


	&lt;p&gt;Now of course before I can actually get an iPhone there are a few things I need to clear. First &lt;span class="caps"&gt;TIM&lt;/span&gt; has to announce it. I&amp;#8217;ll never become a Vodafone customer in my life, they are just thieves. And &lt;span class="caps"&gt;TIM&lt;/span&gt; has to announce a decent dataplan as I need it. As an alternative they can just not simlock it, I&amp;#8217;ll be glad to pay for a decent voice plan to give my mother and keep the iPhone with my current carrier (H3G) which has a very nice dataplan.&lt;/p&gt;


	&lt;p&gt;But for sure, the only way for my next phone to be Nokia would be for me to work for Nokia and having the tools to actually update its firmware to fix the bloody annoyances it gives me, like not being able to search for contacts by nickname when looking up the destination of an &lt;span class="caps"&gt;SMS&lt;/span&gt;, or showing the birthdays in the calendar view (and the homescreen) for those contacts having one set.&lt;/p&gt;</description>
      <pubDate>Wed, 18 Jun 2008 21:20:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:36f5dcec-23f7-4413-8f2a-72897017c1d2</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/18/i-guess-my-next-phone-is-not-going-to-be-a-nokia</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/18/i-guess-my-next-phone-is-not-going-to-be-a-nokia#comments</comments>
      <category>English</category>
      <category>apple</category>
      <category>Nokia</category>
      <category>E61</category>
      <category>Symbian</category>
      <category>Cellphones</category>
      <category>iPhone</category>
      <category>WindowsMobile</category>
    </item>
    <item>
      <title>Why conditional patching and autotools rebuild is a Bad Idea</title>
      <description>&lt;p&gt;With capital B and I, of course.&lt;/p&gt;


	&lt;p&gt;I wrote yesterday about &lt;a href="http://blog.flameeyes.eu/articles/2008/06/13/maintaner-mode"&gt;maintainer mode use by ebuilds&lt;/a&gt; and why it&amp;#8217;s a problem. Today I want to focus on a slightly related issue: conditional patching and autotools rebuild.&lt;/p&gt;


	&lt;p&gt;One very common use of maintainer mode is due to conditional patching: you can&amp;#8217;t inherit autotools.eclass conditionally, so you leave it up to the autotools to decide whether to rebuild themselves or not.&lt;/p&gt;


	&lt;p&gt;This is bad not only for the problems I outlined for maintainer mode itself, but also because conditional patch, as well as conditional autotools rebuild, is something you should not do in an ebuild unless there is an extremely good reason to.&lt;/p&gt;


	&lt;p&gt;The first problem is quite obviously that you cannot send conditional patches upstream (see also my old article &lt;a href="http://www.linux.com/articles/46528"&gt;Best practices for portable patches&lt;/a&gt;). In Gentoo we should really prefer patches taken from upstream and/or that can be sent and accepted by upstream.&lt;/p&gt;


	&lt;p&gt;But it&amp;#8217;s not limited to that: conditional patches gets applied only on particular conditions, this means that if you are bumping the package and those conditions don&amp;#8217;t apply to you, then you won&amp;#8217;t be seeing whether the patch applies or not. And if it&amp;#8217;s an important fix for a particular architecture, and the patch cannot apply, then that architecture will have a broken package. If it&amp;#8217;s a build-fix you can live with it a bit (although it will upset with reason the users of that arch), but if it&amp;#8217;s a runtime fix then it&amp;#8217;s a problem, because it might go months without being noticed.&lt;/p&gt;


	&lt;p&gt;And it&amp;#8217;s not just during bump, but also when you add a new patch, it might not stack correctly against one of the conditional patches, and you wouldn&amp;#8217;t be seeing the failure. So for instance to fix a build error on one setup you might break build on a different one.&lt;/p&gt;


	&lt;p&gt;In general, you want the patches to be unconditional, and you want to rebuild autotools at the minimal change. This even if the rebuild would be needed by a reduced set of users. The reason is that it&amp;#8217;s better to waste a little more time for all the users rather than having a (big or small) subset of them being stuck entirely because of a conditional patch or rebuild.&lt;/p&gt;


	&lt;p&gt;Also, the sooner you can send a patch upstream, the sooner you won&amp;#8217;t be needing it in the ebuild. If you prepare a conditional, raw and quick patch to fix a setup, you cannot send it as it is to upstream, so you&amp;#8217;ll have to either spend more time to prepare also a refined good patch, or you&amp;#8217;ll have to deal with that patch for a long time. Neither solution is a good one for your workflow.&lt;/p&gt;


	&lt;p&gt;So please, don&amp;#8217;t make anything conditional, unless it&amp;#8217;s really really needed.&lt;/p&gt;</description>
      <pubDate>Sat, 14 Jun 2008 13:00:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:44a1ea6f-24a0-4164-8b8a-a7f31229762c</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/14/why-conditional-patching-and-autotools-rebuild-is-a-bad-idea</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/14/why-conditional-patching-and-autotools-rebuild-is-a-bad-idea#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>patches</category>
      <category>autotools</category>
      <category>Conditionals</category>
      <category>BestPractices</category>
    </item>
    <item>
      <title>Maintainer mode</title>
      <description>&lt;p&gt;Developers happen to edit &lt;code&gt;Makefile.am&lt;/code&gt; and &lt;code&gt;configure.ac&lt;/code&gt; a lot during the development of any software. For this reason, a long time ago, autotools included a support called maintainer mode.&lt;/p&gt;


	&lt;p&gt;When maintainer mode is active, at a change to those files, as well as other autotools files, the proper tool is called (&lt;code&gt;autoconf&lt;/code&gt;, &lt;code&gt;automake&lt;/code&gt;, etc) to rebuild the whole series of files. This is useful because a simple &lt;code&gt;make&lt;/code&gt; call does almost everything for the developer.&lt;/p&gt;


	&lt;p&gt;Recently, though, maintainer mode is no more optional by default, but it&amp;#8217;s instead force-fed on every project, unless &lt;code&gt;AM_MAINTAINER_MODE&lt;/code&gt; is explicitly called in the &lt;code&gt;configure.ac&lt;/code&gt; file.&lt;/p&gt;


	&lt;p&gt;This is all well and good, so why am I talking about this? Well because maintainer mode is bad to use in ebuilds. If you patch a &lt;code&gt;Makefile.am&lt;/code&gt; or &lt;code&gt;configure&lt;/code&gt; file, and you don&amp;#8217;t explicitly rebuild autotools, maintainer mode will do it for you, but it causes a few problems this way.&lt;/p&gt;


	&lt;p&gt;The most annoying problem for users is that if the maintainer mode is triggered by an edit to &lt;code&gt;configure.ac&lt;/code&gt;, the build will run &lt;code&gt;./configure&lt;/code&gt; twice. It&amp;#8217;s boring enough to run once.&lt;/p&gt;


	&lt;p&gt;But more problems arise for instance when a new version of autoconf or automake is released. Because in that case the versions will not be the same between the original and the one that would be built, aborting the whole build (see my &lt;a href="http://www.gentoo.org/proj/en/qa/autofailure.xml"&gt;autofailure guide&lt;/a&gt; that reports that for instance).&lt;/p&gt;


	&lt;p&gt;Also, if you leave the task up to maintainer mode, it won&amp;#8217;t even take into consideration the &lt;code&gt;WANT_AUTO*&lt;/code&gt; variables that we use to force a particular version of autoconf and automake, so you&amp;#8217;ll have automagic dependencies. And most likely you&amp;#8217;ll forget to add autotools to the dependencies of the ebuild.&lt;/p&gt;


	&lt;p&gt;Okay so we know why maintainer mode is bad, how do we make sure that ebuilds don&amp;#8217;t trigger maintainer mode? Beside the fact that developers should know what they do, by rebuilding autotools explicitly when patching the files, it&amp;#8217;s worth looking &amp;#8220;postmortem&amp;#8221; if an ebuild triggered the maintainer mode rebuild. It&amp;#8217;s actually useful because sometimes upstream is crazy and fixes the tarball without going through &lt;code&gt;make dist&lt;/code&gt; and maintainer mode is triggered for unpatched vanilla tarballs too (in that case you should rebuild autotools explicitly anyway).&lt;/p&gt;


	&lt;p&gt;To check if a build triggered maintainer mode, you can just grep the build log for the string &amp;#8220;&lt;code&gt;missing --run&lt;/code&gt;&amp;#8221; (without quotes of course), that is the announce that maintainer mode was triggered. If that&amp;#8217;s the case&amp;#8230; it&amp;#8217;s time to file a bug to latch to &lt;a href="http://bugs.gentoo.org/alias/bad-autotools"&gt;this tracker&lt;/a&gt; .&lt;/p&gt;


	&lt;p&gt;I suppose I&amp;#8217;ll have to fix bugs on a few more packages I don&amp;#8217;t use/care about myself directly in the next weeks. Sigh, I need the new box.&lt;/p&gt;</description>
      <pubDate>Fri, 13 Jun 2008 14:12:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:050b76da-36db-452f-991a-6542fef11e81</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/13/maintaner-mode</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/13/maintaner-mode#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>autotools</category>
      <category>automake</category>
      <category>MaintainerMode</category>
    </item>
    <item>
      <title>Please don't build your examples by default</title>
      <description>&lt;p&gt;I&amp;#8217;m in the middle of an &lt;code&gt;emerge -e world&lt;/code&gt; I started to try getting as much glibc 2.8 failure have a bug already on Gentoo&amp;#8217;s Bugzilla so that users hitting them don&amp;#8217;t have to report them anew.&lt;/p&gt;


	&lt;p&gt;One thing I noticed during this rebuild is the amount of time spent with no good reason to build tests and examples.&lt;/p&gt;


	&lt;p&gt;I have the test feature disabled, I only enable it for the software I maintain, and I usually don&amp;#8217;t have so much time to look at the test of &lt;em&gt;all&lt;/em&gt; software. Still some packages, like dbus, hal, gtk, and so on, build their tests anyway. They don&amp;#8217;t run them, but they build tests and example during the default &lt;code&gt;make all&lt;/code&gt; call.&lt;/p&gt;


	&lt;p&gt;I talked with &lt;a href="http://0pointer.de/lennart/"&gt;Lennart&lt;/a&gt; about that some time ago as also libdaemon does that. He pointed out to me that these examples are often a way for the developers to test that the code still links correctly, for instance, and thus should not be disabled by default during developmet. I agree it can be useful that way.&lt;/p&gt;


	&lt;p&gt;For this reason, I prepared a patch for libdaemon, that you can now find &lt;a href="http://www.flameeyes.eu/tmp/libdaemon-disable-examples.patch"&gt;here&lt;/a&gt;, which I should have committed and I forgot about &amp;#8211; I&amp;#8217;ll see to do that soonish :P &amp;#8211; which should make it possible to have the best of both options: developers still get their examples (and/or tests), while distributions can opt-out them.&lt;/p&gt;


	&lt;p&gt;For ebuilds, this means that the &lt;code&gt;src_test&lt;/code&gt; function should do a &lt;code&gt;make -C tests&lt;/code&gt; or &lt;code&gt;make -C examples&lt;/code&gt; to build tests and examples, after such a patch is applied, to explicitly build the code that most users won&amp;#8217;t need during standard run.&lt;/p&gt;


	&lt;p&gt;I know it&amp;#8217;s just seconds, or minutes, of time to build the examples, but if you add all those up, you&amp;#8217;re wasting &lt;em&gt;lots&lt;/em&gt; of time. And we should always strive to optimise time usage, no?&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 16:45:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:fca3eee9-07b4-4169-adbd-c50e978cf493</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/11/please-dont-build-your-examples-by-default</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/11/please-dont-build-your-examples-by-default#comments</comments>
      <category>Gentoo</category>
      <category>Technical</category>
      <category>English</category>
      <category>patches</category>
      <category>Tests</category>
      <category>autotools</category>
      <category>Ebuilds</category>
      <category>Examples</category>
      <category>Builds</category>
      <category>Upstream</category>
      <category>libdaemon</category>
    </item>
    <item>
      <title>Sub-optimal optimisations?</title>
      <description>&lt;p&gt;While writing &lt;a href="http://lwn.net/Articles/285332/"&gt;Implications of pure and constant functions&lt;/a&gt; I&amp;#8217;ve been testing some code that I was expecting to be optimised by &lt;span class="caps"&gt;GCC&lt;/span&gt;. I was surprised to find a lot of my testcases were not optimised at all.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m sincerely not sure whether these are due to errors on &lt;span class="caps"&gt;GCC&lt;/span&gt;, to me expecting the compiler to be smarter than it can feasibly be right now, or to the &amp;#8220;optimised&amp;#8221; code to be more expensive than the code that is actually being generated.&lt;/p&gt;


	&lt;p&gt;Take for instance this code:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default  prettyprint"&gt;int somepurefunction(char *str, int n)
  __attribute__((pure));

#define NUMTYPE1 12
#define NUMTYPE2 15
#define NUMTYPE3 12

int testfunction(char *param, int type) {
  switch(type) {
  case 1:
    return somepurefunction(param, NUMTYPE1);
  case 2:
    return somepurefunction(param, NUMTYPE2);
  case 3:
    return somepurefunction(param, NUMTYPE3);
  }

  return -1;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I was expecting in this case the compiler to identify cases 1 and 3 as identical (by coincidence) and then merge them in a single branch. This would have made debugging quite hard actually (as you wouldn&amp;#8217;t be able to discern the two case) but it&amp;#8217;s a nice reduction on code, I think. Neither on x86_64 nor on Blackfin, neither 4.2 nor 4.3 actually merge the two cases leaving the double code in there.&lt;/p&gt;


	&lt;p&gt;Another piece of code that wasn&amp;#8217;t optimised as I was expecting it to be is this:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default  prettyprint"&gt;unsigned long my_strlen(const char *str)
  __attribute__((pure));
char *strlcpy(char *dst, const char *str, unsigned long len);

char title[20];
#define TITLE_CODE 1
char artist[20];
#define ARTIST_CODE 2

#define MIN(a, b) ( a &amp;lt; b ? a : b )

static void set_title(const char *str) {
  strlcpy(title, str, MIN(sizeof(title), my_strlen(str)));
}

static void set_artist(const char *str) {
  strlcpy(artist, str, MIN(sizeof(artist), my_strlen(str)));
}

int set_metadata(const char *str, int code) {
  switch(code) {
  case TITLE_CODE:
    set_title(str);
    break;
  case ARTIST_CODE:
    set_artist(str);
    break;
  default:
    return -1;
  }

  return 0;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I was expecting here a single call to &lt;code&gt;my_strlen()&lt;/code&gt;, as it&amp;#8217;s a pure function, and in both branches it&amp;#8217;s the first call. I know it&amp;#8217;s probably complex code once unrolled, but still gcc at least was better at this than intel&amp;#8217;s and sun&amp;#8217;s compilers!&lt;/p&gt;


	&lt;p&gt;Both Intel&amp;#8217;s and Sun&amp;#8217;s, even at &lt;code&gt;-O3&lt;/code&gt; level, emit &lt;em&gt;four&lt;/em&gt; calls to &lt;code&gt;my_strlen()&lt;/code&gt;, as they can&amp;#8217;t even optimise the ternary operation! Actually, Sun&amp;#8217;s compiler comes last for optimisation, as it doesn&amp;#8217;t even inline &lt;code&gt;set_title()&lt;/code&gt; and &lt;code&gt;set_artist()&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Now, I haven&amp;#8217;t tried &lt;span class="caps"&gt;IBM&lt;/span&gt;&amp;#8217;s PowerPC compiler as I don&amp;#8217;t have a PowerPC box to develop on anymore (although I would think a bit about the &lt;a href="http://lwn.net/Articles/285538/"&gt;&lt;span class="caps"&gt;YDL&lt;/span&gt; PowerStation&lt;/a&gt;, given enough job income in the next months&amp;#8212;and given Gentoo being able to run on it), so I can&amp;#8217;t say anything about that, but for these smaller cases, I think &lt;span class="caps"&gt;GCC&lt;/span&gt; &lt;em&gt;is&lt;/em&gt; beating other proprietary compilers under Linux.&lt;/p&gt;


	&lt;p&gt;I could check Microsoft&amp;#8217;s and &lt;del&gt;Borland&amp;#8217;s&lt;/del&gt; Codegear&amp;#8217;s compilers, but it was a bit out of my particular scope at the moment.&lt;/p&gt;


	&lt;p&gt;If I did think a bit before about supporting non-GNU compilers for stuff like xine and unieject, I start to think it&amp;#8217;s not really worth the time spent on that at all, if this is the result of their compilations&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 14:41:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:76b1ce66-1fd9-4718-a2bd-7b4cdedad889</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/11/sub-optimal-optimisations</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/11/sub-optimal-optimisations#comments</comments>
      <category>Technical</category>
      <category>English</category>
      <category>GCC</category>
      <category>Optimisation</category>
      <category>Sun</category>
      <category>Intel</category>
      <category>C</category>
      <category>Compilers</category>
      <category>LWN</category>
      <category>SunStudio</category>
      <category>ICC</category>
      <category>SunCC</category>
      <category>Articles</category>
    </item>
    <item>
      <title>Recognising glibc 2.8 failures</title>
      <description>&lt;p&gt;Mike already wrote to gentoo-dev about the new build failures with glibc 2.8. Thanks &lt;span class="caps"&gt;GNU&lt;/span&gt;, really, for starting the long overdue cleanup.&lt;/p&gt;


	&lt;p&gt;I say long overdue because other C libraries like FreeBSD&amp;#8217;s and others already had headers that included the very minimum needed. So some of the issues that we&amp;#8217;re going to fix now were just as valid for FreeBSD and others.&lt;/p&gt;


	&lt;p&gt;So this is going to help portability to FreeBSD and viceversa, stuff already ported to FreeBSD should build just fine with the new glibc version.&lt;/p&gt;


	&lt;p&gt;As I&amp;#8217;m borderline masochist, I started looking at patches to see if I can easily tell if they are good and commit them myself as needed (yeah I know I step over lots of toes; with most people I got agreements before though, so sometimes it&amp;#8217;s just fine, beside as long as the patch works and I don&amp;#8217;t break stuff nobody complained recently ;) ).&lt;/p&gt;


	&lt;p&gt;One thing I noticed was a misfiled bug, it reported failure with glibc 2.8 when it was instead a failure with gcc 4.3. The issue is more or less the same, missing includes most of the time, because both projects cleaned up their header files, but it&amp;#8217;s important to know which package caused it to make sure that the faulty ebuild are all stable before gcc and glibc can make stable.&lt;/p&gt;


	&lt;p&gt;For the list of bugs caused by glibc 2.8 I refer you to &lt;a href="http://bugs.gentoo.org/show_bug.cgi?id=glibc-2.8;"&gt;the tracker&lt;/a&gt; as you can see there, the usual problems are:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;span class="caps"&gt;PATH&lt;/span&gt;_MAX undeclared;&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;ARG&lt;/span&gt;_MAX undeclared;&lt;/li&gt;
		&lt;li&gt;field &amp;#8216;reg&amp;#8217; has incomplete type;&lt;/li&gt;
		&lt;li&gt;storage size of &amp;#8216;peercred&amp;#8217; isn&amp;#8217;t known.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The solution for some of these issues is to add the right include (like limits.h), for others is to properly define &lt;code&gt;_GNU_SOURCE&lt;/code&gt; to get the &lt;span class="caps"&gt;GNU&lt;/span&gt; extensions enabled. Usually projects using autotools already have a check for that, but recent &lt;code&gt;autoconf&lt;/code&gt; versions use config.h to define that, and not all the sources include it.&lt;/p&gt;


	&lt;p&gt;On ebuilds you can work that around by using &lt;code&gt;append-flags -D_GNU_SOURCE&lt;/code&gt; but upstream should fix their source files by including config.h right at the start of every source file.&lt;/p&gt;


	&lt;p&gt;For failures related to C++ code, like undeclared &lt;code&gt;ostream&lt;/code&gt; or &lt;code&gt;cerr&lt;/code&gt;, the problem is &lt;em&gt;not&lt;/em&gt; with glibc 2.8 but with gcc 4.3 instead.&lt;/p&gt;


	&lt;p&gt;Enjoy!&lt;/p&gt;</description>
      <pubDate>Mon, 09 Jun 2008 13:06:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:505a1a1d-e1c6-4caf-832a-a5bf1884f5c4</guid>
      <author>flameeyes@gmail.com (Diego "Flameeyes" Petten&#242;)</author>
      <link>http://blog.flameeyes.eu/articles/2008/06/09/recognising-glibc-2-8-failures</link>
      <comments>http://blog.flameeyes.eu/articles/2008/06/09/recognising-glibc-2-8-failures#comments</comments>
      <category>Gentoo</category>
      <category>English</category>
      <category>GCC</category>
      <category>Cleanup</category>
      <category>GLIBC</category>
      <category>BuildFailures</category>
    </item>
  </channel>
</rss>
