编译windows下chromium,时间:20170619,

编译windows下chromium,时间:20170619,

最初操作步骤基本按法定指引来

注1:本文书档案适用于webrtc和webrtc-android源码的下载和编写翻译;

合法地址:

官方地址:

System requirements

A 64-bit Mac running 10.11+.

Xcode7.3+.

The OS X 10.10 SDK. Run

$ ls`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs

to check whether you have it. Building with a newer SDK works too, but
the releases currently use the 10.10 SDK.

Installdepot_tools

Clone thedepot_toolsrepository:

$ git clone

Adddepot_toolsto the end of your PATH (you will probably want to put
this in your~/.bashrcor~/.zshrc). Assuming you
cloneddepot_toolsto/path/to/depot_tools:

$exportPATH=”$PATH:/path/to/depot_tools”

Get the
code

Create achromiumdirectory for the checkout and change to it (you can
call this whatever you like and put it wherever you like, as long as the
full path has no spaces):

$ mkdir chromium&&cd chromium

Run thefetchtool fromdepot_toolsto check out the code and its
dependencies.

$ fetch chromium

If you don’t want the full repo history, you can save a lot of time by
adding the–no-historyflag tofetch.

Expect the command to take 30 minutes on even a fast connection, and
many hours on slower ones.

chromium源码是用git托管的,在clone的历程中报错了,

[0:52:11] fatal: write error: File too large

Traceback (most recent call last):

File “/Volumes/dev/chromium/depot_tools/gclient_scm.py”, line 908, in
_Clone

self._Run(clone_cmd, options, cwd=self._root_dir, retry=True)

File “/Volumes/dev/chromium/depot_tools/gclient_scm.py”, line 1197, in
_Run

gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs)

File “/Volumes/dev/chromium/depot_tools/gclient_utils.py”, line 303,
in CheckCallAndFilterAndHeader

return CheckCallAndFilter(args, **kwargs)

File “/Volumes/dev/chromium/depot_tools/gclient_utils.py”, line 549,
in CheckCallAndFilter

rv, args, kwargs.get(‘cwd’, None), None, None)

CalledProcessError: Command ‘git -c core.deltaBaseCacheLimit=2g clone
–no-checkout –progress

/Volumes/dev/chromium/src/_gclient_src_E27kfa’ returned non-zero exit
status 128 in /Volumes/dev/chromium/src


经过荒谬提醒找到 git -c core.deltaBaseCacheLimit=2g clone –no-checkout
–progress 恐怕2g不夠,尝试直接用git -c core.deltaBaseCacheLimit=8g
clone … ,发现照旧特别。

经过搜索资料得知

修改git参数  git config –system core.longpaths=true

然后 执行   gclient sync

因为后面已经clone过部分代码,所以再一次 fetch chromium 肯定执行不断。

通过观望,到写文结束还没有报错,深夜挂机前些天再看景况。

注2:下载编写翻译所使用的操作系统为Ubuntu 14.04.3 LTS;

 

 

Chromium和Chromium
OS统一运用多少个号称depot_tools的工具的对其源码进行checkout的保管(那有点类似于Android使用repo工具对其源码举办田管均等),作为Chromium在那之中2个子模块的webrtc而言,也是选拔这些工具对其代码举办checkout。那个depot_rools包里面蕴涵了gclient、gcl、git-cl、repo等工具。

一. 系统供给:

  1. 六贰11位机器,至少8GB的内部存储器,推荐16GB以上。(小编用的Win10
    6肆位虚拟机,内存依照8G来的);

2.
至少100GB的硬盘存款和储蓄空间,格式为NTFS。FAT32不帮助胜出4GB的文本,而在git下载时的公文大概会有20GB+;

  1. Visual studio 2015 update 3;

  2. Win7+ (小编用的Win10编写翻译,此处大概有个坑,下文介绍);

一. 系统必要:

  1. 6三个人机器,至少8GB的内部存储器,推荐16GB以上。(作者用的Win10
    陆拾三人虚拟机,内部存款和储蓄器根据8G来的);

2.
足足100GB的硬盘存款和储蓄空间,格式为NTFS。FAT32不协理胜出4GB的文书,而在git下载时的文本只怕会有20GB+;

  1. 澳门金沙国际,Visual studio 2015 update 3;

  2. Win7+ (小编用的Win10编写翻译,此处只怕有个坑,下文介绍);

下载depot_tools工具包并放到标准路径PATH上:

二. 系统布署:

  1. 安装Visual studio 二零一六 update3,并设置window sdk 14393,vs须求安装Visual
    C++的八个挑选包涵MFC,Universal Windows Apps Development Tools >
    Tools (1.4.1) and Windows 10 SDK (10.0.14393);

  2. 14393的SDK安装时要设置Debugging Tools For
    Windows,作者一初始安装的时候,不知缘何没有设置那几个,修复了下后,才有的;

二. 系统安排:

  1. 安装Visual studio 二〇一六 update3,并设置window sdk 14393,vs要求设置Visual
    C++的多个选项包涵MFC,Universal Windows Apps Development Tools >
    Tools (1.4.1) and Windows 10 SDK (10.0.14393);

  2. 14393的SDK安装时要安装Debugging Tools For
    Windows,笔者一开首安装的时候,不知为啥并未设置这么些,修复了下后,才有的;

 首先保障Linux上安装了Git 2.2.1上述版本,以及Python 2.7以上版本;

三. 安装depot_tools:

  1. 下载depot_tools
    bundle,然后解压,地址:

  2. 将depot_tools放到PATH环境变量的开始地点,至少在您安装的python和git的眼下,因为depot_tools里面会下载python,要是在您安装的python后边的话,恐怕会出一部分不行预料的题材;

  3. 拉长环境变量DEPOT_TOOLS_WIN_TOOLCHAIN,并设为0;

4.
打开cmd.exe,运维gclient,在首先次运营的时候,gclient会安装python/msysgit等必不可少组件;

三. 安装depot_tools:

  1. 下载depot_tools
    bundle,然后解压,地址:

  2. 将depot_tools放到PATH环境变量的早先地点,至少在你安装的python和git的前方,因为depot_tools里面会下载python,假若在你安装的python前边的话,大概会出有个别不得预期的难题;

  3. 添加环境变量DEPOT_TOOLS_WIN_TOOLCHAIN,并设为0;

4.
开辟cmd.exe,运营gclient,在率先次运营的时候,gclient会安装python/msysgit等必备组件;

   git clone

四. 获取源码:

  1. 开辟cmd,在你想放置源码的地方,创造chromium文件夹并跻身,mkdir chromium && cd chromium;

  2. fetch chromium;

ps:那里有个难点,小编用的Win10带的暗许的windows
defender是翻开的,此时在下载完源码后会出现:

  1. Traceback (most recent call last):
  2. File “D:\git\google\depot_tools\gclient_scm.py”, line 965, in
    _Clone
  3. os.path.join(self.checkout_path, ‘.git’))
  4. File “D:\git\google\depot_tools\gclient_utils.py”, line 158,
    in safe_rename
  5. os.rename(old, new)
  6. WindowsError: [Error 5]
  7. [0:22:25] _____ removing non-empty tmp dir
    D:\google\_gclient_src_byzfvs

  8. Traceback (most recent call last):
  9. File “D:\git\google\depot_tools\gclient.py”, line 2378, in
    <module>
  10. sys.exit(main(sys.argv[1:]))
  11. 源码获取,Web奇骏TC源码下载及编写翻译流程。File “D:\git\google\depot_tools\gclient.py”, line 2364, in main
  12. return dispatcher.execute(OptionParser(), argv)
  13. File “D:\git\google\depot_tools\subcommand.py”, line 252, in
    execute
  14. return command(parser, args[1:])
  15. File “D:\git\google\depot_tools\gclient.py”, line 2117, in
    CMDsync
  16. ret = client.RunOnDeps(‘update’, args)
  17. File “D:\git\google\depot_tools\gclient.py”, line 1568, in
    RunOnDeps
  18. work_queue.flush(revision_overrides, command, args,
    options=self._options)
  19. File “D:\git\google\depot_tools\gclient_utils.py”, line 1112,
    in run
  20. self.item.run(*self.args, **self.kwargs)
  21. File “D:\git\google\depot_tools\gclient.py”, line 867, in run
  22. file_list)
  23. File “D:\git\google\depot_tools\gclient_scm.py”, line 166, in
    RunCommand
  24. return getattr(self, command)(options, args, file_list)
  25. File “D:\git\google\depot_tools\gclient_scm.py”, line 450, in
    update
  26. self._Clone(revision, url, options)
  27. File “D:\git\google\depot_tools\gclient_scm.py”, line 965, in
    _Clone
  28. os.path.join(self.checkout_path, ‘.git’))
  29. File “D:\git\google\depot_tools\gclient_utils.py”, line 158,
    in safe_rename
  30. os.rename(old, new)
  31. WindowsError: [Error 5]
  32. Traceback (most recent call last):
  33. File “D:\git\google\depot_tools\\fetch.py”, line 353, in
    <module>
  34. sys.exit(main())
  35. File “D:\git\google\depot_tools\\fetch.py”, line 348, in main
  36. return run(options, spec, root)
  37. File “D:\git\google\depot_tools\\fetch.py”, line 342, in run
  38. return checkout.init()
  39. File “D:\git\google\depot_tools\\fetch.py”, line 142, in init
  40. self.run_gclient(*sync_cmd)
  41. File “D:\git\google\depot_tools\\fetch.py”, line 76, in
    run_gclient
  42. return self.run(cmd_prefix + cmd, **kwargs)
  43. File “D:\git\google\depot_tools\\fetch.py”, line 66, in run
  44. return subprocess.check_output(cmd, **kwargs)
  45. File
    “D:\git\google\depot_tools\python276_bin\lib\subprocess.py”,
    line 573, in check_output
  46. raise CalledProcessError(retcode, cmd, output=output)
  47. subprocess.CalledProcessError: Command
    ‘(‘D:\\git\\google\\depot_tools\\python276_bin\\python.exe’,
    ‘D:\\git\\google\\depot_tools\\gclient.py’, ‘sync’,
    ‘–no-history’)’ returned non-zero exit status 1

诸如此类的难题,主若是杀软拦截导致删除文件目录失利,禁止使用掉WinDefender就好了,其余杀软或者有像样的图景,请小心,参考

  1. 源码下载成功后,cd src,进入src目录;

四. 获取源码:

  1. 开拓cmd,在你想放置源码的任务,创制chromium文件夹并进入,mkdir chromium && cd chromium;

  2. fetch chromium;

ps:那里有个难点,笔者用的Win10带的暗许的windows
defender是打开的,此时在下载完源码后会出现:

  1. Traceback (most recent call last):
  2. File “D:\git\google\depot_tools\gclient_scm.py”, line 965, in
    _Clone
  3. os.path.join(self.checkout_path, ‘.git’))
  4. File “D:\git\google\depot_tools\gclient_utils.py”, line 158,
    in safe_rename
  5. os.rename(old, new)
  6. WindowsError: [Error 5]
  7. [0:22:25] _____ removing non-empty tmp dir
    D:\google\_gclient_src_byzfvs

  8. Traceback (most recent call last):
  9. File “D:\git\google\depot_tools\gclient.py”, line 2378, in
    <module>
  10. sys.exit(main(sys.argv[1:]))
  11. File “D:\git\google\depot_tools\gclient.py”, line 2364, in main
  12. return dispatcher.execute(OptionParser(), argv)
  13. File “D:\git\google\depot_tools\subcommand.py”, line 252, in
    execute
  14. return command(parser, args[1:])
  15. File “D:\git\google\depot_tools\gclient.py”, line 2117, in
    CMDsync
  16. ret = client.RunOnDeps(‘update’, args)
  17. File “D:\git\google\depot_tools\gclient.py”, line 1568, in
    RunOnDeps
  18. work_queue.flush(revision_overrides, command, args,
    options=self._options)
  19. File “D:\git\google\depot_tools\gclient_utils.py”, line 1112,
    in run
  20. self.item.run(*self.args, **self.kwargs)
  21. File “D:\git\google\depot_tools\gclient.py”, line 867, in run
  22. file_list)
  23. File “D:\git\google\depot_tools\gclient_scm.py”, line 166, in
    RunCommand
  24. return getattr(self, command)(options, args, file_list)
  25. File “D:\git\google\depot_tools\gclient_scm.py”, line 450, in
    update
  26. self._Clone(revision, url, options)
  27. File “D:\git\google\depot_tools\gclient_scm.py”, line 965, in
    _Clone
  28. os.path.join(self.checkout_path, ‘.git’))
  29. File “D:\git\google\depot_tools\gclient_utils.py”, line 158,
    in safe_rename
  30. os.rename(old, new)
  31. WindowsError: [Error 5]
  32. Traceback (most recent call last):
  33. File “D:\git\google\depot_tools\\fetch.py”, line 353, in
    <module>
  34. sys.exit(main())
  35. File “D:\git\google\depot_tools\\fetch.py”, line 348, in main
  36. return run(options, spec, root)
  37. File “D:\git\google\depot_tools\\fetch.py”, line 342, in run
  38. return checkout.init()
  39. File “D:\git\google\depot_tools\\fetch.py”, line 142, in init
  40. self.run_gclient(*sync_cmd)
  41. File “D:\git\google\depot_tools\\fetch.py”, line 76, in
    run_gclient
  42. return self.run(cmd_prefix + cmd, **kwargs)
  43. File “D:\git\google\depot_tools\\fetch.py”, line 66, in run
  44. return subprocess.check_output(cmd, **kwargs)
  45. File
    “D:\git\google\depot_tools\python276_bin\lib\subprocess.py”,
    line 573, in check_output
  46. raise CalledProcessError(retcode, cmd, output=output)
  47. subprocess.CalledProcessError: Command
    ‘(‘D:\\git\\google\\depot_tools\\python276_bin\\python.exe’,
    ‘D:\\git\\google\\depot_tools\\gclient.py’, ‘sync’,
    ‘–no-history’)’ returned non-zero exit status 1

如此这般的题材,首假使杀软拦截导致删除文件目录战败,禁用掉WinDefender就好了,其余杀软大概有接近的情形,请留心,参考

  1. 源码下载成功后,cd src,进入src目录;

 
 修改HOME目录中的.bashrc文件,在最后扩大:PATH=”~/bin/depot_tools:$PATH”,注意早晚要把depot_tools的职位位于PATH的最前边;

五. 编写翻译(最愿意的时候到了):

  1. 第③利用暗许的编写翻译格局啊,使用gn
    gen
    out/Default,会在src目录下开创out/Default目录,并安顿些编写翻译必要的公文;

  2. 使用ninja -C out\Default
    chrome命令行编写翻译chrome,此时亟待等待漫长的年华;

ps:在利用ninja编写翻译的时候,小编那边出现了

ninja: Entering directory `out/Default’
ninja: error:
‘../../native_client/toolchain/mac_x86/pnacl_newlib/bin/x86_64-nacl-objcopy’,
needed by
‘irt_x64/obj/ppapi/native_client/nacl_irt_debuglink.inputdeps.stamp’,
missing and no known rule to make it

