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

Linux 编译CEF源码详细记录

Linux CEF(Chromium Embedded Framework)源码下载编译

背景

由于CEF默认的二进制分发包不支持音视频播放,需要自行编译源码,将ffmpeg开关打开才能支持。这里介绍的是Linux平台下的CEF源码下载编译过程。

Windows平台参考:
《Windows 编译CEF源码详细记录》

前置条件

下载的过程非常艰辛,因为硬性要求比较高。

  • 16GB RAM (推荐 32GB+ )
  • 120GB SSD硬盘空闲空间起步(避免机械硬盘)
  • 100Mbps带宽(包括代理带宽)以及100G以上的代理流量

这里额外说明一下,下载过程总是失败,大概率原因是因为网络的问题,尤其是网络带宽和代理带宽。这里为什么要单独提代理带宽呢,因为公司有提供代理服务,但是只有10Mbps,所以会导致下载超时,服务端关闭连接。

注意,由于一些因素,下载代码的环境是基于WSL,编译的时候是在UOS V20 1050系统上,但总体差异不大,相关路径会有区别,仍有参考价值。

接下来开始下载CEF的代码

下载

创建目录结构

首先,先创建目录结构,最终的目录结构如下:

~/CEF/automate/automate-git.py   <-- CEF build scriptchromium_git/cef/              <-- CEF source checkoutchromium/src/            <-- Chromium source checkoutupdate.[bat|sh]   <-- Bootstrap script for automate-git.pydepot_tools/        <-- Chromium build tools

可以使用以下命令,创建目录

mkdir CEF && cd CEF && mkdir automate && mkdir chromium_git

终端设置代理

这一步非常重要,因为需要让终端走代理,才能正常下载代码

设置终端代理

export http_proxy=127.0.0.1:7890
export https_proxy=127.0.0.1:7890

通常情况下,这样就可以了,但由于公司的代理问题,设置了代理之后,bitbucket.org域名无法访问,所以我这里将bitbucket.org域名排除在外,这一步因人而异,但基本是不需要这一步的。

export no_proxy=localhost,bitbucket.org

验证代理是否设置成功

leoya@leoya-PC:~$ curl -I https://chromium.googlesource.com
HTTP/1.1 200 Connection establishedHTTP/2 200 
content-security-policy: script-src 'nonce-WfQMl6EHcID6PtyTna5LNQ' 'unsafe-inline' 'strict-dynamic' https: http: 'unsafe-eval';object-src 'none';base-uri 'self';report-uri https://csp.withgoogle.com/csp/gerritcodereview/1
content-type: text/html; charset=utf-8
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
date: Fri, 30 Jun 2023 02:04:17 GMT
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

这里通过curl去获取响应信息,能获取到状态码200或者304,即说明访问正常。可以额外对bitbucket.org也测试一下,如果访问失败,那说明需要将它排除在代理规则内,通过上述方法或者代理软件(如clash)设置代理规则为直连即可。

设置git代理

git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890

下载脚本

在CEF根目录下,下载depot_tools,并配置环境变量

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=/home/leoya/CEF/depot_tools:$PATH

下载automate-git.py脚本,这里需要在CEF/automate目录下

cd automate/
wget https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py

创建 ~/CEF/chromium_git/update.sh脚本

#!/bin/bash
python3 ../automate/automate-git.py --download-dir=/home/leoya/CEF/chromium_git --depot-tools-dir=/home/leoya/CEF/depot_tools --no-distrib --no-build

执行脚本

设置权限并执行

chmod 755 update.sh
./update.sh

接下来就是无尽的等待。

在这里插入图片描述

这里要特别注意depot_tools的更新进度,每次执行脚本的时候,它都会先更新depot_tools,如果更新状态过慢,可能网络有问题。

下载cef仓库的时候一般是没什么问题的。

这里最关键的是下载chromium源码的环节,因为脚本执行中断往往就是在这个环节。因为网络稳定性、下载速率等问题,导致出错。

在这里插入图片描述

当你看到Still working on字样的时候,恭喜你,你已经迈过了最艰难的环节,接下来就是下载终端,重试的成本也比较低,因为不用重新下载chromium源码。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

接下来见证下载成功的时刻!!!

在这里插入图片描述

报错信息总结

以下原因解释不一定正确,仅供参考
1.

