automate-git.py 文件放到automate 下面,update.bat 文件放在与chromium 同级目录下
depot-tools可以先下载好,放在上面的目录
cef 我用的是3071 版本 对应的编译好的文件 cef_binary_3.3071.1649.g98725e6_windows32,源码版本是 chromiumembedded-cef-98725e6b177f.tar.bz
运行update.bat 则会自己编译运行
跟官网教程不同的地方是我需要的cef版本不是最新的,
update.bat 文件改成如下:
set GN_DEFINES=is_component_build=true
# Use vs2017 or vs2019 as appropriate.
set GN_ARGUMENTS=--ide=vs2017--sln=cef --filters=//cef/*
python ..\automate\automate-git.py --download-dir=D:\work\ar\code\chromium_git\chromium\src--branch=3071--depot-tools-dir=D:\work\ar\code\depot_tools--no-distrib --no-build
其中有个坑需要注意的是,即使下了cef3源码编译,还需要chromium的git 源码信息,除非修改automate-git.py 文件,把这一部分跳过去,目前我没精力看这部分
还需要chromium的git 源码信息已经放到后面资料库里面,拷贝到对应的目录下后,还需要注意的坑是automate-git.py 还是会去找https://chromium.googlesource.com/chromium/src.git ,如果不能科学上网可以试着按下面的办法:
找台电脑,搭个类似github的服务,可以采用gogs或者其他类似软件
在chromium 下载的src 文件夹中设置remote ,将搭建好的服务加入进去,然后push 到该仓库里面去
修改automate-git.py 第1251 行,改为对应的gogs地址
(改这一个地址并不够,还会去下载third-party 部分的代码)
改完后,继续update.bat 编译(这部分无效,还需要third-party支持,还是需要科学上网)
运行截图,可以对比错误:
错误集锦
无法下载库
CIPD 下载不下来,设置系统环境变量,
set HTTP_PROXY = http://127.0.0.1:10809
set HTTPS_PROXY=http://127.0.0.1:10809
下载过程中,很有可能因为墙的原因或其它一些诡异的未知问题导致某一个库下载不下来。例如以下的一个错误:
[0:01:17] error: RPC failed; result=56, HTTP code = 200
[0:01:17] fatal: The remote end hung up unexpectedly
[0:01:17] fatal: early EOF
[0:01:17] fatal: index-pack failed Traceback (most recent call last): File "/opt/depot_tools/gclient_scm.py", line 881, in _Clone self._Run(clone_cmd, options, cwd=self._root_dir, retry=True) File "/opt/depot_tools/gclient_scm.py", line 1166, in _Run gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs) File "/opt/depot_tools/gclient_utils.py", line 292, in CheckCallAndFilterAndHeader return CheckCallAndFilter(args, **kwargs) File "/opt/depot_tools/gclient_utils.py", line 538, in CheckCallAndFilter rv, args, kwargs.get('cwd', None), None, None) CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progresshttps://chromium.googlesource.com/chromium/src/third_party/srv/example/webrtc/src/_gclient_third_party_1reibo' returned non-zero exit status 128 in /srv/example/webrtc ---------------------------------------- Traceback (most recent call last): File "/opt/depot_tools/gclient.py", line 2128, in sys.exit(main(sys.argv[1:])) File "/opt/depot_tools/gclient.py", line 2114, in main return dispatcher.execute(OptionParser(), argv) File "/opt/depot_tools/subcommand.py", line 252, in execute return command(parser, args[1:]) File "/opt/depot_tools/gclient.py", line 1876, in CMDsync ret = client.RunOnDeps('update', args) File "/opt/depot_tools/gclient.py", line 1363, in RunOnDeps work_queue.flush(revision_overrides, command, args, options=self._options) File "/opt/depot_tools/gclient_utils.py", line 1037, in run self.item.run(*self.args, **self.kwargs) File "/opt/depot_tools/gclient.py", line 772, in run file_list) File "/opt/depot_tools/gclient_scm.py", line 156, in RunCommand return getattr(self, command)(options, args, file_list) File "/opt/depot_tools/gclient_scm.py", line 417, in update self._Clone(revision, url, options) File "/opt/depot_tools/gclient_scm.py", line 889, in _Clone if os.listdir(tmp_dir): OSError: [Errno 2] No such file or directory: '/srv/example/webrtc/src/_gclient_third_party_1reibo'
遇到以上错误时,直接使用命令方式下载:
$ git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src/third_party
经查看,这个patch 已经在build.gn里更新,可以不用这个patch,修改D:\code\source\chromium\src\cef\patch 里面的patch.cfg
去掉
以上关于V8的错误,通过下面方式解决:
v8 切换3071 对应的版本
git checkout 5e1937396e481d17b69bd2e381f53dc5dd9072c1
版本
swiftshader>git checkout 9ed48bae7a2ff600712a0b8672f2b7d5f33b453b
9ed48bae7a2ff600712a0b8672f2b7d5f33b453b
webrtc
eeab9ccb2417cab18ae1681c6644c25fa4eadcd3
这个版本checkout 不出来,直接下的tar.gz版本
glslang版本
210c6bf4d8119dc5f8ac21da2d4c87184f7015e0
angle 版本
a9042d3c195294cf6b2186f1c52260f1fc2b6004
vulkan版本
tag/sdk-1.0.42.2
ee3e734713237d812847e52978629ef760e591e7
D:\code\source\chromium\src>python build/util/lastchange.py build/util/LASTCHANGE
D:\code\source\chromium\src>python build/util/lastchange.py -s third_party/WebKit/ -o build/util/LASTCHANGE.blink
node版本切换为6.9.4
需要D:\code\source\chromium\src\third_party\node\node_modules> 下安装
npm install vulcanize
npm install crisper
npm install uglifyjs
npm install polymer-css-build
unistd.h 属于linux 头文件
windows下没有的话自己创建个
#ifndef_UNISTD_H
#define_UNISTD_H1
/* This is intended as a drop-in replacement for unistd.h on Windows.
* Please add functionality as neeeded.
*https://stackoverflow.com/a/826027/1202830
*/
#include<stdlib.h>#include<io.h>#include<getopt.h>/* getopt at:https://gist.github.com/ashelly/7776712*/#include<process.h>/* for getpid() and the exec..() family */#include<direct.h>/* for _getcwd() and _chdir() */
#definesrandom srand
#definerandom rand
/* Values for the second argument to access.
These may be OR'd together. */#defineR_OK4/* Test for read permission. */#defineW_OK2/* Test for write permission. *///#define X_OK 1 /* execute permission - unsupported in windows*/#defineF_OK0/* Test for existence. */
#defineaccess _access
#definedup2 _dup2
#defineexecve _execve
#defineftruncate _chsize
#defineunlink _unlink
#definefileno _fileno
#definegetcwd _getcwd
#definechdir _chdir
#defineisatty _isatty
#definelseek _lseek
/* read, write, and close are NOT being #defined here, because while there are file handle specific versions for Windows, they probably don't work for sockets. You need to look at your app and consider whether to call e.g. closesocket(). */
#ifdef_WIN64
#definessize_t__int64
#else#definessize_tlong#endif
#defineSTDIN_FILENO0#defineSTDOUT_FILENO1#defineSTDERR_FILENO2/* should be in some equivalent to <sys/types.h> */typedef__int8int8_t;typedef__int16int16_t;
typedef__int32int32_t;typedef__int64int64_t;typedefunsigned__int8uint8_t;typedefunsigned__int16uint16_t;typedefunsigned__int32uint32_t;typedefunsigned__int64uint64_t;
#endif/* unistd.h */
由于3071版本的仓库太多已经废弃,找不到正确的版本,造成编译老出问题,放弃
建议可以使用新的版本进行编译
附chromium带git source 和third party 源码下载
网友评论