当前位置: 首页 > news >正文

【环境搭建】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 

相关文章:

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

目录 写在前面 一&#xff0c;系统要求 二&#xff0c;安装depot_tools 三&#xff0c;获取代码 四&#xff0c;代码同步 五&#xff0c;代码结构 写在前面 当前的开发背景是基于Google的开源Chromium&#xff0c;来开发Android设备的浏览器方案。 一&#xff0c;系统要…...

开源智慧园区管理系统对比其他十种管理软件的优势与应用前景分析

内容概要 在当今数字化快速发展的时代&#xff0c;园区管理软件的选择显得尤为重要。而开源智慧园区管理系统凭借其独特的优势&#xff0c;逐渐成为用户的新宠。与传统管理软件相比&#xff0c;它不仅灵活性高&#xff0c;而且具有更强的可定制性&#xff0c;让各类园区&#…...

C语言可变参数

在C语言中&#xff0c;处理可变参数&#xff08;Variable Arguments&#xff09;主要依赖于 <stdarg.h> 头文件中的一组宏定义。 以下是详细讲解和示例&#xff1a; 声明可变参数函数&#xff1a;使用 ... 表示可变参数 访问参数&#xff1a;通过 va_list 类型和配套宏…...

(1)Linux高级命令简介

Linux高级命令简介 在安装好linux环境以后第一件事情就是去学习一些linux的基本指令&#xff0c;我在这里用的是CentOS7作演示。 首先在VirtualBox上装好Linux以后&#xff0c;启动我们的linux&#xff0c;输入账号密码以后学习第一个指令 简介 Linux高级命令简介ip addrtou…...

frida 入门

一直想学 frida 一直鸽&#xff0c;终于有 ctf 用到了&#xff0c;我测东西这么多 官方文档感觉写的依托&#xff0c;这 python rpc 直接拿来入门真的太有生活了 frida 是一个动态插桩 (dynamic instrumentation) 工具&#xff0c;提供了交互式 cli 界面来追踪函数行为。用人话…...

基于STM32的智能健康监测手环

1. 引言 随着可穿戴设备的普及&#xff0c;健康监测技术正逐步融入日常生活。本文设计了一款基于STM32的智能健康监测手环&#xff0c;能够实时采集用户心率、血氧饱和度、体温及运动数据&#xff0c;并通过低功耗蓝牙&#xff08;BLE&#xff09;与手机APP交互。该系统结合了…...

neo4j-community-5.26.0 install in window10

在住处电脑重新配置一下neo4j, 1.先至官方下载 Neo4j Desktop Download | Free Graph Database Download Neo4j Deployment Center - Graph Database & Analytics 2.配置java jdk jdk 21 官网下载 Java Downloads | Oracle 中国 path: 4.查看java -version 版本 5.n…...

Linux+Docer 容器化部署之 Shell 语法入门篇 【Shell 循环类型】

文章目录 一、Shell 循环类型二、Shell while 循环三、Shell for 循环四、Shell until 循环五、Shell select 循环六、总结 一、Shell 循环类型 循环是一个强大的编程工具&#xff0c;使您能够重复执行一组命令。在本教程中&#xff0c;您将学习以下类型的循环 Shell 程序&…...

WAWA鱼2024年终总结,关键词:成长

前言 本来想着偷懒一下&#xff0c;不写2024年终总结了&#xff0c;因为24年上半年还在忙毕业&#xff0c;下半年在忙转正&#xff0c;其实没什么太多好写的。结果被an_da和学弟催更了&#xff0c;哈哈哈&#xff0c;感谢大家对我近况的关注&#xff0c;学校内容基本都忘的差不…...

【Redis】hash 类型的介绍和常用命令

1. 介绍 Redis 中存储的 key-value 本身就是哈希表的结构&#xff0c;存储的 value 也可以是一个哈希表的结构 这里每一个 key 对应的一个 哈希类型用 field-value 来表示 2. 常用命令 命令 介绍 时间复杂度 hset key field value 用于设置哈希表 key 中字段 field 的值为…...

二分基础两道

