Mobile/Build/WinMobile6 XULRunner BrainDump 20080630

From MozillaWiki
Jump to navigation Jump to search

WinMobile 6 XULRunner BrainDump (07-Jul-2008)

This page is a storage site for the issues I have been running into during my time working on getting XULRunner.exe functional on a Windows Mobile 6 environment.


Building XULRunner

I started with the version 1.9 code base from mozilla-central, modified by Brad Lassey to add unicode for WINCE builds. Originally, Brad's unicode patches were slightly stale. So, I first worked with Brad to update those patches - creating a code base that would build using these instructions for building Windows Mobile.

Original Build Environment

The original build environment used was Visual Studio 2005 (VS8), Windows Mobile 6 Standard and Professional SDKs, and a MOZILLA-BUILD subdirectory containing MingW32, 7ZIP, NSIS, Python 2.5, SVN 1.4.2, wget. xemacs, and UPX 2.03.

Follow the instructions here to setup a window development environment.

Visual Studio Versions

Two different versions of the Microsoft Visual Studio Integrated Development Environment are discussed on this page. Here is a cheat sheet for the two versions:

  • Visual Studio 2005 = Visual Studio 8 = VS8
    • IDE available for a few years now
    • First Emulator that is a real ARM emulation, not just a simulator
    • Currently preferred compiler for Mozilla
    • Potentially buggy Emulator Directory Sharing (more on this later)
  • Visual Studio 2008 = Visual Studio 9 = VS9
    • IDE less than a year old
    • More advanced Emulator, more emulation packages (and form factors)
    • Not currently supported by Mozilla

Build Instructions

I built XULRunner using the instructions found here. For testing, I use a slightly modified MyBrowser XULRunner application. Here is a ZIP file containing the MyBrowser application I used: File:2008 07 07 WinCE MyBrowser TestApp.zip.

Initial testing on VS8 Emulator was done by copying the mybrowser directory within the ZIP file to the OBJDIR/dist/bin directory (creating a OBJDIR/dist/bin/mybrowser subdirectory). Then, map the OBJDIR/dist bin to the emulator's shared folder. Finally, run the XULRunner.exe application with an argument of mybrowser\application.ini.

VS8 Build Warnings

The following are lines of warnings from within a full XULRunner.exe VS8 build:


VS8 Emulation Issues

The VS8 Emulator was one of the most advanced emulators on the market for ARM architectures. The VS8 Emulator was the first emulator to be ARM Certified, meaning that the ARM suite of tests for CPUs were completely passed by the emulator.

Therefore, the VS8 emulator was positioned to be one of the best emulation testing tools ever available for the Windows Mobile platform.

The Shared Folder functionality allows you to set any hard disk directory as a shared folder inside the Windows Mobile emulation being run. This allows the emulator's OS to see the "OBJDIR\dist\" directory as "\Storage Card\" (or, in some cases, "\Storage Card2\").

Unfortunately, there seems to be some issue in XULRunner file access using the Shared Folder functionality of the VS8 emulator. On initial startup of a Windows Mobile 6 emulator image, the first execution of XULRunner.exe would result in random file access errors (return code 0x80512004 = NS_ERROR_FILE_ACCESS_DENIED).

A second and subsequent running of XULRunner.exe showed no such issue.

This issue was the driving force for trying to build XULRunner.exe with VS9.

New OBJDIR/Dist - Run Twice

Shared Directory Setup

NS_ERROR_FILE_ACCESS_DENIED Error

Using Visual Studio 9 (a.k.a. - Visual Studio 2008)

Reasoning

VS9 Install On Machine With VS8 - WARNING

Most people who have worked on Windows Mobile software for the past few years already have VS8 installed on their development machines.

Natural instinct is to install VS9 on the same machine. When you have finished this sequence (and used another 10 or so gigabytes of your hard disk space), you will find that VS9 IDE will not show any Windows Mobile 6 projects.

Unfortunately, at this point, the solution to this problem is to uninstall the Windows Mobile 6 Professional SDK and Windows Mobile 6 Standard SDK. Once these two SDKs are uninstalled, then reinstall each of the SDKs in turn.

When you have finished the uninstall-uninstall-install-install, VS9 IDE will now know about and be able to produce Windows Mobile 6 projects.

VS9 Build Warnings

On-Device Execution Results

Emulator Execution Results