[1:38:14] error: RPC failed; curl 56 GnuTLS recv error (-9):Error decoding the received TLS packet.[1:30:14] fatal:the remote end hung up unexpectedly
[1:30:14] fatail:"early EOF
[1:30:14] fatat: index-pack failed1:30:16]

在这里插入图片描述
这里大概率是网络不稳定导致下载中断

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: 远端意外挂断了
fatal: 过早的文件结束符(EOF)
fatal: index-pack 失败

这个就是因为下载速率太慢,导致长时间占用连接,服务端就主动关闭了连接。

编译 CEF

接下来即可修改ffmpeg文件以添加音视频的支持了

设置ffmpeg

chromium_git/chromium/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h文件的宏#define CONFIG_SIPR_PARSER 1由0设置为1,即启用。

生成工程

终端输入

export GN_DEFINES="use_sysroot=true symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false ffmpeg_branding=Chrome proprietary_codecs=true is_official_build=true use_gnome_keyring=false chrome_pgo_phase=0"
  • ffmpeg_branding和proprietary_codecs 表示开启多媒体编解码支持,但默认仅支持一小部分,想要支持更多可修改上面 ffmpeg 配置文件。
  • is_official_build 决定了是否是编译正式版本,指定该参数为 true 基本上都是为了产品发布使用,同时也会在创建解决方案的时候生成带有 sandbox 的解决方案,而不指定这个参数是没有的。
  • use_jumbo_build 官方资料默认指定,表示是否启用试验性的 jumbo 编译,编译过程会加快很多(至少快 1 小时),但是占用 CPU 和内存(尤其是内存)会剧增。
  • is_component_build 官方资料默认指定,但我们没有开启,这个参数表示是否启用组件化编译,设置为 true 以后,base、ffmpeg 等等都会被编译为动态库,使用时也是动态链接,编译出来的 cef_sandbox 只有几兆大小,并且你需要复制很多 dll 文件到项目目录下才能运行。

这里需要注意几个参数use_vaapi如果未设置为false,即使安装了vaapi,也会出现头文件的一些错误信息。

chrome_pgo_phase=0 禁用pgo文件。

use_gnome_keyring设置为false

进入code/chromium_git/chromium/src/cef路径,执行脚本,生成工程文件

./cef_create_projects.sh

问题处理

在生成工程的过程中,我这里遇到了很多错误,大多是缺失库。

printing:printing_unittests

ERROR at dynamically parsed input that //printing/BUILD.gn:464:16 loaded :1:1: Invalid token in literal value
-------------------------------------
^
See //BUILD.gn:287:15: which caused the file to be included.                                                  deps += [ "//printing:printing_unittests" ]^------------------------------
Traceback (most recent call last):                                                                            File "tools/gclient_hook.py", line 149, in <module>RunAction(src_dir, cmd)File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/cef/tools/gclient_util.py", line 36, in RunActioncommand, cwd=dir, always_show_header=True, print_stdout=True)File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/depot_tools/gclient_utils.py", line 716, in CheckCallAndFilterrv, args, kwargs.get('cwd', None), command_output.getvalue(), None)
subprocess2.CalledProcessError: Command 'gn gen out/Debug_GN_x64' returned non-zero exit status 1 in /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src
ERROR at dynamically parsed input that //printing/BUILD.gn:464:16 loaded :1:1: Invalid token in literal value
-------------------------------------
^
See //BUILD.gn:287:15: which caused the file to be included.                                                  deps += [ "//printing:printing_unittests" ]^------------------------------

缺失库,安装libcups2-dev库即可

sudo apt install libcups2-dev

Package glib-2.0 was not found in the pkg-config search path

ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py glib-2.0
Returned 1.
stderr:Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Could not run pkg-config.See //cef/BUILD.gn:2090:5: whence it was called.pkg_config("glib") {^-------------------
See //BUILD.gn:283:15: which caused the file to be included.                                                  deps += [ "//cef" ]^------
Traceback (most recent call last):                                                                            File "tools/gclient_hook.py", line 149, in <module>RunAction(src_dir, cmd)File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/cef/tools/gclient_util.py", line 36, in RunActioncommand, cwd=dir, always_show_header=True, print_stdout=True)File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/depot_tools/gclient_utils.py", line 716, in CheckCallAndFilterrv, args, kwargs.get('cwd', None), command_output.getvalue(), None)
subprocess2.CalledProcessError: Command 'gn gen out/Debug_GN_x64' returned non-zero exit status 1 in /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py glib-2.0
Returned 1.
stderr:Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Could not run pkg-config.See //cef/BUILD.gn:2090:5: whence it was called.pkg_config("glib") {^-------------------
See //BUILD.gn:283:15: which caused the file to be included.                                                  deps += [ "//cef" ]

