Archive for category Programming

My thoughts on Fedora

I wouldn’t normally write this, but someone asked me what my thoughts are regarding Fedora and Ubuntu on IRC. A bit of background: I started using RHL 5.2 and stuck with it until Fedora Core 1 was out. I strongly disliked FC1 and moved to SuSE(9.1) and later Ubuntu. I used Ubuntu for a long time (5.04 until 8.04) then went back to Fedora in a big way (F8-F11Alpha, CentOS).

I guess what I love about Fedora is that it uses the latest versions of software because. Patches are either pushed upstream or killed. This means that the software is distributed as the authors intended. This also means that Fedora is a team player, Fedora gives back to the developers and respects the upstream developer’s judgement. This is important to me, especially as highlighted by the Debian OpenSSL kerfuffle. It is also interesting to note that much of the software used by Linux distributions was written by Fedora contributors.

Another thing is forward thinking. Fedora doesn’t worry about what we have now, Fedora is working on the future. This means that occasionally certain functionality is broken in a new version but in the long run the situation is improved. An example of this is the Plymouth boot screen application. It requires a relatively new feature (KMS, Kernel Mode Setting) to work properly. This doesn’t work with closed source drivers but it is definitely the way to go.

A post on the Ubuntu Brainstorm by ajjeckmans seems to sum up my thoughts of how ubuntu works in respect to their use of open source software “I support the idea but I do think that it should only be considered after Fedora has done all the dirty work of getting it to work at all :) ”. While this only be one user, it occurs in a setting that if anything, encourages this behaviour. This post highlights everything I dislike about ubuntu.

I also like that Fedora is purely Free and Open Source. Like being agile, this annoys some people, but I feel that this is probably the key differentiation between Fedora and ubuntu. Fedora will not bend on its promise to be free and freely distributable. ubuntu used to have this promise, but seemed to loose its focus when they started including proprietary drivers and even encourages their use with the ‘Hardware Drivers’ application. Again, they are becoming less worried about Open Source as if memory serves me correctly, it used to be called ‘Restricted Drivers’. This transforms proprietary software from “scary, don’t use this” to “par for the course”. This is highly indicative of the chant I seem to hear from the ubuntu ecosystem: “Make it work for me now! I don’t care how, I don’t care about helping out, I don’t care about the people who wrote this”. Maybe that is just my own cynicism.

Credit where credit is due though, ubuntu does put together a very polished and easy to use product. It is simply an amazing use of open source software, but it isn’t for me.

btw, the straw that broke the camels back: Alsa 1.0.16. Ubuntu 8.04 didn’t have it and Fedora 8 did. Without this version of Alsa, my desktop soundcard didn’t work at all and my laptop didn’t mute with headphones. Every time I look at Linux operating systems, I am thankful for this. I am also especially thankful for Red Hat’s support of an awesome project!

First Core i7 Mozilla build. It was quick!


I finally got my desktop back together with a shiny new Intel Core i7 920, 6GB of DDR3. I haven’t overclocked anything yet and my entire build tree and operating system is on one 7200RPM drive. This thing is really fast for builds! I just built Firefox in less than 5 minutes. I did make -s -j16 -f client.mk clean then time make -s -j16 -f client.mk build and got the following output.
real 4m50.217s
user 2m44.854s
sys 0m55.450s

I used this as my mozconfig:
#John Ford's MozConfig file

ac_add_options --enable-application=browser
ac_add_options --disable-tests
ac_add_options --enable-official-branding

mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@

I should have done a build before I went to the new hardware as a comparison, but my old hardware is essentially the same as liberia and china over at CDOT.

Grokzilla – Code indexing revisited

I finally decided to write a script to automate setting up OpenGrok for Mozilla’s Mercurial Repository. This script creates a new repository the first time it is run then updates it on subsequent runs. The output of all programs is logged to files to aid in debugging. To set this script up on a local machine you will need to have a Java Application Server, such as JBoss or Tomcat and all related dependancies (Java), Exuberant Ctags, bash, OpenGrok and Mercurial. The details of this script are posted on my Wiki page for it and I can be reached on Mozilla’s IRC in #seneca as John64 if you need a little help with it.

