chromium下载编译过程

好久没同步google代码,之前没有可用代理所以下完了源码也编译不出sln。

有了代理,发现编译也没想象复杂。

现将编译过程中做了个总结。

/

以下是别人工具下载,可以参考。我的环境depot_tools是一年前配置还能用上,如果配置depot_tools出了问题,还请自己找度娘折腾下。

1、下载工具准备

下载depot_tools并解压至c:\

https://src.chromium.org/svn/trunk/tools/depot_tools.zip

设置 depot_tools代理 [推荐]

为了解决 depot_tools自身更新问题,为depot_tools增加代理支持,修改c:\depot_tools\bootstarp\win\get_file.js文件:

(1)改xml_http = newActiveXObject("MSXML2.ServerXMLHTTP");

    为xml_http = newActiveXObject("MSXML2.ServerXMLHTTP.5.0");

(2)在xml_http.open("GET", url,false); 前增加

   xml_http.setProxy(2,"proxyurl:proxyport");或xml_http.setProxy(2, "127.0.0.1:8118");

在xml_http.open("GET", url,false); 后增加

  xml_http.setProxyCredentials("proxyuser","proxypwd"); //需要用户密码才用到,没有不用设

注:如果出现 

ActiveX 部件不能创建对象: Msxml2.ServerXMLHTTP.5.0

 microsoft vbscript 运行时错误 错误 '800a01ad'

建议处理方式如下:
1)先在C:\Windows\System32查找 msxml,如出现msxml[x].dll与msxml[x]r.dll 比msxml5.dll msxml5r.dll的版本高,可尝试使用它。
即设置xml_http = newActiveXObject("MSXML2.ServerXMLHTTP.[x].0"); x>5
2)如果没有百度下msxml5.dll msxml5r.dll下载并挎到C:\Windows\System32;

2、设置下载工具路径至环境变量

计算机属性-》高级-》环境变量-》系统属性-》打开Path,最前边增加 C:\depot_tools;

管理员权限打开cmd,运行gclient自动更新工具,下载python、git、svn等等。

如报错说明FQ失败或以上设置失败。

//

下面是编译前配置的代理

/

代理不带帐户密码的:

set http_proxy=http://proxy.server.com:proxyport
set https_proxy=https://proxy.server.com:proxyport
git config --global http.proxy %HTTP_PROXY%
git config --global https.proxy %HTTPS_PROXY%

代理带帐户密码的:

set http_proxy=http://DOMAIN\proxyuser:proxypwd@proxy.server.com:proxyport
set https_proxy=https://DOMAIN\proxyuser:proxypwd@proxy.server.com:proxyport
git config --global http.proxy %HTTP_PROXY%
git config --global https.proxy %HTTPS_PROXY%

还需要设置BOTO代理,解决download google storage失败问题:

1)在depot_tools要目录下新建http_proxy.boto,内容如下:

[Boto]

proxy= 127.0.0.1

proxy_port= 8118

//如带密码有增加以下两项

proxy_user=proxy用户名

proxy_pass=proxy密码

2)set NO_AUTH_BOTO_CONFIG=C:\depot_tools\http_proxy.boto

//

下载与编译

/

1,参考官方下载说明:http://www.chromium.org/developers/how-tos/get-the-code

简单点就是直接运行:fetch chromium

如果代理设置成功,后面会看到still working on每隔10秒刷新一下。这说明要恭喜你了,耐心等吧。

2,下载完编译

D:\chromium42>gclient sync --force(以往这一步会强制同步代码后生成解决方案,现在则会在同步一部分后出现找不到文件的错误)

D:\chromium42>cd src

D:\chromium42\src>gclient sync(确保源码同步完成)

D:\chromium42\src>set  GYP_GENERATORS=msvs-ninja,ninja

D:\chromium42\src>gclient runhooks 然后就能在 src/chrome/下找到chrome.sln的解决方案,调试方式就跟以前一样了

