Mobile/e10s: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(48 intermediate revisions by 8 users not shown)
Line 1: Line 1:
* outside depends
This page is about the port of Mobile Firefox ([[Fennec]]) to the [[Electrolysis]] (e10s) multi-process architecture.
** session history does not work (places/shawn)
** iframe panning does not work. (layers)
** places do not work (places)
** ssl cert dialogs (jason)
** canvas issues (joe)
*** callback happens just before paint (old tiles are shown and then repainted)
*** garbage when drawing only part of the tile
*** panning needs to be faster
** leaking?  performance seems to get worse over time, quickly. (bsmedberg)


== Weekly Meetings  ==


* unowned tasks
The weekly meetings have been merged into the [https://wiki.mozilla.org/Mobile/Notes general mobile engineering meeting].
** Intermittent scrolling problem with autocomplete widget (?)
The archived meeting notes can be found at [[Mobile/e10s/Notes|Agenda and notes]]


* ben
== How to build ==
** Bug 547791 - Bogus let assertion (ben)
** Doesn't show title of page (ben)
** search buttons do not do anything (ben)
** url fix up does not work (ben)
** scroll syncing does not work (ben)
** zooming to an element does not work (ben)
** highlighting elements on mousedown (ben)
** stop control does not work (ben)
** leaving Bookmarks view doesn't work (ben)
** js alerts (ben)
** checkerboarding happens a lot (ben)
** favicon
** select boxes (ben)


* dougt
=== Setting up scratchbox (for Maemo devices only) ===
** fennec executable does not work (dougt)
** offline mode / autodialer doesn't work. (dougt)
** keyevents may not work.  focus may not work. (On Linux? really? please file bugs and CC :smaug) (dougt)
** about:fennec does not work (dougt)
** saving page state on low memory (dougt)


To build Fennec for Maemo devices like the N900, Nokia uses a scratchbox environment that keeps all of its packages separate from your Linux distribution.  So you must:
* Have Linux on your machine or in a VM
* Set up scratchbox, which is a little painful


Below is the condensed version of [http://wiki.maemo.org/Documentation/Maemo5_Final_Installation Maemo install guide], intended for Ubuntu users.  If you have questions or need something a little different, it is a good reference.


* How to build
<pre>
** pull e10s repo
#
*** http://hg.mozilla.org/projects/electrolysis
# Scratchbox: install these before doing your Maemo 5 scratchbox.
** pull e10s patch queue and apply
#
*** http://people.mozilla.org/~dougt/random/e10s/
 
** pull e10s fennec repo
# Install instructions for scratchbox itself. Only need to do these steps once.
*** http://hg.mozilla.org/users/pavlov_mozilla.com/mobile-e10s/
sudo echo "deb http://scratchbox.org/debian/ maemo5-sdk main" >> /etc/apt/sources.list
** mozconfig:
sudo apt-get update
*** http://people.mozilla.org/~dougt/random/e10s/mozconfig
sudo apt-get install scratchbox-toolchain-cs2007q3-glibc2.5-arm7
 
# Needed for Ubuntu.
sudo echo "vm.vdso_enabled = 0" >> /etc/sysctl.conf
sudo echo "vm.mmap_min_addr = 4096" >> /etc/sysctl.conf
sudo sysctl -p
 
#
# Maemo 5.0 scratchbox
#
wget http://repository.maemo.org/stable/5.0/maemo-scratchbox-install_5.0.sh \
  http://repository.maemo.org/stable/5.0/maemo-sdk-install_5.0.sh
sudo sh ./maemo-scratchbox-install_5.0.sh -s /scratchbox
sudo /scratchbox/sbin/sbox_ctl start
 
# If this is your first scratchbox installation, run this and re-login.
sudo /scratchbox/sbin/sbox_adduser $USER yes
 
sh ./maemo-sdk-install_5.0.sh
 
</pre>
(Note that for this to work, you need to logout and login - opening a new terminal is not enough. The Nokia instructions now continue...)
<pre>
 
#
# Run /scratchbox/login.  You are now chroot'ed inside scratchbox environment.
#
sb-conf setup FREMANTLE_ARMEL -c cs2007q3-glibc2.5-arm7 \
  -d qemu:perl:debian-etch:doctools:svn:git -t qemu-arm-sb
wget http://repository.maemo.org/stable/5.0/armel/maemo-sdk-rootstrap_5.0_armel.tgz
sb-conf select FREMANTLE_ARMEL
sb-conf rootstrap maemo-sdk-rootstrap_5.0_armel.tgz
sb-conf install -edFL
 
# Unfortunately anything built with QT requires a EULA.
# Here you will need to go to http://tablets-dev.nokia.com/eula/index.php and
# accept their EULA. Add the deb repo you subsequently receive to /etc/apt/sources.list
fakeroot apt-get update
fakeroot apt-get install nokia-binaries nokia-apps
</pre>
 
For Fennec e10s, you will need to install some additional packages.
 
<pre>
# You are still logged in to scratchbox, right?
fakeroot apt-get install libqt4-dev libqt4-gui \
  libxaw7-dev libfreetype6-dev libxi-dev \
  libhildonmime-dev libosso-dev libidl-dev liblocation-dev \
  libasound2-dev libhildon1-dev libiw-dev \
  libxdamage-dev libxcomposite-dev libnotify-dev libhildonfm2-dev \
  libconic0-dev python
</pre>
 
=== Getting the source ===
 
Get mozilla and mobile projects off mercurial:
<pre>
hg clone http://hg.mozilla.org/mozilla-central
</pre>
 
=== Building for desktop ===
 
Ubuntu package dependencies:
 
<pre>
# Basic Firefox deps
sudo apt-get build-dep firefox
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev \
  libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13
 
# QT deps
sudo apt-get install libqt4-dev
</pre>
 
Create your .mozconfig in your mozilla-central directory. Your .mozconfig should look something like this:
 
<pre>
# For improved compile speeds, all optional.
export CCACHE_HARDLINK=1
export CC="ccache gcc"
export CXX="ccache g++"
mk_add_options MOZ_MAKE_FLAGS=-j3
 
# Make build w/ symbols.
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --disable-debug
ac_add_options --enable-debugger-info-modules=yes
 
# important mobile options
mk_add_options MOZ_OBJDIR=mobilebase-qt-@CONFIG_GUESS@
ac_add_options --enable-application=mobile
 
# important qt options
# XXX QT builds currently not rendering content
# ac_add_options --enable-default-toolkit=cairo-qt
# ac_add_options --disable-crashreporter
 
# e10s
ac_add_options --enable-ipc
</pre>
 
To build:
<pre>
make -f client.mk
</pre>
 
=== Building for Maemo devices ===
 
Create your .mozconfig in your mozilla-central directory.  Your .mozconfig should look something like this:
 
<pre>
# For improved compile speeds, all optional.
export CCACHE_HARDLINK=1
export CC="ccache gcc"
export CXX="ccache g++"
mk_add_options MOZ_MAKE_FLAGS=-j3
 
# Make an optimized debug build.
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-debugger-info-modules=yes
 
# important mobile options
mk_add_options MOZ_OBJDIR=mobilebase-qt-@CONFIG_GUESS@
ac_add_options --enable-application=mobile
ac_add_options --with-arm-kuser
 
# important qt options
ac_add_options --enable-default-toolkit=cairo-qt
ac_add_options --disable-crashreporter
ac_add_options --with-maemo-version=5
 
# e10s
ac_add_options --enable-ipc
 
# Other important stuff to prevent build errors (missing glx.h, maybe other stuff)
ac_add_options --with-maemo-version=5
</pre>
 
:: Pro tip: if you are building for desktop and device, take the environment variable MOZCONFIG to your advantage.  Put your device mozconfig in your scratchbox home directory.  Then, in your scratchbox session:
 
:: <pre>[scratchbox $] echo export MOZCONFIG=$HOME/.mozconfig >> .bash_profile</pre>
 
Finally, run: <pre>make -f client.mk</pre>
 
== How to run ==
Create an executable script fennectrolysis in your $PATH as:
#!/bin/bash
objdir=[$OBJDIR]/mobile/
export LD_LIBRARY_PATH="$objdir/dist/bin/xulrunner:/usr/lib/debug/lib:/usr/lib/debug/usr/lib"
cd $objdir/dist/bin && exec "$@" ./xulrunner/xulrunner-bin application.ini
replacing <code>[$OBJDIR]</code> with your fennec objdir.
 
If you are building a xulrunner-less version of Fennec, do this instead:
cd objdir/dist/bin
rm fennec
cp ../../mobile/app/fennec .
LD_LIBRARY_PATH=. ./fennec
 
The boolean pref <tt>browser.tabs.remote</tt> controls whether Fennec tabs run in a remote process.  It defaults to "true" in electrolysis builds since 2010-06-24.
 
By default Necko-in-chrome is used.  If that's not working for you, you can try setting NECKO_SEPARATE_STACKS=1 in your environment (see [https://wiki.mozilla.org/Necko:_Electrolysis_design_and_subprojects#Running the necko docs]), though this is not a method that will ever be supported in a release.
 
See [[Mobile/Build/Fennec]] for more tips on building, copying to the device, and so forth.

Latest revision as of 03:48, 15 April 2011

This page is about the port of Mobile Firefox (Fennec) to the Electrolysis (e10s) multi-process architecture.

Weekly Meetings

The weekly meetings have been merged into the general mobile engineering meeting.

The archived meeting notes can be found at Agenda and notes

How to build

Setting up scratchbox (for Maemo devices only)

To build Fennec for Maemo devices like the N900, Nokia uses a scratchbox environment that keeps all of its packages separate from your Linux distribution. So you must:

  • Have Linux on your machine or in a VM
  • Set up scratchbox, which is a little painful

Below is the condensed version of Maemo install guide, intended for Ubuntu users. If you have questions or need something a little different, it is a good reference.

#
# Scratchbox: install these before doing your Maemo 5 scratchbox.
#

# Install instructions for scratchbox itself. Only need to do these steps once.
sudo echo "deb http://scratchbox.org/debian/ maemo5-sdk main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install scratchbox-toolchain-cs2007q3-glibc2.5-arm7

# Needed for Ubuntu.
sudo echo "vm.vdso_enabled = 0" >> /etc/sysctl.conf
sudo echo "vm.mmap_min_addr = 4096" >> /etc/sysctl.conf
sudo sysctl -p

#
# Maemo 5.0 scratchbox
#
wget http://repository.maemo.org/stable/5.0/maemo-scratchbox-install_5.0.sh \
  http://repository.maemo.org/stable/5.0/maemo-sdk-install_5.0.sh 
sudo sh ./maemo-scratchbox-install_5.0.sh -s /scratchbox
sudo /scratchbox/sbin/sbox_ctl start

# If this is your first scratchbox installation, run this and re-login.
sudo /scratchbox/sbin/sbox_adduser $USER yes

sh ./maemo-sdk-install_5.0.sh

(Note that for this to work, you need to logout and login - opening a new terminal is not enough. The Nokia instructions now continue...)


#
# Run /scratchbox/login.  You are now chroot'ed inside scratchbox environment.
#
sb-conf setup FREMANTLE_ARMEL -c cs2007q3-glibc2.5-arm7 \
  -d qemu:perl:debian-etch:doctools:svn:git -t qemu-arm-sb
wget http://repository.maemo.org/stable/5.0/armel/maemo-sdk-rootstrap_5.0_armel.tgz
sb-conf select FREMANTLE_ARMEL
sb-conf rootstrap maemo-sdk-rootstrap_5.0_armel.tgz
sb-conf install -edFL

# Unfortunately anything built with QT requires a EULA.
# Here you will need to go to http://tablets-dev.nokia.com/eula/index.php and
# accept their EULA. Add the deb repo you subsequently receive to /etc/apt/sources.list
fakeroot apt-get update
fakeroot apt-get install nokia-binaries nokia-apps

For Fennec e10s, you will need to install some additional packages.

# You are still logged in to scratchbox, right?
fakeroot apt-get install libqt4-dev libqt4-gui \
  libxaw7-dev libfreetype6-dev libxi-dev \
  libhildonmime-dev libosso-dev libidl-dev liblocation-dev \
  libasound2-dev libhildon1-dev libiw-dev \
  libxdamage-dev libxcomposite-dev libnotify-dev libhildonfm2-dev \
  libconic0-dev python

Getting the source

Get mozilla and mobile projects off mercurial:

hg clone http://hg.mozilla.org/mozilla-central

Building for desktop

Ubuntu package dependencies:

# Basic Firefox deps
sudo apt-get build-dep firefox
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev \
  libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13

# QT deps
sudo apt-get install libqt4-dev

Create your .mozconfig in your mozilla-central directory. Your .mozconfig should look something like this:

# For improved compile speeds, all optional.
export CCACHE_HARDLINK=1
export CC="ccache gcc"
export CXX="ccache g++"
mk_add_options MOZ_MAKE_FLAGS=-j3

# Make build w/ symbols.
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --disable-debug
ac_add_options --enable-debugger-info-modules=yes

# important mobile options
mk_add_options MOZ_OBJDIR=mobilebase-qt-@CONFIG_GUESS@
ac_add_options --enable-application=mobile

# important qt options
# XXX QT builds currently not rendering content
# ac_add_options --enable-default-toolkit=cairo-qt
# ac_add_options --disable-crashreporter

# e10s
ac_add_options --enable-ipc

To build:

make -f client.mk

Building for Maemo devices

Create your .mozconfig in your mozilla-central directory. Your .mozconfig should look something like this:

# For improved compile speeds, all optional.
export CCACHE_HARDLINK=1
export CC="ccache gcc"
export CXX="ccache g++"
mk_add_options MOZ_MAKE_FLAGS=-j3

# Make an optimized debug build.
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-debugger-info-modules=yes

# important mobile options
mk_add_options MOZ_OBJDIR=mobilebase-qt-@CONFIG_GUESS@
ac_add_options --enable-application=mobile
ac_add_options --with-arm-kuser

# important qt options
ac_add_options --enable-default-toolkit=cairo-qt
ac_add_options --disable-crashreporter
ac_add_options --with-maemo-version=5

# e10s
ac_add_options --enable-ipc

# Other important stuff to prevent build errors (missing glx.h, maybe other stuff)
ac_add_options --with-maemo-version=5
Pro tip: if you are building for desktop and device, take the environment variable MOZCONFIG to your advantage. Put your device mozconfig in your scratchbox home directory. Then, in your scratchbox session:
[scratchbox $] echo export MOZCONFIG=$HOME/.mozconfig >> .bash_profile

Finally, run:

make -f client.mk

How to run

Create an executable script fennectrolysis in your $PATH as:

#!/bin/bash
objdir=[$OBJDIR]/mobile/
export LD_LIBRARY_PATH="$objdir/dist/bin/xulrunner:/usr/lib/debug/lib:/usr/lib/debug/usr/lib"
cd $objdir/dist/bin && exec "$@" ./xulrunner/xulrunner-bin application.ini

replacing [$OBJDIR] with your fennec objdir.

If you are building a xulrunner-less version of Fennec, do this instead:

cd objdir/dist/bin
rm fennec
cp ../../mobile/app/fennec .
LD_LIBRARY_PATH=. ./fennec

The boolean pref browser.tabs.remote controls whether Fennec tabs run in a remote process. It defaults to "true" in electrolysis builds since 2010-06-24.

By default Necko-in-chrome is used. If that's not working for you, you can try setting NECKO_SEPARATE_STACKS=1 in your environment (see the necko docs), though this is not a method that will ever be supported in a release.

See Mobile/Build/Fennec for more tips on building, copying to the device, and so forth.