I’d like to take this further if it is seen as valuable to the Mozilla community. Currently, OpenGrok considers all top level directories to be a project within it’s code. I can change this to be whatever needed. I have a sample instance running at http://142.204.133.36:8080/grokzilla/ but that might be up or down depending on many things. It is very possible for me to theme the web application and if there is interest in setting up this for community use I am willing to work on that. Should I file a bug on Mozilla’s Bugzilla to track this? I don’t know.

Testing the gold linker on Mozilla

I decided it is time to do something that isn’t Fedora or JBoss related. I noticed that Dave Humphrey would like to test the new Gold linker included in binutils with Firefox.

I used kvm test this.
I launched kvm with sudo qemu-kvm -hda gold-tests -cdrom F10-Snap2-i686-Live.iso -boot d -smp 2 -m 3500. I installed the required software to build Firefox then make 2 additional copies of the hard disk image, giving me three in total. One as backup, one for regular ld and one for gold. I compiled binutils from source without using RPM because this is a one off test system which I don’t care about breaking. If I was going to continue using this system I would have modified the package descriptor for binutils to enable gold.

The Following packages were installed to facilitate compilation:

  • groupinstall “Development Tools”
  • gtk2-devel
  • libXt-devel
  • freetype-devel
  • dbus-glib-devel
  • alsa-lib-devel
  • curl-devel
  • ORBit2-devel

According to this news list post when you compile binutils you either get the regular linker or the gold linker. To do this you specify --enable-gold when running ./configure. I am going to install binutils using both to test both with the same version of binutils. I will start from my clean image each time.

Since the version of binutils in my installation is different to my tarball, i used the –version option to verify that it installed successfully. As suggested in the original contributions page, I will export LD=gold as an environmental variable, but only on the vm with gold for obvious reasons. I am compiling firefox with the default options from the tarball as ./configure --prefix=/home/jhford --enable-application=browser; time make -j8 -s > ~/mozbuildtime; make install. I also bumped my -smp flag to 4 to match my host and to ensure I get the best possible performance out of my vms.

Here is the time for a non-gold build.

real 9m3.720s
user 4m28.562s
sys 11m1.834s

And the times for a gold build I aliased ld to ‘ld –threads –thread-count 4′ for these runs as well as exporting LD=gold.

real 8m41.445s
user 4m18.749s
sys 10m45.263s

Initially, I was getting that gold was cutting my builds in half, but it turns out I accidentally did make with j4 instead of j8. I found that consistently, gold builds were faster but not by a substantial enough amount to justify having to manually enable it in your package manager of choice.

Compiz on Fedora 9

Since switching to Fedora I have figured out how to configure everything the way I like it, except for Compiz. I found that while Compiz works with Fedora out of the box, it isn’t configured as I like it, and the tool included only has support to enable a desktop cube and wobbly windows. The annoying thing is that there is a great program called ccsm (Compiz Config Settings Manager) which works out of the box on Ubuntu but wouldn’t work for me in Fedora. The program ran exactly as it should but none of the settings were applied. I started by installing fusion-icon and starting it. After doing this, I found that I had no window decorations. I fixed this by installing compiz-gnome which provides a program called gtk-window-decorator. This progam decorates windows, but it uses a very plain decoration which I don’t particularly like. My next attempt was to install the beryl emerald them engine. I have never liked emerald because of the themes available. I really wanted my metacity themes in compiz. After googling for a while, i struck gold! There is a gconf key to set gtk-window-decorator to use metacity themes

Here is the command to change the required key:
gconftool-2 -s /apps/gwd/use_metacity_theme -t bool true

Thanks to ‘David’ for his post on OSDir.com