安装

sudo apt install libglib2.0-dev

Package gnome-keyring-1 was not found in the pkg-config search path.

ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py gnome-keyring-1
Returned 1.
stderr:Package gnome-keyring-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnome-keyring-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnome-keyring-1' found
Could not run pkg-config.

这里就是前面提到的需要将use_gnome_keyring设置为false禁用掉。

终端输入,将其禁用

export GN_DEFINES="use_sysroot=true symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false ffmpeg_branding=Chrome proprietary_codecs=true is_official_build=true use_gnome_keyring=false chrome_pgo_phase=0"

Package dbus-1 was not found in the pkg-config search path

ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py dbus-1
Returned 1.
stderr:Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
Could not run pkg-config.

安装

sudo apt install libdbus-1-dev

Package nss was not found in the pkg-config search path

ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py nss -v -lssl3
Returned 1.
stderr:Package nss was not found in the pkg-config search path.
Perhaps you should add the directory containing `nss.pc'
to the PKG_CONFIG_PATH environment variable
No package 'nss' found
Could not run pkg-config.

安装

sudo apt install libnss3-dev

Package libva was not found in the pkg-config search path

ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py libva
Returned 1.
stderr:Package libva was not found in the pkg-config search path.
Perhaps you should add the directory containing `libva.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libva' found
Could not run pkg-config.

安装

sudo apt install libva-dev