3,如果gclient runhooks过程出现以下错误,设置set DEPOT_TOOLS_WIN_TOOLCHAIN=0再运行gclient runhooks 试试。设置为0则是让gclient不要自动去构造环境,而是利用本机现有环境!

Please follow the instructions at http://www.chromium.org/developers/how-tos/bui
ld-instructions-windows
Traceback (most recent call last):
  File "src\build\gyp_chromium", line 244, in <module>
    gyp_environment.SetEnvironment()
  File "D:\ChromiumLast\src\build\gyp_environment.py", line 33, in SetEnvironmen
t
    vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
  File "D:\ChromiumLast\src\build\vs_toolchain.py", line 34, in SetEnvironmentAn
dGetRuntimeDllDirs
    Update()
  File "D:\ChromiumLast\src\build\vs_toolchain.py", line 177, in Update
    subprocess.check_call(get_toolchain_args)
  File "D:\depot_tools\python276_bin\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\depot_tools\\python276_bin\\python
.exe', 'D:\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--outpu
t-json', 'D:\\ChromiumLast\\src\\build\\win_toolchain.json', 'ee7d718ec60c2dc5d2
55bbe325909c2021a7efef']' returned non-zero exit status 1

以下两个blog总结不错,建议有问题可以参考下:

1,http://blog.csdn.net/kuerjinjin/article/details/23563059

2,http://blog.csdn.net/wpc320/article/details/44918321这个是webrtc配置,但是一些depot_tools配置值得参考 (因为chromium也是用depot_tools嘛)。

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

补充:

一,使用vs2013编译过程出现error MSB3073....d3dcompiler_47***相关的东西,上面还有一些ACTION Copying D3D Compiler DLL信息。

google了相关信息,有用的是set  GYP_DEFINES=windows_sdk_path="C:\Program Files (x86)\Windows Kits\8.0",还有就是关于d3dcompiler_47的信息。

因此怀疑是本地windows sdk 环境变量设定与chromium存在不一致问题(本人下的是42.0.2311.135),结合当时偶然看到到D:\ChromiumLast\src\build\vs_toolchain.py里面有段

  if not 'WINDOWSSDKDIR' in os.environ:
    default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\8.1“

内容,于是我在C:\Program Files (x86)\Windows Kits搜索了下d3dcompiler_47.dll,此dll出现在8.1目录,8.0则是d3dcompiler_46.dll。

故将系统环境变量windows_sdk_path改到"C:\Program Files (x86)\Windows Kits\8.1"(8.0是之前编译36版本的)。

同时命令行编译前设置set  GYP_DEFINES=windows_sdk_path="C:\Program Files (x86)\Windows Kits\8.1"

接着重新gclient runhooks,终于编译正常了。

二,使用vs2013编译过程出现error C1902错误 

此错误是结合一下官方说明http://www.chromium.org/developers/how-tos/build-instructions-windows老实将VS 2013升级到update 4版本吧。

三,vs2013编译过程出现error C2990错误 ,The file contains a character that cannot be represented in the current code page等信息

还是按官方的,将系统区域设置设为英语吧,(控制面板\时钟、语言和区域->更改显示语言->管理->非Unicode程序的语言,将其设成 英语(美国)

Setting up Windows

You must set your Windows system locale to English, or else you may get build errors about "The file contains a character that cannot be represented in the current code page."

谁叫英文不好,老外喜欢玩你。

/

/**********************chromium 版本切换************************/

/

1)cd src #需要切换到src下才能使用git仓库管理 

2)git fetch origin --tags //同步所有的tags到本地仓库

3)git checkout -b -newbranch  [<start_poimt>] 

创建新的分支并切换到新分支上去,
b代表branch的意思,newbranch 是新分支的名称,
如果没有指定提交点(start_point),默认从HEAD指向的提交创建分支。

如:git checkout -b 42.0.2311.135 42.0.2311.135 

4)gclient sync --nohooks --with_branch_heads --with_tags --output-json="log.json"  

5)gclient runhooks更新sln(需要前面的环境变量)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SmarterTech

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值