In association with heise online

08 September 2008, 16:42

A First Extraction Of Chromium

Dj Walker-Morgan

Chrome is not Google's new open source browser. Chromium is Google's new open source browser; Chrome is the name of Google's branded binary release of the Chromium browser. Open source projects live or die by the quality of their community, and in the early life of a project, the quality of the developer community. The initial release and supporting documentation usually hint at how well developed the project will be. With that in mind, heise online UK set out to build Chromium from the available source code and see how difficult the process was.

Chromium, built from source
Zoom Chromium, built from source
Chromium.org is the community site for Chromium. This currently redirects to the Google Code project page for Chromium. Clicking on the "Getting Started" link takes you straight to the instructions for building the Windows version. The Linux and Mac OS X projects do exist, but they are in very early days. Assembling the prerequisites for the Windows version was fairly simple; Windows XP and Visual Studio 2005. As of writing, it's not possible to build Chromium with Visual Studio Express, but some developers are working on that to allow the package to be built "for free", without the cost of Visual Studio 2005.

Chromium requires Visual Studio 2005 Service Pack 1 and a particular Windows Vista SDK; the notes say that although the SDK says it is for Vista it is suitable for use on XP. Once those are installed, you would normally move onto downloading the code; that's not the case here. Google has, sensibly, identified that one problem with bootstrapping open source projects on Windows is the variation in tool-chains for the build process. To get around that, they have the Depot Tools; this includes gclient which manages checking code out of different repositories, gcl, for managing code reviews, hammer, a script for building code with SCONS and most importantly, on Windows only, a port of Subversion, the source code control system. The tools are self contained, all that is needed is that they are unpacked to a directory and that directory is added to the environment's PATH variable. When gclient is run for the first time, it automatically updates itself and the rest of the tools to the latest version.

Now we can download the source. There are two ways to do this; one is just to ask gclient to synchronise with the repositories, but this can take a very long time as the Chromium source code is composed of many many small files. To speed up the process, the developers have also supplied a tarball, an archive of a snapshot of the code base. This tarball is 437MB of compressed data, which expands to approximately 1.6GB when unpacked. Once unpacked, the user changes directory to the expanded source tree and runs gclient sync to synchronise that code base with the very latest changes. Google would prefer people use this method, as it's quicker and much more friendly on server resources.

The final stage in the build process on Windows involves loading a Chrome solution file into Visual Studio, setting a flag to stop it overwriting your Chrome profile, and pressing the debug button. And waiting. On our test laptop, a 2GHz Mac Book Pro with 2GB of RAM, a successful build took about twenty five minutes. We had a number of problems trying to build the code; if you don't have the right SDK installed, the failure message is a somewhat cryptic "negative subscript", though looking at the source code where that error was found showed it was an SDK test assertion, and comments above and below the line in question covered which SDK was required at that point. A similar error was generated with the lack of service pack 1 for Visual Studio 2005. The rule of thumb for initial build problems with Chromium can be summed up as "If it doesn't build, check the prerequisite packages really are installed".

The freshly built Chromium has only minor visual differences to Chrome; the Chromium name and a logo with the bright colours of the Chrome logo muted to produce the Chromium logo. Apart from that, the build feels identical to the downloadable Chrome. The big difference though is that unlike Chrome, a build of Chromium has no EULA attached to it; the Chrome EULA applies to Google's binary build of Chrome, not to the BSD licensed Chromium code base. A Chromium build still behaves the same way as Chrome though, generating an ID number for the user's login if one does not exist already, and talking to Google servers for auto suggest, enhanced 404 pages or downloading the malware/phishing database. Automatic updating of Chromium appears to be broken if you build Chromium yourself though.

Within the code, a cursory examination shows a well-organised project. Third party libraries are cleanly isolated; the Webkit code is in its own read-only tree with Google's changes in a separate tree. What may surprise people is the presence of Python 2.4 and Lighttpd which appear to be part of the test harness for Chromium, not built into Chrome. That there is an extensive test harness is a credit to Google. They could have easily shipped the code base as just the raw code with no tests and minimal build harness, but Google appears to understand the importance of making the build and test cycle available as part of the code for the browser.

Unit test results are all you get from Chromium on Linux
Zoom Unit test results are all you get from Chromium on Linux
For completeness, we built the current Linux Chrome code on Ubuntu Linux 8.04. The instructions were as clear as the Windows instructions, detailing what packages needed to be installed with an appropriate apt-get command and how to get the depot tools and code downloaded. The actual code when built using the hammer script produces only two sets of unit tests for the base and net packages, indicating that there is a lot of work to be done for Linux, and Mac OS X, Chrome. At least the Windows version of the code does produce a complete working browser which gives the developers a useful base line to work from.

Looking back, the only block to building Chromium on Windows for free is the need for Microsoft's Visual Studio 2005, but hopefully that problem will be alleviated in the near future. Apart from that, Chromium is looking like a good project for open source developers to work in on Windows. For Linux and Mac OS X, the foundations have been laid but that is all. The Chromium.org has sufficient documentation, including explanatory sections on how the browser works internally and how the components have been integrated; something many projects forget to publish in their early days. As a whole, the project seems to be on a good footing to build a substantial community engaged in extracting Chrome from Chromium.

Print Version | Permalink: http://h-online.com/-746398
  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit