Firefox源码编译(Windows)
1、系统要求
内存:最低4GB,推荐8GB+。
磁盘空间:至少40GB的可用磁盘空间。
操作系统:Windows10。
2、系统准备
下载安装Visual Studio 2019的构建工具,选择以下项目安装:
选项卡:使用C++进行桌面开发
单个组件:
MSVC v143 - VS 2022 C++ x64/x86 构建工具。
Windows 10 SDK(至少10.0.19041.0)。
用于 v143 构建工具(x86 和 x64)的 C++ ATL。
3、安装MozillaBuild
下载MozillaBuildSetup-Latest后默认安装就可以。
如果后面安装是更低版本的firefox可选择更低的MozillaBuild,具体可以查看MozillaBuild - MozillaWiki
在后面使用时都要在MozillaBuild环境下进行操作,你可以通过运行C:\mozilla-build\start-shell.bat来启动它。
4、下载源码
可以先查看下firefox当前所有的发行版本:
Firefox发行版本
4.1、方法一
运行start-shell.bat,在其命令行环境中运行如下命令:
cd c:/
mkdir mozilla-source
cd mozilla-source
wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py
python3 bootstrap.py
bootstrap.py脚本会自动下载源码以及它需要的其他依赖项,这可能会需要一点时间。
更多的可能是会出现网络连接失败、下载依赖出错的情况。
网络连接失败的话需要有你有访问外网的能力,如果网络没问题,你可以重试几次。
如果是依赖出错的话,就要特殊处理了,见7、异常
4.2、方法二
运行start-shell.bat,运行命令如下:
mkdir mozilla-source
cd mozilla-source
hg clone https://hg.mozilla.org/mozilla-central
单纯clone源码,如果你需要其他版本可以使用hg update来切换。
开发版本可以用hg tags来查看
确定好源码后,再检查依赖,这步很关键,要不然后面的编译就会有问题。
./mach bootstrap
构建类型有4种
Firefox for Desktop Artifact Mode
Firefox for Desttop
GeckoView/Firefox for Android Artifact Mode
GeckoView/Firefox for Android
如果你只修改Firefox前端,就选择Artifact Mode。这里我要做Firefox桌面版本前后端修改,选择第二项。
如果都没出错中止,那后面直接编译运行就好了。
5、编译
./mach build
6、运行
./mach run
7、异常
7.1、依赖异常
最常见的就是依赖库找不到,对应的可以上这个页面查找https://firefox-ci-tc.services.mozilla.com/tasks/groups/IAX5qDepSDyGb-wntxG8RQ
然后修改如下两处代码:
taskcluster\taskgraph\util\taskcluster.py
def get_index_url(index_path, use_proxy=False, multiple=False):index_tmpl = liburls.api(get_root_url(use_proxy), "index", "v1", "task{}/{}")res = index_tmpl.format("s" if multiple else "", index_path)if index_path.find('.win64-node-10.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-node-10.latest'elif index_path.find('.win32-fix-stacks.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win32-fix-stacks.latest'elif index_path.find('.win32-minidump-stackwalk.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win32-minidump-stackwalk.latest'elif index_path.find('.win64-clang-cl-11.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-clang-11.latest'elif index_path.find('.win64-clang-tidy.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-clang-tidy.latest'elif index_path.find('.win64-cbindgen.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-cbindgen.latest' elif index_path.find('.win64-nasm.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-nasm.latest'elif index_path.find('.win64-sccache.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-sccache.latest'elif index_path.find('.rustc-dist-toolchain.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.rustc-dist-toolchain.latest'elif index_path.find('.clang-dist-toolchain.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.clang-dist-toolchain.latest'elif index_path.find('.win64-dump-syms.hash.') > 0 :res = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-dump-syms.latest'print('taskcluster/taskgraph/util/taskcluster.py:188====>', res)return res
python\mozbuild\mozbuild\artifact_commands.py
name = os.path.basename(artifact_name)artifact_url = get_artifact_url(task_id,artifact_name,use_proxy=not artifact_name.startswith("public/"),)if artifact_url.find('node.tar.bz2') > 0 :artifact_url = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-node-10.latest/artifacts/public/build/node.tar.zst'name = 'node.tar.zst'elif artifact_url.find('fix-stacks.tar.bz2') > 0 :artifact_url = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win32-fix-stacks.latest/artifacts/public/build/fix-stacks.tar.zst'name = 'fix-stacks.tar.zst'elif artifact_url.find('minidump_stackwalk.tar.xz') > 0 :artifact_url = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win32-minidump-stackwalk.latest/artifacts/public%2Fbuild%2Fminidump-stackwalk.tar.zst'name = 'minidump-stackwalk.tar.zst'elif artifact_url.find('cbindgen.tar.bz2') > 0 :artifact_url = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-cbindgen.latest/artifacts/public%2Fbuild%2Fcbindgen.tar.zst'name = 'cbindgen.tar.zst'elif artifact_url.find('nasm.tar.bz2') > 0 :artifact_url = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-nasm.latest/artifacts/public%2Fbuild%2Fnasm.tar.zst'name = 'nasm.tar.zst'elif artifact_url.find('sccache.tar.bz2') > 0 :artifact_url = 'https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-3.toolchains.v3.win64-sccache.latest/artifacts/public%2Fbuild%2Fsccache.tar.zst'name = 'sccache.tar.zst'super(ArtifactRecord, self).__init__(artifact_url, name, None, digest, algorithm, unpack=True)
重新检查依赖就可以了。
Firefox源码编译(Windows)相关推荐
- Grafana源码编译--Windows
Grafana源码编译–Windows 准备工作 1.系统:Windows 2.软件: (1)GO:尽量使用跟Grafana源码版本一样的Go版本,通过Github上https://github.co ...
- ThingsBoard 3.3.1源码编译-windows版
ThingsBoard 3.3.1源码编译-windows版 前期环境准备 环境版本尽量保持一致: 建议先把文章看完再操作,不要直接看一步操作一步! 编译过程要有耐心!不要看到执行到哪一步很久不动了, ...
- RedisDesktopManager源码编译windows版(基于2022.1版本)
一.环境依赖 1.Git 2.Visual Studio Community 2019 3.Qt 5.x 4.Python 3.9 5.CMake 6.Windows Openssl 7.NSIS 8 ...
- 代码工程 /Qt /5.9.3源码编译
文章目录 概述 小试牛刀 安装Perl configure 执行编译 执行安装 再试牛刀 CMD导致的杯具 正式使用新环境 Qt 安装版(exe文件) 目录基本说明 一个小插曲 重新来过 编译环境 P ...
- python源码编译 mingw_使用mingw32 在windows python26 下编译安装4suite-xml
最近在研究python下xml处理技术,需要在windows python26平台下安装4suite-xml. 但是4suite-xml在官网上只提供的最新安装包只支持到python25,也就是说只能 ...
- opencv + contrib windows下源码编译
网上,包括书上有很多人云亦云的源码编译方式,不能说不正确但是有很多弯弯绕绕(坑).最近刚做完了一个识别项目的第一个版本,总结了一下..为了写这篇文章,特意重新在自己电脑搭了一遍开发环境. 最权威的方式 ...
- windows和linux下源码编译7-Zip(7za)
windows和linux下源码编译7-Zip(7za) 如需转载请标明出处:http://blog.csdn.net/itas109 QQ技术交流群:129518033 文章目录 windows和l ...
- Windows 源码编译 nginx (加入nginx-http-flv-module)
文章目录 windows 源码编译 nginx,可以加入功能模块 1. 依赖 2. 步骤 2.1 下载源码 2.2 解压依赖 2.3 配置环境变量 2.4 配置和编译 3. 测试 4. 参考 wind ...
- 可视化工具VisIt源码编译教程(Windows,图文讲解)
我新建了一个VisIt软件的交流qq群:1169585995,欢迎大家加入一起交流,一起学习! 所用软件及其版本 用于源码编译的软件及版本如下: Windows版本:win10 VisIt版本:vis ...
最新文章
- MySQL表的key怎么设置为yes_MySQL 修改账号密码方法
- PHP clone() 函数克隆对象
- java代码审查规范
- 函数中使用栈与使用堆时函数执行效率浅对比
- 【收藏】Sentinel 高可用流量管理框架、服务熔断降级等
- Boost:gzip解压缩器
- Java内部类详解(转)
- C++对C的一些加强和变化
- No module named 'ConfigParser'
- PyTorch实战福利从入门到精通之四——卷积神经网络CIFAR-10图像分类
- php dll是下32还是64位,windows下关于boost 64位和32位库的编译详细介绍
- as 怎么将多个cpp文件代码编译成so_你编写的Java代码是咋跑起来的?
- java default修饰符_Java学习笔记--- 变量类型,修饰符
- oracle里round函数补0,Oracle的Round函数
- AI插件开发入门教程001 - AI脚本简介
- Fortran 读取gps广播星历和精密星历
- Veil-Evasion免杀
- Win10问题篇:解决鼠标玩游戏单击(左击/右击)失灵问题。
- 我九点钟上计算机课用英语怎么说,9点18分的英语怎么写(9点18用英语怎么说二种)...
- redis incr mysql_redis命令_INCR