|
If you're serious about learning how Chromium works,
this is the page for you. You'll get the Chromium code and build it. Then
you'll use the Visual Studio 2005 debugger to see how the browser works — in
particular, how it responds to common user actions.
Note: This page is
aimed at developers and testers who have Windows and want to inspect running
code. If you're not ready to set up a build environment, you can read the documentation.
If you don't have Windows, check out the build instructions for Mac and Linux.
Get the
software you need
This section
tells you how to set up your Windows build environment. If you have problems
or want further details, see Build Instructions (Windows).
Prerequisite
software
First, your computer must have the following software
installed:
- Windows XP
(SP2 or later) or Windows Vista
- Microsoft
Visual Studio 2005 (8.0)
Additional
(free) downloads
Once Visual Studio is installed, you need to download and install some
more software.
- Download
and install Microsoft Visual Studio 2005 Service Pack 1.
Depending on your computer, installation can take about an hour, and you
might need to reboot.
- Download
and install the Microsoft Windows SDK.
You might need to reboot. You can save space by not installing the
documentation and code samples.
Note: Although the SDK says it's for Vista, it works on both XP and
Vista. If you already have the Microsoft 2008 SDK, you don't need to
install a new one.
- Integrate
the SDK with Visual Studio:
Start > All Programs > Microsoft Windows SDK > Visual Studio
Registration > Integrate Windows SDK with Visual Studio 2005
- Get the
Chromium depot_tools:
- Download depot_tools.zip.
- Unzip the
file.
Note: If you have Cygwin installed, don't use its unzip tool; it
will mess up the permissions.
- Add the
depot tools directory to your PATH. Example: C:\bin\depot_tools
Note: By default, the depot_tools will automatically
update to the latest version every time you run gclient. See the depot_tools page if you want to disable
this behavior.
Chromium code
The Chromium codebase consists of hundreds of thousands
of files, which means that a checkout straight from the Subversion (SVN)
repository can take a long time. To speed up the process, we have provided a
tarball that you can use to bootstrap the download. Alternatively, you can
skip the tarball and download straight from SVN (not recommended).
Note: There is no
advantage to checking out straight from SVN. The tarball includes SVN
directories so that after you unpack the tarball, you can get up to the
latest revision by using gclient
sync.
If you only want to look at the source code, you'll need at least 1.6 GB of
hard drive space available. If you want to build it, you will need just under
10 GB of space, including all the object files and executables.
To bootstrap using the tarball:
- Make sure
that you have a program that can untar .tar.gz files. Examples include the open-source 7-Zip
archiver, the free BsdTar utility (part of LibArchive), and WinZip.
- Download
the source tarball.
- Choose a
directory to hold your source code. Example: c:\chromiumtrunk
Important: Make sure the directory path has no spaces.
- Untar the
source tarball into the directory you've chosen. Example: If you're
using LibArchive, issue the following command:
"C:\Program Files\GnuWin32\bin\bsdtar.exe" -xzf chromium.tgz
- Optionally,
sync to the latest revision of Chromium:
- Visit the Chromium Buildbot waterfall to see the
state of the tree. [Note: If this part of the infrastructure is not
yet working, please check the topic of the #chromium IRC channel on
irc.freenode.net instead.] If the top of the waterfall says:
OPEN - The tree is in a good
state and you should be able to compile the code. Go to the next step.
CLOSED - There might be compile
or test failures. You can download the code, but you'll get those same
failures when you try to compile or run tests. Best to check back
later.
- In a shell
window, execute the following commands:
cd c:\chromiumtrunk
gclient sync
The gclient tool is included in
the depot tools described above. The first time you execute gclient,
there will be a delay (a minute or so) while it updates the depot
tools.
To check out directly from SVN:
You'll use the gclient depot tool to download the Chromium code from its SVN
repository.
- Create a
directory to hold your source code. Example: c:\chromiumtrunk
Important: Make sure the directory path has no spaces.
- Visit the Chromium Buildbot waterfall to see the
state of the tree. [Note: If this part of the infrastructure is not
yet working, please check the topic of the #chromium IRC channel on
irc.freenode.net instead.] If the top of the waterfall says:
OPEN - The tree is in a good
state and you should be able to compile the code. Go to the next step.
CLOSED - There might be compile
or test failures. You can download the code, but you'll get those same
failures when you try to compile or run tests. Best to check back later.
- In a shell
window, execute the following commands:
cd c:\chromiumtrunk
gclient config
http://src.chromium.org/svn/trunk/src
gclient sync
The first time you execute gclient, there will be a delay
(a minute or so) while it updates the depot tools. Downloading the
Chromium code takes about an hour.
Build and
launch Chromium
Once you have all the software and code, you can build
Chromium and launch it in debug mode.
- Launch
Visual Studio.
- Choose File
> Open Project/Solution..., go to the src\chrome directory (under c:\chromiumtrunk or wherever you put the Chromium files), and open
the file chrome.sln.
- In the
Solution Explorer, go to the App directory, right-click chrome_exe, and choose Set as StartUp Project.
- Set the
user profile used by your build of Chromium:
- Right-click
chrome_exe, and choose Properties.
- In the
left column, choose Configuration Properties > Debugging.
- In the
right column, change the value of Command Arguments to something
like this:
--user-data-dir=c:\tmp\DebugProfile
Click Ok. Chromium creates the specified profile directory (c:\tmp\DebugProfile in the previous example) if the directory
doesn't already exist.
Note: If you don't set the profile, then if you try to launch
Chromium when Google Chrome or Chromium is already running, a new
window comes up in the already running browser. This
behavior ensures exclusive access to the user profile, but it means
that you can't debug your version of Chromium!
Warning: If the latest build of Chromium has a new profile
format, Google Chrome and older versions of Chromium might not be able
to read that format. Unless you set the profile, you could lose your
Google Chrome profile data.
- Press F5,
which builds the chrome_exe solution
and launches Chromium in debug mode. When you're asked whether to build
out-of-date projects, choose Yes.
- Building
takes 15-40 minutes. When the build completes, a browser window appears
on your desktop.
If the build fails or a new browser window does not appear, go to
Build Instructions (Windows) for help.
|