【环境搭建】1.1源码下载与同步

目录

写在前面

一,系统要求

二,安装depot_tools

三,获取代码

四,代码同步 

五,代码结构


写在前面

当前的开发背景是基于Google的开源Chromium,来开发Android设备的浏览器方案。

一,系统要求

  • 运行 Linux 的 x86-64 计算机,至少配备 8GB RAM。强烈建议配备 16GB 以上 RAM。
  • 至少 100GB 的可用磁盘空间。
  • 必须已经安装 Git 和 Python。

大多数开发都是在 Ubuntu 上完成的,所以建议最好是在Ubuntu上完成开发环境的搭建。

二,安装depot_tools

克隆depot_tools仓库:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

添加depot_tools到 PATH 的末尾(如~/.bashrc或中~/.zshrc)。假设克隆depot_tools/path/to/depot_tools

export PATH="$PATH:/path/to/depot_tools"

三,获取代码

mkdir ~/chromium && cd ~/chromium
fetch --nohooks android

如果不想获取完整的 repo 历史记录,可以通过添加--no-history参数来节省fetch的时间

即使网络连接良好,fetch命令也需要 30 分钟,而如果网络连接不稳定或速度较慢,可能需要数小时。

fetch完成后,它将在工作目录中创建一个隐藏.gclient文件和一个名为的目录src,切换到scr目录下

cd src

四,代码同步 

fetch过程中可能会发生异常断开,如网络连接问题等,可以使用gclient sync继续同步:

