Sunday, June 22, 2008

Mozilla Dev Kit ... and Scratchbox?

Seeing a post on the Mozilla Developer Kit (MozDevKit? MDK?) has gotten me very psyched. I have been trying to add some things to the developer doc site. I see, for example, a lot of really good information in blog posts and then the corresponding DevMo pages are ... not so up-to-date. In general, there is much that can be done to make developing Mozilla more accessible to people and MDC does not get as much love as it deserves from people who are doing development and should therefore be able to write. But they probably have no time to doc because they are, you know, coding. It is a conundrum.

But build environments are complicated. How can setting up such an environment be made easy?

Can a Mozilla development kit can be set up in a trackable, verifiable, chroot-ed environment using a tool such as scratchbox? I have been trying to get a xulrunner (FF Mobile) build working to an embedded device using scratchbox and it has been challenging, to say the least, but interesting. Tools like scratchbox or crosstool seem a very good idea. And every production build environment, such as the one I used while I was in the Dev Tools group at Apple, uses a verifiable, chroot-ed environment. It is really hard to get reproducibility without it, and without reproducibility, it is really hard to help anybody who has problems. This is why most responses to build issues on the newsgroups consist of 'please set up X, Y, and Z, and do A, B and C, and see if that helps....'

Also, the usual use of scratchbox is to build on host A for a different architecture, target B. But A and B can actually be the same. MoCo builds Linux binaries on Linux and Mac OS X binaries on Mac OS X, but that does not have to be so. Of course, scratchbox is very Linux-centric. And I see that a Linux version of the MDK is the first item listed on the aforementioned blog post. This is probably true because Linux is amenable to scripted, verifiable building. But it would be interesting (perhaps for only me) to consider how a scratchbox on Linux could build Mac OS X binaries, or how a scratchbox on Mac OS X could build binaries for either Linux or the Mac. And of course, some might be interested in making Windows development possible, but that is way beyond my bailiwick. Yo no hablo Microsoft and I am just fine with that. Can you imagine, for example, getting the Microsoft development tools into a scratchbox environment? I cannot, and I am sure it would be ugly, but it might be possible.)

Downloading a single file, launching it and then finding oneself in a known, trackable, verifiable virtual host for building Mozilla apps seems a compelling opportunity.