Leetcode704: 给定一个 n 个元素有序的&#xff08;升序&#xff09;整型数组 nums 和一个目标值 target &#xff0c;写一个函数搜索 nums 中的 target&#xff0c;如果目标值存在返回下标&#xff0c;否则返回 -1。 示例 1: 输入: nums [-1,0,3,5,9,12], target 9 输出:…...

Skyeye 云 VUE 版本 v3.15.7 发布

Skyeye 云智能制造&#xff0c;采用 Springboot winUI 的低代码平台、移动端采用 UNI-APP。包含 30 多个应用模块、50 多种电子流程&#xff0c;CRM、PM、ERP、MES、ADM、EHR、笔记、知识库、项目、门店、商城、财务、多班次考勤、薪资、招聘、云售后、论坛、公告、问卷、报表…...

位运算和操作符属性

位运算和操作符属性 除了课件中提到的那几种应用&#xff0c;其他时候一般先不考虑用这个原反补码 printf("%d\n,017")打印出来则是15 printf("%d\n,0017")打印出来也是15 printf("%d\n,0x017")打印出来是23eg:2进制转换为32进制则每5个2进制位…...

php的使用及 phpstorm环境部署

php语法 环境搭建&#xff1a;在小皮中新建网站&#xff0c;注意先填写域名再点击选择根目录。 成功创建网站后&#xff0c;打开发现forbidden&#xff0c;因为新建的网站里是空的&#xff0c;需要新建index.php文件----> 在Phpstorm中左上角打开文件&#xff0c;打开那个文…...

高阶开发基础——快速入门C++并发编程6——大作业:实现一个超级迷你的线程池

目录 实现一个无返回的线程池 完全代码实现 Reference 实现一个无返回的线程池 实现一个简单的线程池非常简单&#xff0c;我们首先聊一聊线程池的定义&#xff1a; 线程池&#xff08;Thread Pool&#xff09; 是一种并发编程的设计模式&#xff0c;用于管理和复用多个线程…...

Jupyterlab和notebook修改文件的默认存放路径的方法

文章目录 1.缘由2.操作流程2.1找到默认的路径2.2创建配置文件2.3修改配置文件内容2.4注意事项 1.缘由 我自己使用jupyterlab的时候&#xff0c;打开是在这个浏览器上面打开的&#xff0c;但是这个打开的文件路径显示的是C盘上面路径&#xff0c;所以这个就很麻烦&#xff0c;因…...

吴恩达深度学习——有效运作神经网络

内容来自https://www.bilibili.com/video/BV1FT4y1E74V&#xff0c;仅为本人学习所用。 文章目录 训练集、验证集、测试集偏差、方差正则化正则化参数为什么正则化可以减少过拟合Dropout正则化Inverted Dropout其他的正则化方法数据增广Early stopping 归一化梯度消失与梯度爆…...

享元模式——C++实现

目录 1. 享元模式简介 2. 代码示例 1. 享元模式简介 享元模式是一种结构型模式。 享元模式用于缓存共享对象&#xff0c;降低内存消耗。共享对象相同的部分&#xff0c;避免创建大量相同的对象&#xff0c;减少内存占用。 享元模式需要将对象分成内部状态和外部状态两个部分…...

【Go语言圣经】第五节:函数

第五章&#xff1a;函数 5.1 函数声明 和其它语言类似&#xff0c;Golang 的函数声明包括函数名、形参列表、返回值列表&#xff08;可省略&#xff09;以及函数体&#xff1a; func name(parameter-list) (result-list) {/* ... Body ... */ }需要注意的是&#xff0c;函数…...

win32汇编环境,窗口程序中使用进度条控件

;运行效果 ;win32汇编环境,窗口程序中使用进度条控件 ;进度条控件主要涉及的是长度单位&#xff0c;每步步长&#xff0c;推进的时间。 ;比如你的长度是1000&#xff0c;步长是100&#xff0c;每秒走1次&#xff0c;则10秒走完全程 ;比如你的长度是1000&#xff0c;步长是10&am…...

个人知识库构建:OpenClaw+GLM-4.7-Flash自动归档网页与文档