During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/home/bill/.cache/vpython-root.1000/store/cpython+l5fnajrvijf7cvdkjqmbicg3i8/contents/lib/python3.11/shutil.py", line 853, in moveos.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/home/bill/02_chromium/code/src' -> '/home/bill/02_chromium/code/_bad_scm/srcgi8b4dry/src'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/home/bill/02_chromium/depot_tools/metrics.py", line 302, in print_notice_and_exityieldFile "/home/bill/02_chromium/depot_tools/gclient.py", line 4670, in <module>sys.exit(main(sys.argv[1:]))^^^^^^^^^^^^^^^^^^File "/home/bill/02_chromium/depot_tools/gclient.py", line 4656, in mainreturn dispatcher.execute(OptionParser(), argv)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/bill/02_chromium/depot_tools/subcommand.py", line 254, in executereturn command(parser, args[1:])^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/bill/02_chromium/depot_tools/gclient.py", line 4009, in CMDsyncret = client.RunOnDeps('update', args)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/bill/02_chromium/depot_tools/gclient.py", line 2449, in RunOnDepswork_queue.flush(revision_overrides,File "/home/bill/02_chromium/depot_tools/gclient_utils.py", line 1045, in flushreraise(e[0], e[1], e[2])File "/home/bill/02_chromium/depot_tools/gclient_utils.py", line 54, in reraiseraise valueFile "/home/bill/02_chromium/depot_tools/gclient_utils.py", line 1124, in runself.item.run(*self.args, **self.kwargs)File "/home/bill/02_chromium/depot_tools/gclient.py", line 1251, in runself._got_revision = self._used_scm.RunCommand(^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/bill/02_chromium/depot_tools/gclient_scm.py", line 137, in RunCommandreturn getattr(self, command)(options, args, file_list)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/bill/02_chromium/depot_tools/gclient_scm.py", line 664, in wrapperreturn_val = f(*args)^^^^^^^^File "/home/bill/02_chromium/depot_tools/gclient_scm.py", line 835, in updateself._DeleteOrMove(options.force)File "/home/bill/02_chromium/depot_tools/gclient_scm.py", line 209, in _DeleteOrMoveshutil.move(self.checkout_path, dest_path)File "/home/bill/.cache/vpython-root.1000/store/cpython+l5fnajrvijf7cvdkjqmbicg3i8/contents/lib/python3.11/shutil.py", line 873, in movecopy_function(src, real_dst)File "/home/bill/.cache/vpython-root.1000/store/cpython+l5fnajrvijf7cvdkjqmbicg3i8/contents/lib/python3.11/shutil.py", line 448, in copy2copyfile(src, dst, follow_symlinks=follow_symlinks)File "/home/bill/.cache/vpython-root.1000/store/cpython+l5fnajrvijf7cvdkjqmbicg3i8/contents/lib/python3.11/shutil.py", line 256, in copyfilewith open(src, 'rb') as fsrc:^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/bill/02_chromium/code/src'Subprocess failed with return code 1.
bill@MS-OLZZYEYREIDZ:~/02_chromium/code$ fetch --nohooks android
Running: gclient root
Your current directory appears to already contain, or be part of,
a checkout. "fetch" is used only to get new checkouts. Use
"gclient sync" to update existing checkouts.Fetch also does not yet deal with partial checkouts, so if fetch
failed, delete the checkout and start over (crbug.com/230691).
gclient sync
bill@MS-OLZZYEYREIDZ:~/02_chromium/code$ gclient sync -j8________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/bill/02_chromium/code/_gclient_src_rutw765q' in '/home/bill/02_chromium/code'
Cloning into '/home/bill/02_chromium/code/_gclient_src_rutw765q'...
remote: Finding sources: 100% (6084/6084)
remote: Total 24630445 (delta 17947971), reused 24628946 (delta 17947971)
Receiving objects: 100% (24630445/24630445), 51.76 GiB | 12.50 MiB/s, done.
Resolving deltas: 100% (17947971/17947971), done.[1:20:34] Still working on:
[1:20:34]   src[1:20:44] Still working on:
[1:20:44]   src[1:20:54] Still working on:
[1:20:54]   src[1:21:04] Still working on:
[1:21:04]   src
1>Syncing projects:   0% ( 0/ 2)
[1:21:10] Still working on:
[1:21:10]   src[1:21:10] Still working on:
[1:21:10]   src
Syncing projects:  99% (372/375) src/third_party/dawn/third_party/webgpu-cts
[1:29:56] Still working on:
[1:29:56]   src/third_party/chromium-variations
[1:29:56]   src/v8
[1:29:56]   src/third_party/angle/third_party/VK-GL-CTS/src[1:29:58] Still working on:
[1:29:58]   src/third_party/chromium-variations
[1:29:58]   src/v8
[1:29:58]   src/third_party/angle/third_party/VK-GL-CTS/src
Syncing projects:  99% (374/375) src/third_party/angle/third_party/VK-GL-CTS/src
[1:31:51] Still working on:
[1:31:51]   src/third_party/chromium-variations[1:32:01] Still working on:
[1:32:01]   src/third_party/chromium-variations[1:32:11] Still working on:
[1:32:11]   src/third_party/chromium-variations[1:32:21] Still working on:
[1:32:21]   src/third_party/chromium-variations[1:32:31] Still working on:
[1:32:31]   src/third_party/chromium-variations[1:32:41] Still working on:
[1:32:41]   src/third_party/chromium-variations[1:32:51] Still working on:
[1:32:51]   src/third_party/chromium-variations[1:33:01] Still working on:
[1:33:01]   src/third_party/chromium-variations[1:33:11] Still working on:
[1:33:11]   src/third_party/chromium-variations[1:33:21] Still working on:
[1:33:21]   src/third_party/chromium-variations[1:33:31] Still working on:
[1:33:31]   src/third_party/chromium-variations[1:33:41] Still working on:
[1:33:41]   src/third_party/chromium-variations[1:33:51] Still working on:
[1:33:51]   src/third_party/chromium-variations[1:34:01] Still working on:
[1:34:01]   src/third_party/chromium-variations[1:34:11] Still working on:
[1:34:11]   src/third_party/chromium-variations[1:34:17] Still working on:
[1:34:17]   src/third_party/chromium-variations
Syncing projects: 100% (375/375), done.
Hook 'vpython3 -vpython-spec src/.vpython3 -vpython-tool install' took 46.21 secs
Hook 'python3 src/testing/generate_location_tags.py --out src/testing/location_tags.json' took 30.32 secs
Running hooks: 100% (112/112), done.

五,代码结构

下面是代码同步完成后的代码目录:

bill@MS-OLZZYEYREIDZ:~/02_chromium/code$ ls
_bad_scm  src