那种看似的错误,在src目录下行使cmd执行gclient
sync,顺遂化解,参考

  1. 编写翻译好了,运营Default下的chrome.exe吧。

 

五. 编写翻译(最愿意的时候到了):

  1. 第3利用暗许的编写翻译方式啊,使用gn
    gen
    out/Default,会在src目录下开创out/Default目录,并安插些编写翻译须要的文件;

  2. 使用ninja -C out\Default
    chrome命令行编写翻译chrome,此时亟待拭目以俟漫长的时光;

ps:在动用ninja编写翻译的时候,小编那边出现了

ninja: Entering directory `out/Default’
ninja: error:
‘../../native_client/toolchain/mac_x86/pnacl_newlib/bin/x86_64-nacl-objcopy’,
needed by
‘irt_x64/obj/ppapi/native_client/nacl_irt_debuglink.inputdeps.stamp’,
missing and no known rule to make it

这种看似的一无所能,在src目录下行使cmd执行gclient
sync,顺遂化解,参考

  1. 编写翻译好了,运转Default下的chrome.exe吧。

 

参考:

下载webrtc-native代码及编写翻译流程(首先要先根据以上步骤下载depot_tools):

mkdir webrtc-checkout

cd webrtc-checkout

fetch –nohooks webrtc

gclient sync//代码下载进程中只要产生搁浅,使用gclient sync同步就足以了

cd src/

./build/install-build-deps.sh(只需求在第2回gclient sync将来推行三回)

gn gen out/Default

ninja -C out/Default

gn clean out/Default

下载webrtc-android代码及编写翻译流程(首先要先依照以上步骤下载depot_tools
):

mkdir webrtc-android

cd webrtc-android

fetch –nohooks webrtc_android

gclient sync//代码下载进度中只要产生搁浅,使用gclient sync同步就能够了

cd src/

./build/install-build-deps.sh(只须求在首先次gclient sync现在推行二遍)

gn gen out/Debug –args=’target_os=”android” target_cpu=”arm”‘

ninja -C out/Debug

gn clean out/Debug

编写翻译和安装App翼虎TCMobile :

ninja -C out/Default AppRTCMobile

adb install -r out/Default/apks/AppRTCMobile.apk

Web智跑TC代码中期更新的三种办法(在src目录下):

   当前代码在有些分支下进展爱惜,使用git
pull能够拉取远程仓库的最新更新;

   当前代码不在分支下,使用git fetch取下来最新的git仓库更新;

   要求定期更新正视或许其余第1方库,使用gclient sync命令;

附录:

1.webrtc-android本子下载及编写翻译进程中留存play_services不设有的题材

问题讲述:

下载实现后执行:gn gen out/Debug –args=’target_os=”android”
target_cpu=”arm”‘命令出现以下打字与印刷错误:

pavel@ubuntu-han:~/webrtc-android/src$ gn gen out/Debug
–args=’target_os=”android” target_cpu=”arm”‘

ERROR at //build/config/android/rules.gni:2739:9: Script returned
non-zero exit code.       exec_script(“//build/android/gyp/aar.py”,

       ^———-

Current dir: /home/pavel/webrtc-android/src/out/Debug/

Command: python —
/home/pavel/webrtc-android/src/build/android/gyp/aar.py –input-file
../../third_party/android_tools/sdk/extras/google/m2repository/com/google/android/gms/play-services-basement/10.2.0/play-services-basement-10.2.0.aar
–list

Returned 1.

stderr:

Traceback (most recent call last):

 File “/home/pavel/webrtc-android/src/build/android/gyp/aar.py”, line
114, in <module>

   sys.exit(main())

 File “/home/pavel/webrtc-android/src/build/android/gyp/aar.py”, line
81, in main

   with zipfile.ZipFile(aar_file) as z:

 File “/usr/lib/python2.7/zipfile.py”, line 701, in __init__

   self.fp = open(file, modeDict[mode])

IOError: [Errno 2] No such file or directory:
‘../../third_party/android_tools/sdk/extras/google/m2repository/com/google/android/gms/play-services-basement/10.2.0/play-services-basement-10.2.0.aar’

See //third_party/android_tools/BUILD.gn:191:1: whence it was called.

android_aar_prebuilt(“google_play_services_basement_java”) {

^———————————————————–

See //webrtc/system_wrappers/BUILD.gn:155:7: which caused the file to
be included.   “//third_party/android_tools:cpu_features”,

     ^—————————————–

化解办法:

因而对该难题实行跟踪和查询,应该是在下载play
services框架的时候有一个license须求yes才足以,执行以下命令重新开动play
services的下载并在下载的历程中许可license:

./src/build/android/play_services/update.py download

2.webrtc-android本子编写翻译出现的jni难题

题材讲述:

pavel@ubuntu-han:~/webrtc-android/src$ ninja -C out/Debug/

ninja: Entering directory `out/Debug/’