Package gbm was not found in the pkg-config search path

ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.pkgresult = exec_script(pkg_config_script, args, "value")^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py gbm
Returned 1.
stderr:Package gbm was not found in the pkg-config search path.
Perhaps you should add the directory containing `gbm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gbm' found
Could not run pkg-config.
sudo apt install libgbm-dev

run “gclient runhooks” to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments

即pgo文件问题

ERROR at //build/config/compiler/pgo/BUILD.gn:81:23: Script returned non-zero exit code.pgo_data_path = exec_script("//tools/update_pgo_profiles.py",^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Release_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py --target linux get_profile_path
Returned 1.
stderr:Traceback (most recent call last):File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py", line 154, in <module>sys.exit(main())File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py", line 150, in mainreturn args.func(args)File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py", line 122, in _get_profile_pathprofile_path)
RuntimeError: requested profile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/chrome/build/pgo_profiles/chrome-linux-5672-1683023364-b47f9a07c616c94cac9f564aa6b00a8aaaec191a.profdata" doesn't exist, please make sure "checkout_pgo_profiles" is set to True in the "custom_vars" section of your .gclient file, e.g.: 
solutions = [ { "name": "src", # ...  "custom_vars": { "checkout_pgo_profiles": True, }, }, 
], 
and then run "gclient runhooks" to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments.See //build/config/BUILDCONFIG.gn:352:3: which caused the file to be included."//build/config/compiler/pgo:default_pgo_flags",

尝试了下载pgo文件,但失败,于是将其chrome_pgo_phase禁用

export GN_DEFINES="use_sysroot=false symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false ffmpeg_branding=Chrome proprietary_codecs=true is_official_build=true use_gnome_keyring=false chrome_pgo_phase=0"

若还是提示此错误,则可修改chromium_git/chromium/src/build/config/compiler/pgo/pgo.gni文件,最后的位置处加上chrome_pgo_phase = 0

  chrome_pgo_phase = 0if (!dcheck_always_on && is_official_build &&# TODO(crbug.com/1052397): Remove chromeos_is_browser_only once# target_os switch for lacros-chrome is completed.# TODO(crbug.com/1336055): Update this now-outdated condition with regard# to chromecast and determine whether chromeos_is_browser_only is# obsolete.(is_high_end_android || is_win || is_mac || is_fuchsia ||(is_linux && !is_castos && !chromeos_is_browser_only))) {chrome_pgo_phase = 2}
# 手动添加chrome_pgo_phase = 0# When using chrome_pgo_phase = 2, read profile data from this path.pgo_data_path = ""
}

当问题都解决后,就可以开始编译源码了。

开始编译

code/chromium_git/chromium/src路径下

# debug lib
ninja -C out/Debug_GN_x64 cefclient cefsimple ceftests chrome_sandbox
# release lib
ninja -C out/Release_GN_x64 cefclient cefsimple ceftests chrome_sandbox

这里直接执行的第二条命令

在编译过程中,也会出现错误,不过好在是增量编译,报错不会影响已经编译好的产物。

问题处理

gperf错误
sudo apt install gperf
No module named ‘importlib_metadata’
Traceback (most recent call last):File "../../third_party/blink/renderer/bindings/scripts/generate_bindings.py", line 12, in <module>import bind_genFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/__init__.py", line 36, in <module>from .callback_function import generate_callback_functionsFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/callback_function.py", line 8, in <module>from .blink_v8_bridge import blink_class_nameFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py", line 8, in <module>from .code_node import FormatNodeFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py", line 13, in <module>from .mako_renderer import MakoRendererFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py", line 7, in <module>import mako.runtimeFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/mako/mako/mako/runtime.py", line 14, in <module>from mako import compatFile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/mako/mako/mako/compat.py", line 68, in <module>import importlib_metadata  # noqa
ModuleNotFoundError: No module named 'importlib_metadata'
[559/47120] CXX obj/v8/cppgc_base/heap-consistency.o
ninja: build stopped: subcommand failed.

这个错误提示是最明显的了,安装python的importlib_metadata库即可

pip3 install importlib_metadata

如果pip命令未找到,那么先安装pip再执行上面的命令

sudo apt install python3-pip
fatal error: ‘pulse/pulseaudio.h’ file not found
gen/media/audio/pulse/pulse_stubs.cc:17:10: fatal error: 'pulse/pulseaudio.h' file not found
#include <pulse/pulseaudio.h>^~~~~~~~~~~~~~~~~~~~
1 error generated.                                                                                            
[6644/46562] CXX obj/extensions/common/api/generated_api_types/networking_private.o
ninja: build stopped: subcommand failed.
sudo apt install libpulse-dev 
fatal error: ‘curl/curl.h’ file not found
../../third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc:17:10: fatal error: 'curl/curl.h' file not found
#include <curl/curl.h>^~~~~~~~~~~~~
1 error generated.                                                                                            
[845/39891] CXX obj/third_party/crashpad/crashpad/util/util/metrics.o
ninja: build stopped: subcommand failed.
sudo apt install libcurl4-openssl-dev
fatal error: ‘pci/pci.h’ file not found
../../third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp:12:10: fatal error: 'pci/pci.h' file not found
#include <pci/pci.h>^~~~~~~~~~~
1 error generated.                                                                                            
[3735/39047] CXX obj/third_party/vulkan-deps/vulkan-validation-layers/src/VkLayer_khronos_validation/chassis.o
ninja: build stopped: subcommand failed.
sudo apt install libpci-dev
fatal error: ‘alsa/asoundlib.h’ file not found
../../media/midi/midi_manager_alsa.h:8:10: fatal error: 'alsa/asoundlib.h' file not found
#include <alsa/asoundlib.h>^~~~~~~~~~~~~~~~~~
1 error generated.                                                                                            
[4066/35313] CXX obj/media/mojo/mojom/speech_recognition/speech_recognition.mojom.o
ninja: build stopped: subcommand failed.
sudo apt install libasound2-dev

fatal error: ‘gssapi.h’ file not found

../../net/http/http_auth_gssapi_posix.h:26:10: fatal error: 'gssapi.h' file not found
#include <gssapi.h>^~~~~~~~~~
1 error generated.                                                                                            
[483/31248] CXX obj/net/net/http_cache_transaction.o
ninja: build stopped: subcommand failed.
 sudo apt install libkrb5-dev

当编译完成时,终端显示内容:

Leou@Leou-PC:/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src$ ninja -C out/Debug_GN_x64 cefclient cefsimple ceftests chrome_sandbox
ninja: Entering directory `out/Debug_GN_x64'
[57156/57156] LINK ./ceftests

生成CEF二进制分发包

记得选上--x64-build,否则默认为x86,会提示找不到头文件。生成的路径为/code/chromium_git/chromium/src/cef/binary_districhromium/src/cef/binary_distrib,会默认打包为zip压缩包

code/chromium_git/chromium/src/cef/tools$
# 打包Release
./make_distrib.sh --ninja-build --minimal --x64-build

生成的包名:
cef_binary_113.3.5+g0b33855+chromium-113.0.5672.129_linux64_minimal

# 同时打包Debug和Release
./make_distrib.sh --ninja-build --x64-build

生成的包名:

