Sunday, November 02, 2008

The status of Chromium on Linux

When Chromium was first announced in the beginning of September I was very surprised that it was a Windows only application given that WebKit is very much cross platform. The past few weeks I have been spending a little bit of time here and there hacking on the source code and thought I would write an update for those who are interested on the status of the native port of Chromium on Linux.

On day one you could checkout the source code on Linux and you could build some things. Of course all that you were building were some object files, nothing more, not even Webkit was being built. There was no test application, no linking and no Chrome.

From what I can tell nearly all of the development for Chrome was done on Windows in Visual Studio. There is even a c# tool that can be found in the sources. This lead to the case where the normal course of action when something didn't build on Linux was to just disable it. So by the time that the release was made nearly nothing was being built. I am also pretty sure that the Chromium port was entirely different then the Android port

Starting with the glue directory I went file by file fixing the compiler errors. Developed in Windows there was fun fixes such as the Windows "String.h" include that was not used, but caused build breakage on non-Windows platforms. Many patches later a lot more builds and Linux. Linux is part of the build farm so as each file was fixed and enabled it became one more file that Windows developers could not break or their change would be reverted. The Chromium developers had also been syncing up with WebKit trunk and so the Chromium fork of WebKit also built. Attempting to link a test application we found only 500 missing symbols. Tracking these down one by one and either porting, fixing or adding a stub the test application finally linked about a week ago. It can't do anything and will crash, but that is where we are. (update: Pointed out by Evan as of Friday it can render google.com.)

Beyond a webkit test application, Chrome on Linux is far away from happening. There are still a large number of basic components such as fonts, clipboard, plugins, and basic widget handling that have to be implemented. The test application is only a test for WebKit. In the next month or so you should be able to see WebKit rendering and at some point next year a beta of Chrome on Linux will be running, but it wont be tomorrow or next week.

Sharing some of the same code OS X is in the same boat, but they are a little better because they can re-use the OS X WebKit code, they currently can render pages, but can't do things like click on links.

Things are not as bad as they sound. The Chromium team is a good team that is moving forward quickly. As they integrate more with upstream WebKit more of the Linux port will work. They are also re-writing chunks of their code to be more cross platform friendly. And now that OS X is kinda working and Linux links there is a lot more interest in putting developer time on the Linux port to get things done.

An important lesson that Google should take away from this is the importance of developing cross platform software on all platforms at the same time. Assigning just one guy six months ago to the Linux port would have significantly improved the source on day 1. Having the build bot catch errors early such as using a Windows only function rather then a C function pays off in developing cross platform code. The sad thing is that any company that does cross platform development could have told them this without them having to learn it the hard way.

If you are interested in helping with Chromium and want to hack in git rather than on svn, an official mirror that is updated every other minute is now on github:
http://github.com/chromium/chromium/tree/master

I have written up getting started instructions and created a script to upload (and update) patches from git here:
http://github.com/icefox/chromium_tools/tree/master

Thanks to the guys on #chromium-dev who are very patient and helpful.

18 comments:

D Anderson said...

Benjamin,
Thank you for all of your hard work!

I thought Google was in tight with the open source world and would have provided for this in some way concerning Chromium and *nix.

I have seen other neglect of *nix with regards to drivers as I'm sure you are aware.
I purchased a Kodak printer early last year and have since become a big fan of Ubuntu. Alas, Kodak has refused to release Linux drivers for their printers. Now I have a printer with affordable ink that I can't utilize unless I boot into XP and thats a pisser!

Evan said...

For what it's worth:

1) Your info is a bit out of date: as of last Friday test_shell can render google.com into a recognizable form. There's no way to interact with the page, the image's colors are wrong, we have no form controls, etc. etc. but it seems likely that can all be fixed rapidly.

2) Plenty of people on the team have experience with cross-platform development. Engineering is all about making tradeoffs.

Volo said...

Chrome is dead. Let's face it. They should have started from the get-go by building it in cross-platform C++. To think that they only focused in doing it in C# and Visual Studio is a joke. What were they thinking -- do it in C# and then use Mono for Linux? Ha! That's a joke.

As is, it will take at least 2 years for a port to happen on the Mac or Linux.