[3/7329] ACTION
//base:android_runtime_jni_headers__jni_Runtime(//build/toolchain/android:android_arm)

FAILED: gen/android_runtime_jni_headers/base/jni/Runtime_jni.h

python ../../base/android/jni_generator/jni_generator.py –depfile
gen/base/android_runtime_jni_headers__jni_Runtime.d –jar_file
../../third_party/android_tools/sdk/platforms/android-24/android.jar
–input_file java/lang/Runtime.class –optimize_generation=1
–ptr_type=long –output_dir
gen/android_runtime_jni_headers/base/jni –includes
../../../../../../base/android/jni_generator/jni_generator_helper.h
–native_exports_optional

Traceback (most recent call last):

 File “../../base/android/jni_generator/jni_generator.py”, line 1418,
in <module>

   sys.exit(main(sys.argv))

 File “../../base/android/jni_generator/jni_generator.py”, line 1411,
in main

   GenerateJNIHeader(input_file, output_file, options)

 File “../../base/android/jni_generator/jni_generator.py”, line 1314,
in GenerateJNIHeader

   jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, options)

 File “../../base/android/jni_generator/jni_generator.py”, line 663,
in CreateFromClass

   stderr=subprocess.PIPE)

 File “/usr/lib/python2.7/subprocess.py”, line 679, in __init__

   errread, errwrite)

 File “/usr/lib/python2.7/subprocess.py”, line 1249, in _execute_child

   raise child_exception

OSError: [Errno 2] No such file or directory

[4/7329] CXX obj/base/base_paths/base_paths_android.o

消除办法:

出现上述难题是由于近期系统中缺点和失误一些编写翻译webrtc-android的零部件,供给调用以下三个脚本在脚下系统中装置要求的零件即可:

./build/install-build-deps.sh

./build/install-build-deps-android.sh

相关文章