cef_binary_113.3.5+g0b33855+chromium-113.0.5672.129_linux64

ERROR: Please install Doxygen
ERROR: No docs generated.
Traceback (most recent call last):File "make_distrib.py", line 1251, in <module>copy_files_list(build_dir, dst_dir, binaries)File "make_distrib.py", line 325, in copy_files_listraise Exception('Missing required path: %s' % source_path)
Exception: Missing required path: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Release_GN_x64/chrome_sandbox
sudo apt install doxygen

当然也可以禁用生成doc文档,就不需要安装了。

总结

由于是事后记录,出错的问题未记录解决方案难免有疏漏。我在下载、编译、生成的阶段中,都会出现很多问题,但总体而言,Linux平台的CEF源码编译还算比较顺畅。

https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md
https://zhuanlan.zhihu.com/p/133675543
https://keqingrong.cn/blog/2021-12-20-building-chromium-on-windows/
https://www.mycode.net.cn/language/cpp/2784.html

相关文章:

Linux 编译CEF源码详细记录

Linux CEF&#xff08;Chromium Embedded Framework&#xff09;源码下载编译 背景 由于CEF默认的二进制分发包不支持音视频播放&#xff0c;需要自行编译源码&#xff0c;将ffmpeg开关打开才能支持。这里介绍的是Linux平台下的CEF源码下载编译过程。 Windows平台参考&#…...

LeetCode 2810. Faulty Keyboard【模拟,双端队列,字符串】简单

本文属于「征服LeetCode」系列文章之一&#xff0c;这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁&#xff0c;本系列将至少持续到刷完所有无锁题之日为止&#xff1b;由于LeetCode还在不断地创建新题&#xff0c;本系列的终止日期可能是永远。在这一系列刷题文章…...

两个数组的交集-C语言/Java

描述 给定两个数组 nums1 和 nums2 &#xff0c;返回 它们的交集 。输出结果中的每个元素一定是 唯一 的。我们可以 不考虑输出结果的顺序。&#xff08;1 < nums1.length, nums2.length < 1000&#xff0c;0 < nums1[i], nums2[i] < 1000&#xff09; 示例1 输入…...

Arduino+esp32学习笔记

学习目标&#xff1a; 使用Arduino配置好蓝牙或者wifi模块 学习使用python配置好蓝牙或者wifi模块 学习内容&#xff08;笔记&#xff09;&#xff1a; 一、 Arduino语法基础 Arduino语法是基于C的语法,C又是c基础上增加了面向对象思想等进阶语言。那就只记录没见过的。 单多…...

计算机网络-专业术语

计算机网络-专业术语 实体 实体:任何可发送或接收信息的硬件或软件进程 对等实体:收发双方相同层次中的实体 协议 控制两个对等实体进行逻辑通信的规则的集合 协议三要素 语法 定义所交换的信息的格式 是用户数据与控制信息的结构和格式 语义 定义收发双方所需要完成的操作…...

E. Maximum Monogonosity

