Get the 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). If you know what you're doing, you can alternatively check out the source from git.
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 usinggclient sync.
If you only want to look at the source code on your own machine, you'll need at least 1.6 GB of hard drive space available. (Somewhat less for Linux, since it already has some of the dependencies installed.) If you want to build it, you will need just under 10 GB of space, including all the object files and executables.
Bootstrap using the tarball
- Make sure that you have a program that can untar.tgz(.tar.gz)files.
- Mac OS X and Linux both havetarbuilt in. (On a Mac, use a shell in the Terminal application.)
- Examples for Windows include the open-source7-Ziparchiver, the free BsdTar utility (part ofLibArchive), and WinZip. Note:Cygwin's tar tool will not work; it will mess up the file permissions.
- Download thesource tarball. Some download applications change the file suffix without extracting the file. If yours did, rename it back tochromium.rXXXXX.tgz.
- Choose a directory to hold your source code.Important:Make sure the directory path hasno spaces.
- Windows example:c:/chromiumtrunk
- Mac OS X (Terminal) or Linux example:~/chromium
- Untar the source tarball into the directory you've chosen. Examples: If you're using 7-Zip, extract the .tgz file, then extract the resulting .tar file. If you're using LibArchive, issue the following command:
"C:/Program Files/GnuWin32/bin/bsdtar.exe" -xzf chromium.tgz
-
Install the depot_tools.If using Ubuntu, see Bootstrap Notes below.
- Updating your checkout once by runninggclientsync--forcein the source code directory (~/chromium/src).
- If you don't want to sync, you need to generate the project files withgclient runhooks --force. This will callGYPto generate your platform-specific files. You won't be able to build otherwise. If you don't sync, you'll miss some os-specific dependencies so you're better to sync anyway. :)
This should give you a complete source tree. But if you have any problems, first check that you've installed any prerequisites listed on the build instructions for your platform.
Bootstrap notes forUbuntu:
-
If you see the following message, you will need to update your version of subversion to at least 1.5:
svn: This client is too old to work with working copy...
-
If you are running Ubuntu 8 and 'sudo apt-get install subversion' doesn't update you past 1.4.6, try the following:
- $ sudo apt-get install libsvn1=1.5.1dfsg1-1ubuntu2~hardy3
- $ sudo apt-get install subversion=1.5.1dfsg1-1ubuntu2~hardy3
-
Make sure your dependencies are up to date by running the install-build-deps.sh script:
- .../chromium/src $ ./build/install-build-deps.sh
Check out the sources
You'll use gclient / depot toolsto download the Chromium code from its subversion repository.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.
Thegclient config <url>step only needs to be run once to set up your working directory. It creates a.gclientfile in your working directory that identifies the corresponding structure to pull from the repository. Thegclient syncstep creates several subdirectories. To update your tree in the future, you only need to rungclient syncfrom anywhere within your working directory.
NOTE: These instructions will pull a read-only tree. If you are a committer, and plan to make changes to source code, use the instructions given to you when you received commit access.
Windows
Note:It's not necessary to have Subversion or Python installed already: the first run of gclient will install them for you.On the other hand, if youdoalready have Subversion installed through Cygwin, you'll need to set up your PATH tohave the depot_tools svn ahead of the cygwin svn, anduse only the depot_tools svn, not Cygwin's, to check out Chromium.
- Create a directory to hold your source code. This example assumesc:/chromiumtrunk, but other names are fine.
Important:Make sure the full directory path hasno spaces.
- In a shell window, execute the following commands:
cdc:/chromiumtrunk gclient config http://src.chromium.org/svn/trunk/src To download the initial code, update your checkout as described below.
Mac OS X
- Create a directory to hold the code. This example assumes the directory is~/chromium, but other names are fine. Note that if you have FileVault enabled, you'll want to either disable it or put the code in a folder outside the home directory, as otherwise Xcode will be very slow or hang. You also probably want to disable Spotlight indexing for that folder (System Preferences -> Spotlight -> mark the folder as private).
- From a shell in the Terminal, execute the following commands:
$ cd~/chromium $ gclient config http://src.chromium.org/svn/trunk/src
- To download the initial code, update your checkout as described below.
Linux
- Pick a directory for your build. We will call this directory$CHROMIUM_ROOTbelow.
- Check out Chromium:
$ cd $CHROMIUM_ROOT $ gclient config http://src.chromium.org/svn/trunk/src
- To download the initial code, update your checkout as described below.
Check out the source for a specific release
Use the same steps for "Check out directly from SVN", except that as opposed to using gclient config onhttp://src.chromium.org/svn/trunk/src, you need to do a checkout for the specific version of Chromium that you are interested in:
For example, if you wanted the source for build 5.0.330.0, the following command would be appropriate:
gclient config http://src.chromium.org/svn/releases/5.0.330.0
Staying Green most of the time
When running gclient config, you can specify a second URL to be referenced when doing updates. Instead of pulling the most recent revision, the version number at this URL will be queried, allowing you to track the "most recent green" revision so you can spend less time debugging other people's issues or running builds only to find out that the waterfall was red. Chromium has two of these URLs:
Continuous build
Get the last revision from:
-
http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE
http://commondatastorage.googleapis.com/chromium-browser-continuous/Mac/LAST_CHANGE http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE
- This corresponds to the most recent revision that passed both unit tests and layout tests on a particular platform (linux, mac, or win). Since layout tests can take a while to run, this revision may be an hour or more "stale".
LKGR
- http://chromium-status.appspot.com/lkgr
- This URL holds the version of the latest revision to pass only unit tests (in debug mode). This can happen faster, so for most developers this is probably what you want since it will help you ensure that your changes work against a "fresher" version of Chromium.
Setup
To use one of these URLs, pass it when you rungclient config: $ cd~/chromium $ gclient config http://src.chromium.org/svn/trunk/srchttp://chromium-status.appspot.com/lkgrNow whenever you callgclient sync, it will only sync as far as the configured URL specifies. To over-ride this, pass the--headparameter togclient, e.g.:gclient sync --head
You can also add this directly to your .gclient file if you already have one:
solutions = [ {"name" : "src", "url" : "http://src.chromium.org/svn/trunk/src", "safesync_url" : "http://chromium-status.appspot.com/lkgr" }, ]
Reducing the size of your checkout
You can edit your .gclient file to avoid pulling down certain pieces of the checkout that you may not want. For example, inserting something like
"custom_deps": {
"src/third_party/WebKit/LayoutTests": None,
"src/chrome/tools/test/reference_build/chrome": None,
"src/chrome_frame/tools/test/reference_build/chrome": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/third_party/hunspell_dictionaries": None,
}
into one of the solutions (i.e. just underneath the "url": ... line) should save a lot of space. The list of repos that gclient pulls is set in src/DEPS. and listed in .gclient_entries.
As of r48011, the following can definitely be removed if you just want to build Chromium:
src/third_party/WebKit/LayoutTests - All the WebKit layout tests.
src/chrome/tools/test/reference_build/chrome - Windows reference build for performance testing.
src/chrome_frame/tools/test/reference_build/chrome- Chrome Frame reference build for performance testing.
src/chrome/tools/test/reference_build/chrome_linux- Linux reference build for performance testing.
src/chrome/tools/test/reference_build/chrome_mac- Mac reference build for performance testing.
src/third_party/hunspell_dictionaries - spellchecker dictionaries used for unit tests.
Update to the latest revision
Whether you started with a source tarball or an svn checkout, at some point you'll want to update your checkout to the latest revision.
The first time you execute gclient, there will be a delay (a minute or so) while it updates the depot tools. How long the Chromium code update takes depends on how much has changed since you last updated (or since the bootstrap tarball was created).
-
Install the depot_tools, if you haven't already.
- Visit theChromium Buildbot waterfallto see the state of the tree.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[your Chromium source directory] gclient sync
To update to a specific revision, use gclient sync --revision src@####
and the DEPS file will make sure you get the other directories in their matching forms.
Checking out subpart of the tree
svn co http://src.chromium.org/svn/trunk/src/chrome/common/extensions/docs/examples/tutorials/getstarted/
Note the difference in the url, namely/viewvc/chrome was replaced with/svn .
|
分享到:
相关推荐
chromium-linux.zip
Proxy-SwitchyOmega-Chromium-2.5.15.zip
chromium multi-process architecure
chromiumembedded-java-cef-304f3e3de03f.zip
chromiumembedded-cef-5ef0fb8ac8fd.zip
Chromium浏览器官方版是一个由Google主导开发的网页浏览器,Chromium浏览器官方版是Google为发展Google Chrome而开启的计划,所以Chromium浏览器相当于Chrome的工程版或称实验版,新功能会率先在Chromium上实现,待...
绿色浏览器Chromium-71.0.3573.0谷歌开源浏览器,部分win7可能会出现白板。
Chromium浏览器官方版是一个由Google主导开发的网页浏览器,Chromium浏览器官方版是Google为发展Google Chrome而开启的计划,所以Chromium浏览器相当于Chrome的工程版或称实验版,新功能会率先在Chromium上实现,待...
linux版本的chromium浏览器,一键安装,支持debian,ubuntu,deepin等-------------------------------------------------------
Chromium浏览器官方版是一个由Google主导开发的网页浏览器,Chromium浏览器官方版是Google为发展Google Chrome而开启的计划,所以Chromium浏览器相当于Chrome的工程版或称实验版,新功能会率先在Chromium上实现,待...
cef_binary_87.1.14+ga29e9a3+chromium-87.0.4280.141_windows32 这是 87.0.4280最后一个稳定版,用了一周时间进行编译的,支持flv,mp3,mp4 libcef_dll也使用vs2013进行编译,新测可用 你可也可以自己,步骤: 1....
只能用 baidu 索索?...Chromium浏览器是谷歌浏览器的开发版本,它的设计超级简洁,使用起来更加方便,而且在Chromium浏览器出现的新功能以后会应用到谷歌浏览器中,让您更快速、轻松且安全地使用网络的浏览器。
Chromium-macOS-73.0.3683.27, 2019,2,19上传。
chromium-el6.repo
npm install puppeteer-chromium-resolver --save 用法 [异步]动态检测和下载Chrome ( async ( ) => { const PCR = require ( "puppeteer-chromium-resolver" ) ; const option = { revision : "" , ...
ChromiumOS_4.4_Kernel-master 谷歌操作系统4.4核心源代码
1.VS2017+Qt5.14.2+cef_binary_89.0.18+gb36241d+chromium-89.0.4389.114_windows32编译包。 2.已经用CMake生成.sln文件的包,可以直接打开.sln文件运行。 3.注意环境:VS2017,Qt5.14.2。 4.cef包的版本为89,32位的...
chromium-source-tarball, 自动生成 Chromium的源代码 tarball Chromium 源 tarball自动为 Chromium 发布通道生成源代码 tarball,并将它的上载到发行版。不同于只包含针对Linux打包器的Linux的官方源代码 tarball,...
要获取Chrome,请从以下位置获取最近的位置:[position-100,position + 100]在Ubuntu上安装的命令这是在Ubuntu上安装Chromium的参考命令CHROMIUM_VERSION=77.0.3865.120wget --no-check-certificate ...
Chromium浏览器官方版是一个由Google主导开发的网页浏览器,Chromium浏览器官方版是Google为发展Google Chrome而开启的计划,所以Chromium浏览器相当于Chrome的工程版或称实验版,新功能会率先在Chromium上实现,待...