So, to me, I look at Chrome as just something to challenge IE's marketshare on Windows just long enough for FF to gain marketshare. Perhaps that might come true. At that point, perhaps Google can jump onto the FF project and introduce Chrome ideas into FF to make it even better.

As a developer, I don't like having to do all this cross-platform testing with the various browsers, so seeing Chrome entered the market really sucked for me. However, if it chips away at IE's stupid marketshare, then I guess I can overlook my other frustrations with Chrome.

Benjamin Meyer said...

Evan: out for a few days to work on some other stuff and that happens! :D I'll have to build it in the morning.

I am not saying that Google should have had the Linux port working on day one, just that the state of the Linux port on day one was a bit surprising. I would think getting another dev wouldn't be a problem for Google.

Volo: Chrome is not dead. There was only one minor tool in C# which I think isn't even part of the browser, just a debug tool. It wont take two years, but it wont be tomorrow either. Talking with other people it seemed the consensus was that Chrome was 'days' away from working on Linux which is part of the reason I wrote the blog to shed some light on what the current status is so when Christmas comes around and the Linux port isn't there people are not scratching their heads.

NotZed said...

"Plenty of people on the team have experience with cross-platform development. Engineering is all about making tradeoffs."

Well, I guess they used their experience to completely trade off cross-platform support for Visual Studio and Windows then?

I was quite disappointed (to say the least) when looking into the source early on at just how windows-centric it was. I was hoping something would be usable fairly quickly, but sadly this was not the case. It is a real pity since it has the potential to mix things up a bit - on a GNU system, firefox is a poor cousin to other platforms, and we're crying out for a decent browser and decent application platform for that matter.

I guess it will get there eventually - but retro-fitting cross platform support is a hell of a messy way to do things.

Thanks for the update Benjamin - there seems to be no official place this is tracked.

Luis Augusto said...

Of course is Windows centric... Come on, let's be real, Windows market share is 95%, they already have 1% of the web browsers market share, they would need every single one Linux user to make that.

Volo: Firefox it's a crap, Opera, Safari, Konqueror, Epiphany and specially Google Chrome wipe the floor with it.

Manish said...

Firefox it's a crap, Opera, Safari, Konqueror, Epiphany and specially Google Chrome wipe the floor with it.

Have you gone nuts? Firefox is still better than Konqueror, Ephiphany and Safari. Chrome is altogether different story.
The only browser that can challenge is Opera since it can open pages even on low bandwidths internet connection.

joshyMinor said...

I finally made the switch to Linux about 3 weeks ago and LOVE it. Wish I would have done it YEARS ago.

JIff
www.Privacy-Center.net

Vadim Peretokin said...

Thank you for the update.

One thing that really bothers me about Firefox on Ubuntu is that it has it's own dictionary, unlike all other programs (like the the text editor and pidgin).

It would be great of Chrome didn't do that and use the same dictionary, because having to add the same word twice can get rather annoying.

guzzi said...

I'm surprised they didn't use Qt4

Luis Augusto said...

Guzzi: Yeah, me too.

Vadim Peretokin said...

I'm not, given qt's poor desktop integration and a bug on broken rendering with nvidia drivers.

Luis Augusto said...

The bug isn't Qt problem, it's NVidia problem, and its desktop integration is not bad at all.

Vadim Peretokin said...

The desktop integration is poor; because Qt applications look different than other ones.

I fail to understand why did Qt have to use known-buggy functions, when as other programs show, there are non-buggy ways to go about doing things.

Luis Augusto said...

Yes, that's right, lets limit the development because of the bugs other people made :)

Qt 4 integrates perfectly with OS X and Vista, obviously with KDE too, and GTK now is in the list too.

What are you talking about?

Ariya Hidayat said...

Bravo! Keep up the good job!

Hannson said...

@ QT4

My guess one reason Google didn't go with QT4 (besides any technological reasons) are licensing fees.

QT4 isn't free for commercial use and Google Chrome is proprietary and likely considered commercial, even though the open source version Chromium is free (as in freedom).

Benjamin Meyer said...

@Hannson
You do know that Google has many licenses for Qt already, for Google Earth.

http://qtsoftware.com/qt-in-use/story/app/google-earth

This really isn't about Qt, but about focusing on Windows first and foremost and only after announcing the project even thinking about the other platforms.

Popular Posts