Building All the Major Open-Source Web Browsers
An anonymous reader writes: Cristophe de Dinechin, long-time software developer, has an interesting article on the processes involved in building the major browsers. From the article:
"Mozilla Firefox, Chromium (the open-source variant of Chrome) and WebKit (the basis for Safari) are all great examples of open-source software. The Qt project has a simple webkit-based web browser in their examples. So that's at least four different open-source web browsers to choose from. But what does it take to actually build them? The TL;DR answer is that these are complex pieces of software, each of them with rather idiosyncratic build systems, and that you should consider 100GB of disk space to build all the browsers, a few hours of download, and be prepared to learn lots of new, rather specific tools."
"Mozilla Firefox, Chromium (the open-source variant of Chrome) and WebKit (the basis for Safari) are all great examples of open-source software. The Qt project has a simple webkit-based web browser in their examples. So that's at least four different open-source web browsers to choose from. But what does it take to actually build them? The TL;DR answer is that these are complex pieces of software, each of them with rather idiosyncratic build systems, and that you should consider 100GB of disk space to build all the browsers, a few hours of download, and be prepared to learn lots of new, rather specific tools."
cd /usr/ports/www/firefox && make install clean /usr/ports/www/chromium && make install clean /usr/ports/www/webkit-gtk3 && make install clean
cd
cd
Wasn't that hard.
Of course, if you use a source-based distribution, it's easy, but that's not the point. If you download the source and build it yourself, you'll have to learn a bit about how they manage the build environment. You'll have to handle being sure all the dependencies are installed. You'll have to figure out any configuration options.
That's exactly what people who make distributions do. If you want to see how complicated the build is for any piece of software, just look at how complicated the build scripts are for various distributions. I expect you can find these for the binary distributions. With Gentoo, just look at the ebuild file.
So it's simply emerge --update world* but I always groan when I see Chromium has a new version, which it does almost weekly, because it takes approximately FOREVER to compile. Firefox and Seamonkey take a long time, sure, but Chromium, yikes, come back tomorrow.
*Actually, it's: emerge -v --deep --newuse --with-bdeps=y --update world 2>&1 | tee update-world-deeper-`date +%F`.log, but that's just me.
File it under "stuff that matters".
A lot of arguments for open source are based on things which people outside the project could in principle accomplish, but in practice seldom do. So it's reassuring at least that an experienced developer can build the two most popular browsers from scratch. It means the arguments aren't hollow. I've seen closed source projects that were purchased by companies, only to find out that getting them to build on any computer but the one it was developed on is a serious engineering challenge.
That the process of building these browsers from scratch is somewhat arcane will come as no surprise to any experienced developer. But that it's not so arcane that it's impractical to figure out is good news.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
Heck, the whole process to build Qt and its browser-du-jour (webkit then, chromium now) amounts to configure followed by make, and that's whether you're on Windows or Unix.
A successful API design takes a mixture of software design and pedagogy.
Let's hear from a frequent contributor first
Is it just me or isn't there hardly an content in that blog-post? What is the significance?
The significance is that Open Source doesn't automatically mean not bloated. Just see Mozilla, Open/Libre Office etc.
This space for rent.
There's software for auto-detection of necessary libraries (cmake is probably the best, since it's more portable than autoconf).
If you've the source tree, then you should require one single platform-dependent package containing cmake, gnu make, curl or wget, grep, cut and associated libraries, along with a text file containing a list of dependencies, where to get them and where to put them.
Your build system then scans for everything needed. If you've got it, it uses it. If you don't, it fetches the source, builds it and installs it.
This is not rocket science. Gentoo has been doing something similar for a very long time, so has Perl, so has Cygwin and Cygwin-based packages like OSGEO4W.
Yes, it's slow. Yes, it means the browser maintainer has to have a text editor. Yes, it's going to be as painful and agonizing as installing X11R4 or GateD. I did both. On a 386SX-16. Uphill. Both ways. In the snow. If you can't write your code properly to begin with, get off my lawn!
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Are you a frequent contributor? No? Okay, well shut the fuck up and let Bennett weigh in on this.
There are some really great distros that are based on said sources:
Pale Moon is an open source alternative to FireFox:
http://www.palemoon.org/
SRWare Iron is a Chromium project:
http://www.srware.net/en/softw...
What's the command to download and install a desktop application package (in this case Visual Studio Express) from Microsoft's repository?
I have to say, as what people here would probably regard as only an amateur programmer, the setup of a build environment and initial compiles suck up way, way more time than they need to.
It's extremely frustrating. C is a wonderful language that I love to program in. There are compilers on every platform. There are cross-platform libraries for anything I need and my favourite IDE is cross-platform.
But actually getting basic shit to work is an absolute nightmare. And that's the stuff that I'm familiar with. It involves far too much pissing about with paths, switches, versions, system-level installations, scripts, extra options and all kinds of voodoo to make what I know works work how it should. And I often have to replicate it for every new project.
Fuck knows what it's like when you go multi-language, when you go to more obscure platforms, and when you're not familiar with things or am using someone else's code without the benefit of knowledge of their build environment.
I consider it the weak-point of open-source. Like science, one of the big pluses of open-source is reproducibility. You got working code? Good. Then so do I. All I need to do is make it compile. The problem is that "All" in that sentence.
There are languages that encapsulate more into the language but even that causes problems. I've fought with Java environments where the JRE and JDK differ and are in multiple versions, have architecture differences, and require explicit paths, and all kinds of nonsense. Python can be a fucking nightmare on Windows. Even shit like Cygwin interferes with ITSELF on Windows systems.
I don't know what the solution is, but I can't help but feel it's outside the language - it's in the system design and OS interaction. Operating systems just aren't designed with source being a big part of the end product.
Maybe the solution is one of the ideas I constantly toy with (and almost certainly has been done in the 60's on some archaic architecture) - an executable format that incorporates the source as well as the binary. When the executable moves to a new platform, the binary and source visibly differ and the binary can be recreated from the source. To do that requires complete encapsulation of all source, options, compilers and everything else into the executable.
But I'm sick at getting something as standardised as SDL working on the three big platforms (Windows, Mac, Linux) in using one of the largest open-source IDE's (Eclipse) utilising an industry-standard compiler (GCC). It should NOT be as hard as it is.
Idiosyncratic builds is not limited to just browsers and is probably the biggest problem faced by Open Source projects today.
I use open source tools daily and yet with 20 years development experience I have yet to fine one open source project that straightforward to build.
Funny thing is, I don't actually remember why - other than there was some feature that wasn't available in the default build back then (Keychain integration, perhaps?)
Anyway, there were a number of libraries and other packages that had to be added to the system in order for the build process to succeed... but I don't remember it being all that difficult to do. Time consuming, yes - but not difficult.
#DeleteChrome
OK. And how about built one from scratch?
That the process of building these browsers from scratch is somewhat arcane will come as no surprise to any experienced developer. But that it's not so arcane that it's impractical to figure out is good news.
it sounded very impractical. FTFS: "these are complex pieces of software, each of them with rather idiosyncratic build systems, and that you should consider 100GB of disk space to build all the browsers, a few hours of download, and be prepared to learn lots of new, rather specific tools."" I'd say it's good that open source browsers are not impossible to build. But this is no apt-get or whatever people say.
The Surf webkit browser source is 96kb (788kb with the full commit revision history).
Good luck with your bloat.
surf.suckless.org
I absolutely agree.
The solution necessarily involves three mechanisms:
* Determining what is present
* Fetching what is absent
* Isolating everything that is build-specific
The "tradition" established by CPAN, CPyAN and CTAN is that source packages should specify dependencies - not only the software name, but the range of versions permitted. Archives should then permit requests for specific versions.
Isolation (such as by root jailing) deals with file path issues, software interactions, etc. All the build system should be able to see is the software the build system needs. Nothing more.
Determining what is present is more complex. The software must see what options exist that are compatible and then, through build flags, defaults and user queries, determine which of those options to actually use. If you're using Windows and have GnuWin32, Cygwin and MinGW installed, it's no good just asking if Gnu build tools are to be used.
Installs and deinstalls are platform-specific, it's best if generic package installers for each platform took care of the databases and links. If you can find any. Seems to be a shortage in useful tools.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
If there isn't a well-documented, repeatable build process, then it's not "engineering" AT ALL.
These are my friends, See how they glisten. See this one shine, how he smiles in the light.
...last time I tried
apt-get source --build iceweasel
apt-get source --build chromium
apt-get source --build webkitgtk
it worked perfectly fine - what's the issue?
Well, as the author of the blog post, I did not intend this post to go on Slashdot. It was just a note-to-self about the various commands and build steps involved. Because they are, well, complicated.
In the grand scheme of things, the significance behind this is that I plan to open-source Tao, the 3D document description language invented by Taodyne, with the intent to be able to integrate it into at least one web browser. More details about why Tao would make a difference for the web here: http://www.taodyne.com/shop/de... (and in the follow up article). More details about how it works for a developer here: https://www.youtube.com/watch?....
-- Did you try Tao3D? http://tao3d.sourceforge.net