bill@MS-OLZZYEYREIDZ:~/02_chromium/code/src$ ls
ATL_OWNERS           PRESUBMIT_test.py        chrome               extensions    mojo               signing_keys
AUTHORS              PRESUBMIT_test_mocks.py  chromecast           fuchsia_web   native_client      skia
BUILD.gn             README.md                chromeos             gin           native_client_sdk  sql
CODE_OF_CONDUCT.md   WATCHLISTS               clank                google_apis   net                storage
CPPLINT.cfg          android_webview          codelabs             gpu           out                styleguide
CRYPTO_OWNERS        apps                     codereview.settings  headless      pdf                testing
DEPS                 ash                      components           infra         ppapi              third_party
DIR_METADATA         base                     content              internal      printing           tools
LICENSE              build                    crypto               ios           remoting           ui
LICENSE.chromium_os  build_overrides          dbus                 ios_internal  rlz                url
OWNERS               buildtools               device               ipc           sandbox            v8
PRESUBMIT.py         cc                       docs                 media         services           webkit 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/70100.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Image Resize:强大的在线图像处理工具

Image Resize 是一款免费的在线批量图像处理工具&#xff0c;让你轻松调整图像大小、裁剪、压缩&#xff0c;支持多种格式。 批量处理&#xff1a;一次编辑多个图像&#xff0c;提高工作效率。多种格式支持&#xff1a;支持PNG、JPG等多种常见图像格式&#xff0c;满足不同需求…

Pyside/Pyqt 全部类的层级关系

PySide&#xff08;如PySide6&#xff09;的类层级结构基于Qt框架&#xff0c;以下是主要模块及其核心类的层级关系概览。由于类数量庞大&#xff0c;此处仅列出关键类和继承关系&#xff1a; 1. QtCore 模块 基础类与工具 QObject (所有Qt对象的基类) QCoreApplication (控制…

【Linux系统】CPU指令集 和 Linux系统权限 ring 0 / ring 3

CPU 指令集 CPU 指令集&#xff1a;是 CPU 实现软件指挥硬件执行的媒介&#xff0c;具体来说每一条汇编语句都对应了一条CPU指令&#xff0c;而非常非常多的 CPU 指令在一起&#xff0c;可以组成一个、甚至多个集合&#xff0c;指令的集合叫CPU指令集。 CPU 指令集有权限分级&…

Slint的学习

Slint是什么 Slint是一个跨平台的UI工具包&#xff0c;支持windows,linux,android,ios,web&#xff0c;可以用它来构建申明式UI,后端代码支持rust,c,python,nodejs等语言。 开源地址&#xff1a;https://github.com/slint-ui/slint 镜像地址&#xff1a;https://kkgithub.com/…

互联网行业常用12个数据分析指标和八大模型

本文目录 前言 一、互联网线上业务数据分析的12个指标 1. 用户数据&#xff08;4个&#xff09; (1) 存量&#xff08;DAU/MAU&#xff09; (2) 新增用户 (3) 健康程度&#xff08;留存率&#xff09; (4) 渠道来源 2. 用户行为数据&#xff08;4个&#xff09; (1) 次数/频率…

九. Redis 持久化-RDB(详细讲解说明,一个配置一个说明分析,步步讲解到位)

