chromium下载编译过程

news/2025/2/23 0:03:42/

好久没同步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(需要前面的环境变量)


http://www.ppmy.cn/news/148545.html

相关文章

request-html chromium 下载失败 or request-html无法下载chromium or r.html.render()导致异常报错

解决办法&#xff1a; 执行如下命令&#xff1a; pyppeteer-install 然后等待命令完成即可(如果命令成功执行&#xff0c;您将会看到如下内容)。 Windows: [W:pyppeteer.chromium_downloader] start chromium download. Download may take a few minutes. [W:pyppeteer.ch…

chromium 下载地址

2019独角兽企业重金招聘Python工程师标准>>> http://www.chromium.org http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/%d/chrome-linux.zip https://stor…

chromium的下载和编译

一、Chromium下载 首先应该去chromium官网去看一看&#xff0c;地址如下&#xff0c;如果可以看的明白最好了。按照Google说的一步一步去做&#xff0c;基本问题不是太大&#xff0c;不过还是有许多坑需要这里说明一下的。如果按照Google步骤来没有问题&#xff0c;可以不用继…

解决request-html chromium下载失败原因

我们在第一次使用requests-html中render函数的时候&#xff0c;当你第一次调用render()方法时&#xff0c;代码将会自动下载Chromium&#xff0c;并保存在你的根目录下&#xff08;如&#xff1a;~/.pyppeteer/&#xff09;。它只会下载这一次。唯一缺点就是chromium下载实在太…

chromium的下载和编译(流程详解)

准备工作: 1、翻墙的梯子(必须&#xff0c;因为需要访问国外服务器进行数据下载和同步) 2、安装VS2019&#xff0c;且请务必把安装路径设置为C盘(最好默认安装)&#xff0c;这样可以省掉很多不必要的环境变量配置。(一开始我VS安装在D盘&#xff0c;走了很多弯路也没成功&#…

下载chromium for Android

chromium 下载源码第一次会比较折腾&#xff0c;有兴趣的可以试试&#xff0c;我将下载的源码传了一份在百度网盘&#xff0c;不含gitlog&#xff0c;大小在6G左右&#xff0c;不想折腾的&#xff0c;可以下载&#xff0c;路径我放在最后&#xff0c;喜欢折腾的可以看看。 先租…

Chrome源码chromium下载编译详细步骤

由于chromium源码太过于庞大&#xff0c;编译需要google专门的工具&#xff0c;没有详细的操作流程很难玩得转&#xff0c;我这里整理的步骤简单实用&#xff0c;大家照此步骤可以完成编译运行。 首先准备工具软件&#xff1a; 1、WindowsSDK下载地址: https://developer.m…

HTML5中websocket通讯_v1.0

WebSocket原理 HTML5推出WebSocket标准&#xff0c;使得浏览器和服务器之间任一方都可主动发送数据给对方&#xff0c;用来代替http轮询。WebSocket跟HTTP协议一样&#xff0c;也是应用层协议。为兼容HTTP协议&#xff0c;它通过HTTP协议进行一次握手&#xff0c;握手后数据就…