You are given an array aa of length nn and an array bb of length nn. The cost of a segment [l,r][l,r], 1≤l≤r≤n1≤l≤r≤n, is defined as |bl−ar||br−al||bl−ar||br−al|. Recall that two segments [l1,r1][l1,r1], 1≤l1≤r1≤n1≤l1≤r1≤n, and [l2,r2][l2,…...

已解决Excel file format cannot be determined, you must specify an engine manually

问题 我使用以下语句时出现错误 data pd.read_excel(temp_inputc.csv, headerNone)出现错误&#xff1a; Excel file format cannot be determined, you must specify an engine manually有很多人说添加engine&#xff0c;但接下来会出现这个错误&#xff1a; File is not…...

Centos yum命令大全

1.使用YUM查找软件包 $ yum search python 2.列出所有可安装的软件包 $ yum list | grep python 3.列出所有可更新的软件包 $ yum list updates 4.列出所有已安装的软件包 $ yum list installed | grep python...

内网横向移动—ARP攻击图片捕捉数据劫持DNS劫持

内网横向移动—ARP攻击&图片捕捉&数据劫持&DNS劫持 1. ARP1.1. APR介绍1.1.1. ARP工作原理1.1.2. APR欺骗工作原理 1.2. 环境准备1.3. 适用场景 2. ARP断网攻击演示2.1. 使用kali进行演示2.1.1. nmap判断存活2.1.2. 安装工具2.1.3. 攻击Windows 10虚拟机2.1.3.1. 查…...

react之Hooks的介绍、useState与useEffect副作用的使用

react之Hooks的介绍、useState与useEffect副作用的使用 一、Hooks的基本介绍二、useState的使用2.1 简单使用2.2 数组结构简化2.3 状态的读取和修改2.3 组件的更新过程 三、useEffect的使用3.1 副作用介绍3.2 基本使用3.3 依赖3.4 不要对依赖项撒谎3.5 依赖项可以是空数组3.6 清…...

django——创建 Django 项目和 APP

2.创建 Django 项目和 APP 命令&#xff1a; 创建Django项目 django-admin startproject name 创建子应用 python manager.py startapp name 2.1 创建工程 在使用Flask框架时&#xff0c;项目工程目录的组织与创建是需要我们自己手动创建完成的。 在django中&#xff0c;…...

== 和 equals 的对比 [面试题]

和 equals 的对比[面试题] 文章目录 和 equals 的对比[面试题]1. 和 equals 简介2. Object 类中 equals() 源码3. String 类中 equals() 源码4. Integer 类中 equals() 源码5. 如何重写 equals 方法 1. 和 equals 简介 是一个比较运算符 &#xff1a;既可以判断基本数据类型…...

SpringBoot集成Redis及Redis使用方法

目录 应用背景 Redis简介 更新问题 一&#xff1a;环境配置 1.1: 在pom.xml文件中添加依赖 1.2&#xff1a;配置SpringBoot核心配置文件application.properties 二&#xff1a;在Config文件夹中创建RedisConfig配置文件类 2.1&#xff1a;RedisTemplate中的几个角色&am…...

Redis可以用作数据库吗?它的适用场景是什么?

是的&#xff0c;Redis可以用作数据库。虽然Redis通常被认为是一个内存数据库&#xff08;in-memory database&#xff09;&#xff0c;但它也可以通过持久化机制将数据保存在磁盘上&#xff0c;以便在重启后恢复数据。 Redis的适用场景包括但不限于以下几个方面&#xff1a; …...

@Param详解

文章目录 背景什么是ParamParam的使用方法使用方法&#xff1a;遇到的问题及因Param解决了什么问题使用与不使用对比 Param是如何进行映射的总结 背景 最近在开发过程中&#xff0c;在写mapper接口是在参数前加了Param注解&#xff0c;但是在运行的时候就会报错&#xff0c;说…...

自定义分页工具类

前言 在日常的开发工作中&#xff0c;会遇到很多不确定的需求场景&#xff0c;无法使用第三方提供的分页组件来实现&#xff0c;那么如何自己实现一个简单的分页工具类呢&#xff1f; 工具类 第一版本&#xff1a; Setter Getter public class PageTool<T> {/*** 当前…...

文本数据保存

文本数据保存 工具目的代码运行结果 工具 pycharm 目的 网址:https://ljgk.envsc.cn/ 需求&#xff1a;获取到地址&#xff08;address&#xff09;&#xff0c;公司名字&#xff08;ps_name&#xff09;&#xff0c;创建的时间&#xff08;create_time&#xff09;&#xff…...

Python爬虫:抓取表情包的下载链接

Python爬虫:抓取表情包的下载链接 1. 前言2. 具体实现3. 实现代码 1. 前言 最近发现了一个提供表情包的网址&#xff0c;觉得上面的内容不错&#xff0c;于是就考虑用Python爬虫获取上面表情包的下载链接。整体而言&#xff0c;实现这个挺简单的&#xff0c;就是找到提供表情包…...

(文章复现)基于灰狼算法(GWO)的交直流混合微网经济调度matlab代码

参考文献&#xff1a; [1]高瑜,黄森,陈刘鑫等.基于改进灰狼算法的并网交流微电网经济优化调度[J].科学技术与工程, 2020,20(28):11605-11611. [2]邓长征,冯朕,邱立等.基于混沌灰狼算法的交直流混合微网经济调度[J].电测与仪表, 2020, 57(04):99-107. 这两篇文章不管是从模型、…...

【Kubernetes】Kubernetes的调度

K8S调度 一、Kubernetes 调度1. Pod 调度介绍2. Pod 启动创建过程3. Kubernetes 的调度过程3.1 调度需要考虑的问题3.2 具体调度过程 二、影响kubernetes调度的因素1. nodeName2. nodeSelector3. 亲和性3.1 三种亲和性的区别3.2 键值运算关系3.3 节点亲和性3.4 Pod 亲和性3.5 P…...

在四层代理中还原真实客户端ngx_stream_realip_module

一、模块原理与价值 PROXY Protocol 回溯 第三方负载均衡&#xff08;如 HAProxy、AWS NLB、阿里 SLB&#xff09;发起上游连接时&#xff0c;将真实客户端 IP/Port 写入 PROXY Protocol v1/v2 头。Stream 层接收到头部后&#xff0c;ngx_stream_realip_module 从中提取原始信息…...

精益数据分析(97/126):邮件营销与用户参与度的关键指标优化指南

精益数据分析&#xff08;97/126&#xff09;&#xff1a;邮件营销与用户参与度的关键指标优化指南 在数字化营销时代&#xff0c;邮件列表效度、用户参与度和网站性能等指标往往决定着创业公司的增长成败。今天&#xff0c;我们将深入解析邮件打开率、网站可用性、页面参与时…...

HarmonyOS运动开发:如何用mpchart绘制运动配速图表

##鸿蒙核心技术##运动开发##Sensor Service Kit&#xff08;传感器服务&#xff09;# 前言 在运动类应用中&#xff0c;运动数据的可视化是提升用户体验的重要环节。通过直观的图表展示运动过程中的关键数据&#xff0c;如配速、距离、卡路里消耗等&#xff0c;用户可以更清晰…...

【LeetCode】算法详解#6 ---除自身以外数组的乘积

1.题目介绍 给定一个整数数组 nums&#xff0c;返回 数组 answer &#xff0c;其中 answer[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积 。 题目数据 保证 数组 nums之中任意元素的全部前缀元素和后缀的乘积都在 32 位 整数范围内。 请 不要使用除法&#xff0c;且在 O…...

使用SSE解决获取状态不一致问题

使用SSE解决获取状态不一致问题 1. 问题描述2. SSE介绍2.1 SSE 的工作原理2.2 SSE 的事件格式规范2.3 SSE与其他技术对比2.4 SSE 的优缺点 3. 实战代码 1. 问题描述 目前做的一个功能是上传多个文件&#xff0c;这个上传文件是整体功能的一部分&#xff0c;文件在上传的过程中…...

阿里云Ubuntu 22.04 64位搭建Flask流程(亲测)

cd /home 进入home盘 安装虚拟环境&#xff1a; 1、安装virtualenv pip install virtualenv 2.创建新的虚拟环境&#xff1a; virtualenv myenv 3、激活虚拟环境&#xff08;激活环境可以在当前环境下安装包&#xff09; source myenv/bin/activate 此时&#xff0c;终端…...

【实施指南】Android客户端HTTPS双向认证实施指南

&#x1f510; 一、所需准备材料 证书文件&#xff08;6类核心文件&#xff09; 类型 格式 作用 Android端要求 CA根证书 .crt/.pem 验证服务器/客户端证书合法性 需预置到Android信任库 服务器证书 .crt 服务器身份证明 客户端需持有以验证服务器 客户端证书 .crt 客户端身份…...

海云安高敏捷信创白盒SCAP入选《中国网络安全细分领域产品名录》

近日&#xff0c;嘶吼安全产业研究院发布《中国网络安全细分领域产品名录》&#xff0c;海云安高敏捷信创白盒&#xff08;SCAP&#xff09;成功入选软件供应链安全领域产品名录。 在数字化转型加速的今天&#xff0c;网络安全已成为企业生存与发展的核心基石&#xff0c;为了解…...

用 Rust 重写 Linux 内核模块实战:迈向安全内核的新篇章

用 Rust 重写 Linux 内核模块实战&#xff1a;迈向安全内核的新篇章 ​​摘要&#xff1a;​​ 操作系统内核的安全性、稳定性至关重要。传统 Linux 内核模块开发长期依赖于 C 语言&#xff0c;受限于 C 语言本身的内存安全和并发安全问题&#xff0c;开发复杂模块极易引入难以…...

边缘计算网关提升水产养殖尾水处理的远程运维效率

一、项目背景 随着水产养殖行业的快速发展&#xff0c;养殖尾水的处理成为了一个亟待解决的环保问题。传统的尾水处理方式不仅效率低下&#xff0c;而且难以实现精准监控和管理。为了提升尾水处理的效果和效率&#xff0c;同时降低人力成本&#xff0c;某大型水产养殖企业决定…...