【环境搭建】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,一经查实,立即删除!

相关文章

【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…

通信易懂唠唠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;说&…

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

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

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

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

总结11..

#include <stdio.h> #include <string.h> #define MAXN 1001 #define MAXM 1000001 int n, m; char maze[MAXN][MAXN]; int block[MAXN][MAXN]; // 标记每个格子所属的连通块编号 int blockSize[MAXN * MAXN]; // 记录每个连通块的大小 int dx[] {0, 0, 1, -1};…

SQL Server中DENSE_RANK()函数:简洁处理连续排名

什么是DENSE_RANK&#xff1f; DENSE_RANK()是SQL Server中的窗口函数&#xff0c;用于为结果集中的行生成无间隔的连续排名。与RANK()不同&#xff0c;当遇到相同值时&#xff0c;后续排名不会跳过数字。前一篇已经介绍了rank的用法&#xff0c;这次介绍一下dense_rank。 DEN…

【Go语言圣经】第七节:接口

第七章&#xff1a;接口 Golang 当中接口类型的独特之处在于它是满足隐式实现的。即&#xff1a;没必要对于给定的具体类型定义所有满足的接口类型&#xff0c;简单地拥有一些必要的方法即可。这种设计使得我们可以创建一个新的接口类型来满足已经存在的具体类型&#xff0c;却…

【网络】3.HTTP(讲解HTTP协议和写HTTP服务)

目录 1 认识URL1.1 URI的格式 2 HTTP协议2.1 请求报文2.2 响应报文 3 模拟HTTP3.1 Socket.hpp3.2 HttpServer.hpp3.2.1 start()3.2.2 ThreadRun()3.2.3 HandlerHttp&#xff08;&#xff09; 总结 1 认识URL 什么是URI&#xff1f; URI 是 Uniform Resource Identifier的缩写&…

数据分析师使用Kutools for Excel 插件

数据分析师使用Kutools for Excel 插件 Kutools for Excel 是一款功能强大的 Excel 插件&#xff0c;旨在提高 Excel 用户的工作效率&#xff0c;简化复杂的操作。它提供了超过 300 个增强功能&#xff0c;帮助用户快速完成数据管理、格式化、排序、分析等任务&#xff0c;特别…

ElasticStack简介及应用

文章目录 1.Elastic Stack 技术栈2.ES 安装2.1 准备2.2 yum单机部署2.3 集群部署 3.Kibana3.1 安装配置3.2 web访问 4.Filebeat4.1 安装4.2 配置 inputs4.3 配置 output4.4 索引4.5 分片和副本 5.收集nginx日志5.1 原生日志5.2 nginx日志格式5.3 filebeat 配置 6.logstash6.1 安…

解决Mac安装软件的“已损坏,无法打开。 您应该将它移到废纸篓”问题

mac安装软件时&#xff0c;如果出现这个问题&#xff0c;其实很简单 首先打开终端&#xff0c;输入下面的命令 sudo xattr -r -d com.apple.quarantine 输入完成后&#xff0c;先不要回车&#xff0c;点击访达--应用程序--找到你无法打开的app图标&#xff0c;拖到终端窗口中…