个人知识库构建&#xff1a;OpenClawGLM-4.7-Flash自动归档网页与文档 1. 为什么需要自动化知识管理 作为一个长期与技术文档打交道的开发者&#xff0c;我发现自己陷入了一个典型的知识管理困境&#xff1a;每天浏览的优质技术文章、收藏的GitHub仓库、订阅的RSS源越来越多&…...

RAG技术新篇章:Modular RAG模块化架构如何引爆效率与效果?

本文深入解析了RAG技术的演进历程&#xff0c;从最初的Naive RAG到Advanced RAG&#xff0c;再到如今的Modular RAG&#xff0c;阐述了三者间的继承与发展关系。Modular RAG通过模块化设计和智能编排&#xff0c;实现了更高的灵活性和可扩展性。其核心在于Orchestration编排模块…...

推挽电路与图腾柱结构技术解析与应用

图腾柱与互补推挽电路的技术解析1. 推挽电路基础概念1.1 推挽电路基本原理推挽电路(Push-Pull)是一种功率放大电路结构&#xff0c;其核心设计思想是通过两个互补工作的晶体管交替导通&#xff0c;实现对输入信号的功率放大。典型推挽电路具有以下两个关键特性&#xff1a;强大…...

5步高效配置OpenCode:打造你的AI编程助手完整指南

5步高效配置OpenCode&#xff1a;打造你的AI编程助手完整指南 【免费下载链接】opencode 一个专为终端打造的开源AI编程助手&#xff0c;模型灵活可选&#xff0c;可远程驱动。 项目地址: https://gitcode.com/GitHub_Trending/openc/opencode 还在为复杂的AI编程工具配…...

怎样让AI真正操作你的电脑?5个实战场景深度解析Open Computer Use

怎样让AI真正操作你的电脑&#xff1f;5个实战场景深度解析Open Computer Use 【免费下载链接】open-computer-use Secure AI computer use powered by E2B Desktop Sandbox 项目地址: https://gitcode.com/gh_mirrors/op/open-computer-use 你是否曾想过让AI助手不只是…...

Phi-4-Reasoning-Vision惊艳案例:模糊低质图中关键信息增强与可信度评估

Phi-4-Reasoning-Vision惊艳案例&#xff1a;模糊低质图中关键信息增强与可信度评估 1. 专业级多模态推理工具 Phi-4-Reasoning-Vision是基于微软Phi-4-reasoning-vision-15B多模态大模型开发的高性能推理工具&#xff0c;专为双卡4090环境优化。这个工具严格遵循官方SYSTEM …...

Web前端开发毕业设计项目实战:从零搭建一个高可用、可扩展的TodoList应用

很多同学在做前端毕业设计时&#xff0c;常常感觉无从下手&#xff0c;要么功能太简单显得单薄&#xff0c;要么技术选型混乱&#xff0c;代码写得像“一锅粥”&#xff0c;答辩时被老师问得哑口无言。今天&#xff0c;我们就来一起动手&#xff0c;从零搭建一个结构清晰、技术…...

百川2-13B模型效果展示:代码生成与解释能力实测

百川2-13B模型效果展示&#xff1a;代码生成与解释能力实测 最近在开发者圈子里&#xff0c;关于AI编程助手的讨论越来越热。大家不再只关心模型参数有多大&#xff0c;而是更看重它实际干活的能力&#xff1a;我描述一个需求&#xff0c;它能写出能跑的代码吗&#xff1f;我贴…...

0基础java,面向对象

万物皆对象,要想创建一个对象,就必须要有一个类,一个类可以new很多很多的对象类的组成在一个类中,由属性和方法组成。同时和类相关的还有变量,权限修饰符和如何创建对象对象的创建对象的可以new一个出来,也就是创建。当然部分API不用写new也可以创建对象比如&#xff0c;在JDK8…...

阿里悟空 vs 腾讯龙虾:大厂 AI 自动化对决,普通人该怎么选?

最近 AI 自动化圈彻底炸了,一边是钉钉推出的阿里悟空,主打企业级合规与深度协同;另一边是腾讯全系铺开的龙虾(QClaw/WorkBuddy),靠着微信遥控、零门槛上手刷屏全网。 很多技术小白、职场人都在跟风 “养龙虾”,但这两个产品到底差在哪?腾讯龙虾真的适合所有人吗?今天…...