2014年9月17日 星期三

My environment : 8G RAM, Windows 7 64bit

Official document 


1. Install depot_tool
            Download and unpack to any folder you like, such as C:\Work\depot_tools
               
            Note:
            Do not use drag-n-drop or copy-n-paste extract from Explorer
            * Do not extract to a path containing spaces.
            
             Add a PATH user variable: %PATH%;C:\path\to\depot_tools

2. Initialize gclient
            Start -> cmd
            Execute gclient --version twice, twice is must.
            gclient --version
            gclient --version

3. Get source code
            Create a folder such as D:\Work\chromium
            Open cmd window
            cd D:\Work\chromium
            
            Get code
            fetch –nohooks chromium

            Create a branch named master 
            (The master is different with origin/master)
            cd src
            git checkout master

            Install some necessary tools by gclient
            gclient sync

4. Build code
            set GYP_DEFINES=component=shared_library
            python build\gyp_chromium
            ninja -C out\Debug chrome.exe


l   Trouble Shooting:
Error (gclient sync)
Running sdksetup.exe to download Win8 SDK (may request elevation)...
Windows 8 SDK failed to download, retrying.
Windows 8 SDK failed to download, retrying.
Windows 8 SDK failed to download, retrying.
Windows 8 SDK failed to download, retrying.
Windows 8 SDK failed to download, retrying.

Solution
Remove proxy setting.


Error (gclient sync)
Error: Command svn checkout https://cld2.googlecode.com/svn/trunk@157 D:\Blink\src\src\third_party\cld_2\src --revision 157 --non-interactive --force --ignore-externals returned non-zero exit status 1 in D:\Blink\src
Solution
        Execute svn ls https://cld2.googlecode.com/svn/trunk,choose 'accept' for conflict prompt.


Error (build code)
Warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
Solution
        You may use Chinese, Japanese or Korean Windows, and uses DBCS code page.
        You need to change your Windows system code page to English or another SBCS code page. You can do this by Control Panel - Regions - Administrative - Language for non-Unicode programs.




Debug

1.      Execute out\Debug\chrome.exe
2.      Start Visual Studio (Any version)
3.      In Visual Studio menu bar, Select Tool->Attach to Process-> Select the chrome process.
4.      Pull a file you want to set breaking point into Visual Studio and enjoy it.



沒有留言:

張貼留言