Archive for the 'Mozilla' Category

Getting mozilla-central with limited bandwidth

Thursday, June 5th, 2008

Recently we opened up mozilla-central for checkins for Mozilla 1.9.1/Firefox.Next. As people on IRC have started using the repository, one of the major complaints has been that cloning the entire repository for the first time can take a very long time over a slow network… and for flaky networks, it may be impossible to clone at all.

There is a solution: instead of cloning directly from hg.mozilla.org (hg clone http://hg.mozilla.org/mozilla-central/), download a changeset bundle and unbundle it to create a local repository.

  1. Download a mozilla-central bundle. For the moment, I’m hosting one here. I’m going to ask the mozilla release team to produce one nightly and host it on the mozilla FTP server. The bundle file is approximately 65MB.
  2. Create a new, empty repository:
    $ hg init mozilla-central
  3. Un-bundle the real mozilla-central changes to that repository:
    $ cd mozilla-central;
    $ hg unbundle /path/to/mozilla-central.bundle
  4. Tell mercurial where you normally want to pull from by copying the following content into your mozilla-central/.hg/hgrc file:
    [paths]
    default = http://hg.mozilla.org/mozilla-central/
  5. Pull any additional changes that happened since the bundle was created:
    $ hg pull
  6. Update your working directory to the latest change:
    $ hg up

    Happy hacking!

Google-cache-only spam?

Friday, May 30th, 2008

A helpful soul contacted me on IRC today: it turns out that the google cache for my homepage shows linkspam.

There is no linkspam just viewing the page. There is also no linkspam if I wget the page using the googlebot useragent.

But I’m not the only one affected by this linkspam. Very similar linkspam shows up on simplepie.org and svg-whiz.com.

The common denominator seems to be that we all use DreamHost for web hosting. I submitted a ticket with DreamHost yesterday: their support staff responded that this must not be a DreamHost issue, and it must be a problem with Google. I am extremely disappointed with DreamHost right now.

Has anyone heard of similar linkspam that only shows up for the Google webcrawler, but not for normal visitors? What other ways could it detect the googlebot, other than via useragent?

Automatic Smart Folders

Tuesday, May 27th, 2008

In Thunderbird, I frequently want to see a list of messages I’ve sent or received from a particular person. For people I talk with regularly, I can do this with a manually set-up smart folder:

  • Match any of the following
    • From contains user@tld.org
    • To or cc contains user@tld.org

But really, I don’t want to set these up manually. I just want an easy context menu item to see all the messages from/to a particular person. I searched addons.mozilla.org but couldn’t find what I wanted.

Also, why can’t smart folders/saves searches in Thunderbird show a threaded view?

Madeleine Young Smedberg

Wednesday, May 7th, 2008

Suzanne and I are pleased to announce the birth of Madeleine Young Smedberg, born 7 May A.D. 2008 at 12:26 a.m. 7 lbs. 4 oz., 20 inches. All are well.

Madeleine Young Smedberg

Things I’ve Learned

Friday, May 2nd, 2008

Tricks of the Mozilla build system: myconfig.mk and myrules.mk

Friday, May 2nd, 2008

There are lots of hidden corners in the Mozilla build system. I’m starting a little series about some of the cool and unexpected things you can do with it. Of course, the series is mostly going to be “see the document I just wrote on the Mozilla Developer Center”!

First up: myconfig.mk and myrules.mk. Did you know that you can add arbitrary rules and change arbitrary variables in the Mozilla build system without editing your source tree? You can, by simply dropping a myconfig.mk or myrules.mk file in the objdir/config directory. Let’s say you want to define PL_DHASHMETER in all of Mozilla, so that you can then run Mozilla and collect hashing statistics.

Copy the following file to objdir/config/myconfig.mk:

CFLAGS += -DPL_DHASHMETER
CXXFLAGS += -DPL_DHASHMETER

This is not a very impressive example, because you could achieve the same effect by exporting CFLAGS and CXXFLAGS in your environment before configuring. So check out the Mozilla Developer Center article, which has two additional examples adding a new makefile target and altering build rules to save static analysis output to disk.

Brainstorm of possible improvement: load application/app-config.mk and application/app-rules.mk for application-specific build configuration and build rules.

More Changing of the Guard: Ted Mielczarek

Wednesday, April 30th, 2008

preed’s post about a new owner for the Build & Release module in Mozilla reminded me to announce more officially that I’m handing over ownership of the Mozilla “Build Config” module to Ted Mielczarek (ted on IRC). Ted has been involved with the Mozilla project for a while, and has done great work with the build system, Breakpad, and other projects.

Being owner of several large modules is tough: it’s hard to just keep track of everything that’s changing in Build Config, “the toolkit”, and XPCOM, let alone provide effective leadership. I’m blessed that I can transfer part of that responsibility without fear. It will allow me to focus my efforts more effectively, particularly to lead some of the architectural changes we’re making for Mozilla 2.

Congratulations Ted!

Automatic Rewriting

Thursday, April 24th, 2008

100% CPU - 8 cores

Automatic rewriting uses as much CPU as you can throw at it… a full automatic rewriting pass takes about an hour on this 8-core machine.

Reviewing Merges in Mercurial

Thursday, April 17th, 2008

In the brave new world of distributed version control, history is no longer linear. It can branch freely, under no central control. But what is perhaps more interesting is that you can merge disparate branches back together. This makes it much easier to do long-term feature work, because it is possible to track a moving target. For the ActionMonkey project, we are following a procedure where all changes are reviewed before they are pushed to the actionmonkey branch. This means that we won’t have a huge blob of changes that need review before they are integrated into mozilla-central.

This creates a new class of problem: how do you perform merges? Is it necessary to review merge changesets with the same rigor as regular changes? How would one actually go about reviewing a merge changeset?

Today, I wanted to update ActionMonkey with the latest changes from mozilla-central. There is enough divergence between ActionMonkey and Mozilla 1.9 that this is not always a simple task: fortunately for me, the only conflicts that required any real merging were fairly simple. I went ahead an performed the merge and did some basic testing. But I really want Jason Orendorff to review my changes for sanity. There is no simple way to see what I actually did:

Merge graph of actionmonkey

It isn’t hard to diff this changeset against its mozilla-central parent, or against its actionmonkey parent. But neither of these diffs give you a sense of the real work involved in the merge. What I really want to give to Jason is a static view of a three-way merge as it already happened, highlighting the source locations where I made conflict resolutions or manual changes. Does anyone know if such a tool exists for Mercurial, or for any other distributed version control system?

Because I don’t know of a tool like this, I did the next-best thing: in my checkin comment, I carefully listed every file and function where I made a conflict resolution or manual change. This will at least make it clear in the future where I may have goofed.

Microsoft Header Bingo

Wednesday, April 16th, 2008
atlbase.h
(ATL)

oleacc.idl
(Accessibility IDL)

wpcapi.h
(Windows Vista Parental Controls)

CRT sources
(optional, needed for jemalloc)

Notes
VC++8 Express (needs separate SDK) No

No

No

No
VC++8 Professional with SDK

Yes

Yes

No

Yes
Windows 2003R2 SDK

Yes

Yes

No

No
Windows Vista SDK (6.0)

No

No

Yes

No
Windows 2008 SDK (6.1)

No

Yes

Yes

No

MozillaBuild doesn’t detect the presence of this SDK (yet)
VC++9 Express (needs separate SDK) No

No

No

No

Neither VC9 version builds Mozilla correctly yet: they embed duplicate/incorrect manifests by default
VC++9 Professional with SDK

Yes

Yes

Yes

Yes

Developers were trying to build Mozilla on Windows and having failures 75% of the way through the build process, with error messages about missing headers. Depending on their configuration, any of the headers listed above may have been missing. I know MS tries: this is not malicious breakage on their part, just a side effect of releasing very complex systems. But boy can it be frustrating at times. Right now we’re in a situation where you can’t build Firefox using free tools and only a single SDK, because the newer SDKs don’t have ATL and the older SDKs don’t have wpcapi.h for Windows Vista parental controls.

To fix the problem, you need to install both the Windows 2003 SDK and the Windows Vista SDK. Ted Mielczarek is working on doing a quick release of MozillaBuild 1.2.1 which will support loading multiple SDKs into your build environment. Until then, there are some custom start scripts available.

I also added some configure checks so that we can detect the absence of these header files when you first start building. This will hopefully reduce the pain and wasted developer hours futzing with headers and build environments and trying an hourlong build process again to “see what happens”.