Building Electrolysis

Electrolysis (e10s) code currently builds with full capabilities on the following platforms:

  • Windows using Visual Studio 2008 (VC9) and 2005 (VC8)
  • Linux x86 and x86-64

For Linux, we recommend using Ubuntu 9.04 or later or Fedora Core 9 or later, although you ought be able to build with older distros/gccs.

Building the Electrolysis branch is exactly like building normal Firefox: follow the build instructions, pulling your code from http://hg.mozilla.org/projects/electrolysis

  • Note:  Currently electrolysis requires libxul, so do not set --disable-libxul in your mozconfig.

Note: if you're going to be hacking the IPDL compiler, writing IPDL C++ tests, or using the IPDL unit test framework as a "protocol sandbox", you need to build with

ac_add_option --enable-ipdl-tests

Some of these unit tests can be expensive and are disabled by default.

Optimizing build time

Electrolysis requires libxul, which means any changes you make while developing require rebuilding libxul, which can be quite slow. If you're on Linux and ld takes enough memory (it needs 2 GB+) while linking libxul to cause swapping on your machine, consider adding the following to your mozconfig file (you will also need to rerun configure, which may require deleting '$SRCDIR/configure' and/or $OBJDIR/config.cache):

 export LDFLAGS="-Wl,--no-keep-memory"

You may also be able to avoid doing a full, top-level make by building only certain directories:

If you have made any changes to any protocol files (*.ipdl), then you must run

make -C [BLD_DIR]/ipc/ipdl

If you've changed the master ContentProcess.ipdl in dom/ipc, you must make there, too:

make -C [BLD_DIR]/dom/ipc

You'll need to rebuild in any directories that have other .ipdl files you've modified, too.

Finally, rebuild libxul:

make -C [BLD_DIR]/toolkit/library

The libxul build takes by far the longest of these three, so I just dump all three commands (plus a make for whatever directory I'm working in) in a script and run it each time to rebuild. Sometimes it doesn't work :(

Consider building on a faster machine if linking libxul is slowing your productivity. Some of us are allegedly on boxes where it takes only around 5 seconds...

Running Electrolysis

To actually use separate processes, for now you must take the following steps:

  • Run "$objectdir/dist/bin/firefox -P JunkProfile" and set the following pref using about:config (note: in this example we use a separate firefox profile specifically for running electrolysis, i.e. pass "-P JunkProfile" to this command and when we run the remote-tab demo)
dom.ipc.tabs.enabled: true
  • Close firefox. It will crash if you try to run it with that setting. Instead, you can run the specific following test:
  • Run the remote-tab demo with
cd $objdir/dist/bin
./firefox -P JunkProfile -chrome chrome://global/content/test-ipc.xul

To use OOP plugins set:

dom.ipc.plugins.enabled: true