九. Redis 持久化-RDB(详细讲解说明&#xff0c;一个配置一个说明分析&#xff0c;步步讲解到位) 文章目录 九. Redis 持久化-RDB(详细讲解说明&#xff0c;一个配置一个说明分析&#xff0c;步步讲解到位)1. RDB 概述2. RDB 持久化执行流程3. RDB 的详细配置4. RDB 备份&恢…

[权限提升] Windows 提权 维持 — 系统错误配置提权 - Trusted Service Paths 提权

关注这个专栏的其他相关笔记&#xff1a;[内网安全] 内网渗透 - 学习手册-CSDN博客 0x01&#xff1a;Trusted Service Paths 提权原理 Windows 的服务通常都是以 System 权限运行的&#xff0c;所以系统在解析服务的可执行文件路径中的空格的时候也会以 System 权限进行解析&a…

4 前置技术(下):git使用

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言 前言

全面掌握市场信息:xtquant库在证券品种数据获取中的应用

全面掌握市场信息&#xff1a;xtquant库在证券品种数据获取中的应用 开篇点题&#xff1a;技术背景和应用场景 在量化交易领域&#xff0c;快速准确地获取市场基础信息是至关重要的。xtquant库提供了一种便捷的途径来获取各类证券品种的数据&#xff0c;包括股票、指数、基金等…

通信易懂唠唠SOME/IP——SOME/IP-SD服务发现阶段和应答行为

一 SOME/IP-SD服务发现阶划分 服务发现应该包含3个阶段 1.1 Initial Wait Phase初始等待阶段 初始等待阶段的作用 初始等待阶段是服务发现过程中的一个阶段。在这个阶段&#xff0c;服务发现模块等待服务实例的相关条件满足&#xff0c;以便继续后续的发现和注册过程。 对…

【python】python基于机器学习与数据分析的手机特性关联与分类预测(源码+数据集)【独一无二】

&#x1f449;博__主&#x1f448;&#xff1a;米码收割机 &#x1f449;技__能&#x1f448;&#xff1a;C/Python语言 &#x1f449;专__注&#x1f448;&#xff1a;专注主流机器人、人工智能等相关领域的开发、测试技术。 python基于机器学习与数据分析的手机特性关联与分类…

测试csdn图片发布

测试csdn图片发布 ​​

JVM监控和管理工具

基础故障处理工具 jps jps(JVM Process Status Tool)&#xff1a;Java虚拟机进程状态工具 功能 1&#xff1a;列出正在运行的虚拟机进程 2&#xff1a;显示虚拟机执行主类(main()方法所在的类) 3&#xff1a;显示进程ID(PID&#xff0c;Process Identifier) 命令格式 jps […

51单片机 06 定时器

51 单片机的定时器属于单片机的内部资源&#xff0c;其电路的连接和运转均在单片机内部完成。 作用&#xff1a;1、用于计时&#xff1b;2、替代长时间的Delay&#xff0c;提高CPU 运行效率和处理速度。 定时器个数&#xff1a;3个&#xff08;T0、T1、T2&#xff09;&#xf…

洛谷 P1164 小A点菜 C语言

P1164 小A点菜 - 洛谷 | 计算机科学教育新生态 题目背景 uim 神犇拿到了 uoi 的 ra&#xff08;镭牌&#xff09;后&#xff0c;立刻拉着基友小 A 到了一家……餐馆&#xff0c;很低端的那种。 uim 指着墙上的价目表&#xff08;太低级了没有菜单&#xff09;&#xff0c;说&…

VUE3 pinia的对象莫名其妙被赋值成其他对象

我写项目时发现&#xff0c;我明明把这个属性赋值成数组了&#xff0c;但是一启动项目&#xff0c;他就变成了对象了&#xff0c;还是个请求失败的返回对象&#xff0c;很是莫名其妙 后来一步一步的删除代码&#xff0c;看看是哪里影响到了&#xff0c;直到我删除了pinia的持久…

解释 Java 中的垃圾回收机制,以及如何优化垃圾回收性能?

Java中的垃圾回收机制是一种自动管理内存的机制&#xff0c;它负责在程序运行过程中检测和清除不再被引用的对象&#xff0c;从而释放其占用的内存空间。 垃圾回收机制通过标记-清除、复制、标记-整理等算法实现&#xff0c;能够有效避免内存泄漏&#xff0c;提高程序的性能和…

面向对象程序的三大特性之一的封装JAVA

1. 封装 1.1 封装的概念 面向对象程序三大特性&#xff1a;封装、继承、多态 。而类和对象阶段&#xff0c;主要研究的就是封装特性。何为封装呢&#xff1f;简单来说就是套壳屏蔽细节 。 比如&#xff1a;对于电脑这样一个复杂的设备&#xff0c;提供给用户的就只是&#…

[leetcode·回溯算法]回溯算法解题套路框架

本文参考labuladong算法笔记[回溯算法解题套路框架 | labuladong 的算法笔记] 本文解决几个问题&#xff1a; 回溯算法是什么&#xff1f;解决回溯算法相关的问题有什么技巧&#xff1f;如何学习回溯算法&#xff1f;回溯算法代码是否有规律可循&#xff1f; 其实回溯算法和我…

Android 使用ExpandableListView时,需要注意哪些细节

1. 布局属性设置 尺寸属性 宽度和高度&#xff1a;要合理设置 android:layout_width 和 android:layout_height 属性。如果设置为 match_parent&#xff0c;它会填满父容器&#xff1b;设置为 wrap_content&#xff0c;则会根据内容自动调整大小。例如&#xff0c;若想让 Exp…