Openharmony3.2 源码编译(ubuntu 22.04) 过程记录

OS: ubuntu 22.04 x64

1. 下载源码

1.1 安装码云repo工具

sudo apt install python3-pip git-lfsmkdir ~/bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo 
chmod a+x ~/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests

1.2 将repo添加到环境变量

vim ~/.bashrc               # 编辑环境变量
export PATH=~/bin:$PATH     # 在环境变量的最后添加一行repo路径信息
source ~/.bashrc            # 应用环境变量

1.3 获取源码

需有gitee.com 账号,同时设置好ssh 公钥登录(https://gitee.com/help/articles/4191#article-header0)

vm@vm:~$ mkdir oh 
vm@vm:~$ cd oh
vm@vm:~/oh$  repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-3.2-Release --no-repo-verify
remote: Enumerating objects: 9229, done.
remote: Counting objects: 100% (676/676), done.
remote: Compressing objects: 100% (467/467), done.
remote: Total 9229 (delta 393), reused 125 (delta 56), pack-reused 8553Your identity is: maoxiaochuan <maoxiaochuan-gz@loongson.cn>
If you want to change this, please re-run 'repo init' with --config-namerepo has been initialized in /home/vm/ohvm@vm:~/oh$ repo sync -c
remote: Enumerating objects: 1260, done.
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Counting objects: 100% (279/279), done.
remote: Total 51 (delta 0), reused 2 (delta 0), pack-reused 47
remote: Compressing objects: 100% (189/189), done.
Fetching projects:   0% (1/353) applications_camera_sample_communicationremote: Enumerating objects: 1526, done.0Updating files: 100% (2351/2351), done.
Checking out projects:  83% (293/353) third_party_libusbUpdating files:  36% (1Updating files: 100% (451/451), done.
Checking out projects:  85% (302/353) third_party_mbedtlsUpdating files:  28% (Updating files: 100% (8570/8570), done.
Checking out projects:  85% (303/353) third_party_mesa3dUpdating files:  59% (8Updating files: 100% (14195/14195), done.
Checking out projects:  87% (310/353) third_party_ninjaUpdating files:   2% (37Updating files: 100% (12683/12683), done.
Checking out projects:  88% (312/353) third_party_ntfs-3gUpdating files:  85% (Updating files: 100% (1511/1511), done.
Checking out projects:  89% (315/353) third_party_opencl-headersUpdating files:Updating files: 100% (720/720), done.
Checking out projects:  89% (317/353) third_party_openmaxUpdating files:  76% (Updating files: 100% (3166/3166), done.
Checking out projects:  92% (325/353) third_party_pulseaudioUpdating files:  78Updating files: 100% (4384/4384), done.
Checking out projects:  93% (330/353) third_party_selinuxUpdating files:   5% (Updating files: 100% (54797/54797), done.
Checking out projects:  94% (335/353) third_party_toyboxUpdating files:   0% (3Updating files: 100% (58182/58182), done.
Checking out projects:  96% (339/353) third_party_unityUpdating files:   1% (86Updating files: 100% (6429/6429), done.
Checking out projects: 100% (353/353), done.
repo sync has finished successfully.vm@vm:~/oh$ repo forall -c 'git lfs pull'
Error updating the git index: (10/10), 135 MB | 8.8 MB/s
error: UI/JsAnimation/entry/src/main/js/MainAbility/common/animator/show.mp4: cannot add to the index - missing --add option?
fatal: Unable to process path UI/JsAnimation/entry/src/main/js/MainAbility/common/animator/show.mp4
Errors logged to /home/vm/oh/applications/standard/app_samples/.git/lfs/logs/20230416T074901.707130201.log
Use `git lfs logs last` to view the log.
Downloading LFS objects: 100% (26/26), 43 MB | 9.1 MB/s
vm@vm:~/oh$ 
vm@vm:~/oh$ ls
applications  build.py       device      interface       qemu-run     vendor
arkcompiler   build.sh       docs        kernel          test
base          commonlibrary  drivers     napi_generator  third_party
build         developtools   foundation  productdefine   tools
vm@vm:~/oh$

2. 编译

2.1 安装编译工具

vm@vm:~/oh$ sudo apt-get install build-essential gcc g++ make zlib* libffi-dev e2fsprogs pkg-config flex bison perl bc openssl libssl-dev libelf-dev libc6-dev binutils binutils-dev libdwarf-dev u-boot-tools mtd-utils gcc-arm-linux-gnueabi cpio device-tree-compiler git git-lfs ruby ccachevm@vm:~/oh$ python3 -m pip install --user ohos-build

2.2 将hb添加到环境变量

vim ~/.bashrc               # 编辑环境变量
export PATH=~/.local/bin:$PATH     # 在环境变量的最后添加一行repo路径信息
source ~/.bashrc            # 应用环境变量
vm@vm:~/oh$ hb
usage: hb [-h] [-v] {build,set,env,clean,tool} ...OHOS Build System version 0.4.6positional arguments:{build,set,env,clean,tool}build               Build source codeset                 OHOS build settingsenv                 Show OHOS build envclean               Clean outputtool                Call the gn command through the hb tooloptions:-h, --help            show this help message and exit-v, --version         show program's version number and exitvm@vm:~/oh$ hb -v
[OHOS INFO] hb version 0.4.6

2.3 通过hb 选取板卡配置

vm@vm:~/oh$ hb set
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/hb/__main__.py", line 84, in main
[OHOS ERROR]     status = args.command(args)
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/set/set.py", line 45, in exec_command
[OHOS ERROR]     return set_product() == 0
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/set/set.py", line 62, in set_product
[OHOS ERROR]     product_info = Product.product_menuconfig()
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/common/product.py", line 260, in product_menuconfig
[OHOS ERROR]     product = menu.list_promt('product', 'Which product do you need?',
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/cts/menuconfig.py", line 34, in list_promt
[OHOS ERROR]     return self._promt(questions, **kwargs)
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/cts/menuconfig.py", line 25, in _promt
[OHOS ERROR]     prompt = importlib.import_module('hb_internal.cts.prompt')
[OHOS ERROR]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
[OHOS ERROR]     return _bootstrap._gcd_import(name[level:], package, level)
[OHOS ERROR]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[OHOS ERROR]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[OHOS ERROR]   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
[OHOS ERROR]   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
[OHOS ERROR]   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
[OHOS ERROR]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/cts/prompt.py", line 21, in <module>
[OHOS ERROR]     from prompt_toolkit.shortcuts import run_application
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
[OHOS ERROR]     from .interface import CommandLineInterface
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/interface.py", line 19, in <module>
[OHOS ERROR]     from .application import Application, AbortAction
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/application.py", line 8, in <module>
[OHOS ERROR]     from .key_binding.bindings.basic import load_basic_bindings
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in <module>
[OHOS ERROR]     from prompt_toolkit.renderer import HeightIsUnknownError
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/renderer.py", line 11, in <module>
[OHOS ERROR]     from prompt_toolkit.styles import Style
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/styles/__init__.py", line 8, in <module>
[OHOS ERROR]     from .from_dict import *
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in <module>
[OHOS ERROR]     from collections import Mapping
[OHOS ERROR] ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
[OHOS ERROR] Unhandled error: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

解决方法:

//因为Python3.10版本以后对requests库进行调整,collections中不能直接调用方法Mapping,MutableMapping
//参考:https://blog.csdn.net/LSH1628340121/article/details/124140926
vm@vm:~/oh$ vim /usr/lib/python3.10/collections/__init__.py  from collections.abc import Mapping
from collections.abc import MutableMapping

2.4 编译

// 选择板卡
vm@vm:~/oh$ hb set
OHOS Which product do you need?  qemu-arm64-linux-min// 编译
vm@vm:~/oh$ hb build
[OHOS INFO] Set cache size limit to 100.0 GB
[OHOS INFO] ---------------------------------------------
[OHOS INFO] ccache summary:
[OHOS INFO] cache hit (direct)  : 0
[OHOS INFO] cache hit (preprocessed)  : 0
[OHOS INFO] cache miss  : 0
[OHOS INFO] hit rate:  0.00%
[OHOS INFO] mis rate: 0.00%
[OHOS INFO] ---------------------------------------------
[OHOS INFO] file: /home/vm/oh/out/qemu-arm-linux/.ninja_log not exists
[OHOS INFO] parse file fail
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR]   File "/home/vm/.local/lib/python3.10/site-packages/hb/__main__.py", line 84, in main
[OHOS ERROR]     status = args.command(args)
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/build/build.py", line 230, in exec_command
[OHOS ERROR]     return build.build(args.full,
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/build/build_process.py", line 153, in build
[OHOS ERROR]     exec_cmd(cmd_args)
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/build/build_process.py", line 253, in gn_build
[OHOS ERROR]     exec_command(gn_cmd, log_path=self.config.log_path, env=self.env())
[OHOS ERROR]   File "/home/vm/oh/build/lite/hb_internal/common/utils.py", line 92, in exec_command
[OHOS ERROR]     process = subprocess.Popen(cmd,
[OHOS ERROR]   File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
[OHOS ERROR]     self._execute_child(args, executable, preexec_fn, close_fds,
[OHOS ERROR]   File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
[OHOS ERROR]     raise child_exception_type(errno_num, err_msg, err_filename)
[OHOS ERROR] FileNotFoundError: [Errno 2] No such file or directory: 'gn'
[OHOS ERROR] Unhandled error: [Errno 2] No such file or directory: 'gn'

解决方法:
安装ninja 和 gn

sudo apt install ninja-build
sudo apt install generate-ninja
vm@vm:~/oh$ hb build
[OHOS INFO] Set cache size limit to 100.0 GB
[OHOS INFO] ERROR at //build/config/BUILDCONFIG.gn:544:1: Unknown function.
[OHOS INFO] set_sources_assignment_filter(sources_assignment_filter)
[OHOS INFO] ^----------------------------
[OHOS INFO] root_out_dir=//out/qemu-arm-linux
[OHOS INFO] root_build_dir=//out/qemu-arm-linux
[OHOS INFO] root_gen_dir=//out/qemu-arm-linux/gen
[OHOS INFO] current_toolchain=//build/toolchain/ohos:ohos_clang_arm64
[OHOS INFO] host_toolchain=//build/toolchain/linux:clang_x64
[OHOS INFO]
[OHOS INFO] args: Namespace(platforms_config_file='/home/vm/oh/out/preloader/qemu-arm64-linux-min/platforms.build', subsystem_config_file='/home/vm/oh/out/preloader/qemu-arm64-linux-min/subsystem_config.json', example_subsystem_file=None, exclusion_modules_config_file='/home/vm/oh/out/preloader/qemu-arm64-linux-min/exclusion_modules.json', source_root_dir='/home/vm/oh/', gn_root_out_dir='/home/vm/oh/out/qemu-arm-linux', build_platform_name='phone', build_xts=False, load_test_config=True, target_os='ohos', target_cpu='arm64', os_level='standard', ignore_api_check=['xts', 'common', 'developertest'], scalable_build=False)[OHOS INFO] [70/80] ACTION //build/ohos/images:phone_vendor_image(//build/toolchain/ohos:ohos_clang_arm64)
[OHOS INFO] [71/80] STAMP obj/build/ohos/images/phone_userdata_image.stamp
[OHOS INFO] [72/80] STAMP obj/build/ohos/images/phone_vendor_image.stamp
[OHOS INFO] [73/80] ACTION //build/ohos/images:phone_system_image(//build/toolchain/ohos:ohos_clang_arm64)
[OHOS INFO] [74/80] STAMP obj/build/ohos/images/phone_system_image.stamp
[OHOS INFO] [75/80] ACTION //build/ohos/images:phone_ramdisk_image(//build/toolchain/ohos:ohos_clang_arm64)
[OHOS INFO] [76/79] ACTION //build/ohos/images:phone_updater_ramdisk_image(//build/toolchain/ohos:ohos_clang_arm64)
[OHOS INFO] [77/79] STAMP obj/build/ohos/images/phone_updater_ramdisk_image.stamp
[OHOS INFO] [78/79] STAMP obj/build/ohos/images/make_images.stamp
[OHOS INFO] [79/79] STAMP obj/build/core/gn/images.stamp
[OHOS INFO] tar: Removing leading `/' from member names
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/updater.img
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/vendor.img
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/Image
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/system.img
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/userdata.img
[OHOS INFO] /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/out/qemu-arm-linux/packages/phone/images/ramdisk.img
[OHOS INFO] part_name: access_token                                actual_size: 1084.47KB   standard_size: 2048KB     'rom' conform to the rules
[OHOS INFO] part_name: bytrace                                     actual_size: 0.0KB       standard_size: 114KB      'rom' conform to the rules
[OHOS INFO] part_name: c_utils                                     actual_size: 393.28KB                             This part does not set standard 'rom' size
[OHOS INFO] part_name: device_auth                                 actual_size: 252.37KB    standard_size: 500KB      'rom' conform to the rules
[OHOS INFO] part_name: device_manager                              actual_size: 377.67KB    standard_size: 2M         'rom' out of standard
[OHOS INFO] part_name: dsoftbus                                    actual_size: 3079.16KB   standard_size: 967KB      'rom' out of standard
[OHOS INFO] part_name: eventhandler                                actual_size: 122.97KB    standard_size: 500KB      'rom' conform to the rules
[OHOS INFO] part_name: faultloggerd                                actual_size: 790.47KB    standard_size: 1024KB     'rom' conform to the rules
[OHOS INFO] part_name: hdc                                         actual_size: 0.0KB       standard_size: 1725KB     'rom' conform to the rules
[OHOS INFO] part_name: hichecker_native                            actual_size: 14.7KB                               This part does not set standard 'rom' size
[OHOS INFO] part_name: hilog_native                                actual_size: 370.95KB    standard_size: 188KB      'rom' out of standard
[OHOS INFO] part_name: hilog_service                               actual_size: 0.0KB       standard_size: 460KB      'rom' conform to the rules
[OHOS INFO] part_name: hisysevent_native                           actual_size: 255.72KB                             This part does not set standard 'rom' size
[OHOS INFO] part_name: hitrace_native                              actual_size: 45.66KB                              This part does not set standard 'rom' size
[OHOS INFO] part_name: hiviewdfx_hilog_native                      actual_size: 0.0KB       standard_size: 188KB      'rom' conform to the rules
[OHOS INFO] part_name: huks                                        actual_size: 5646.47KB   standard_size: 5000KB     'rom' out of standard
[OHOS INFO] part_name: init                                        actual_size: 652.13KB                             This part does not set standard 'rom' size
[OHOS INFO] part_name: ipc                                         actual_size: 549.3KB     standard_size: 500KB      'rom' out of standard
[OHOS INFO] part_name: safwk                                       actual_size: 106.82KB    standard_size: 200KB      'rom' conform to the rules
[OHOS INFO] part_name: samgr                                       actual_size: 149.16KB    standard_size: 300KB      'rom' conform to the rules
[OHOS INFO] part_name: startup_l2                                  actual_size: 244.47KB                             This part does not set standard 'rom' size
[OHOS INFO] ---------------------------------------------
[OHOS INFO] ccache summary:
[OHOS INFO] cache hit (direct)  : 0
[OHOS INFO] cache hit (preprocessed)  : 0
[OHOS INFO] cache miss  : 21
[OHOS INFO] hit rate:  0.00%
[OHOS INFO] mis rate: 100.00%
[OHOS INFO] ---------------------------------------------
[OHOS INFO] c targets overlap rate statistics
[OHOS INFO] subsystem           files NO.       percentage      builds NO.      percentage      overlap rate
[OHOS INFO] third_party             1607        36.1%       1891        39.9%   1.18
[OHOS INFO] thirdparty              1607        36.1%       1891        39.9%   1.18
[OHOS INFO] commonlibrary             56        1.3%          56        1.2%    1.00
[OHOS INFO] communication            406        9.1%         406        8.6%    1.00
[OHOS INFO] customization              1        0.0%           1        0.0%    1.00
[OHOS INFO] developtools              55        1.2%          55        1.2%    1.00
[OHOS INFO] distributedhardware       21        0.5%          21        0.4%    1.00
[OHOS INFO] filemanagement             4        0.1%           4        0.1%    1.00
[OHOS INFO] hiviewdfx                187        4.2%         187        3.9%    1.00
[OHOS INFO] notification             139        3.1%         139        2.9%    1.00
[OHOS INFO] securec                   78        1.8%          78        1.6%    1.00
[OHOS INFO] security                 389        8.7%         389        8.2%    1.00
[OHOS INFO] startup                  178        4.0%         178        3.8%    1.00
[OHOS INFO] systemabilitymgr          37        0.8%          37        0.8%    1.00
[OHOS INFO] useriam                   23        0.5%          23        0.5%    1.00
[OHOS INFO]
[OHOS INFO] c overall build overlap rate: 1.06
[OHOS INFO]
[OHOS INFO]
[OHOS INFO] qemu-arm-linux build success
[OHOS INFO] cost time: 0:05:32
vm@vm:~/oh-3.2/OpenHarmony-v3.2-Release
vm@vm:~/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony$ hb env
[OHOS INFO] root path: /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony
[OHOS INFO] board: qemu-arm-linux
[OHOS INFO] kernel: None
[OHOS INFO] product: qemu-arm64-linux-min
[OHOS INFO] product path: /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/vendor/ohemu/qemu_arm64_linux_min
[OHOS INFO] device path: /home/vm/oh-3.2/OpenHarmony-v3.2-Release/OpenHarmony/device/board/qemu/qemu-arm-linux
[OHOS INFO] device company: qemu

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

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

相关文章

详解TCP/IP协议第二篇:OSI参考模型详解

文章目录 写给自己的话 一:协议分层与OSI参考模型 二:通过对话理解分层 三:OSI参考模型

飞腾 kylin-server v10 arm64 aarch64 anaconda3 conda 非法指令 Illegal instruction 笔记

原因&#xff1a; chenghlee commented on Jun 15, 2021 Its likely related to the compiler options used to build the linux-aarch64 packages on defaults; basically, Anaconda uses options that target the server-class Neoverse N1/N2 microarchitecture, rather th…

树的引进以及二叉树的基础讲解——【数据结构】

W...Y的主页 &#x1f60a; 代码仓库分享 &#x1f495; 当我们学习完前面的数据结构&#xff0c;难度也就会上升&#xff0c;但是这个也是非常重要的数据结构。今天我们来学习一种新的数据类型——树。 目录 树的概念以及结构 树的概念 树的相关概念 树的表示 树在实…

Java——》Synchronized和Lock区别

推荐链接&#xff1a; 总结——》【Java】 总结——》【Mysql】 总结——》【Redis】 总结——》【Kafka】 总结——》【Spring】 总结——》【SpringBoot】 总结——》【MyBatis、MyBatis-Plus】 总结——》【Linux】 总结——》【MongoD…

Socks5 与 HTTP 代理在网络安全中的应用

目录 Socks5和HTTP代理在网络安全中的应用。 Socks5代理和HTTP代理的优点和缺点。 选择合适的代理IP需要考虑的因素&#xff1a; 总结 在网络安全领域中&#xff0c;Socks5和HTTP代理都扮演着重要的角色。作为两种不同的代理技术&#xff0c;它们在网络安全中的应用各有特点…

02 CSS技巧

02 CSS技巧 clip-path 自定义形状&#xff0c;或者使用自带的属性画圆等circle HTML结构 <body><div class"container"></div> </body>CSS结构 使用*polygon*自定义形状 .container {width: 300px;height: 300px;background-color: re…

建站系列(三)--- 网络协议

目录 相关系列文章前言一、定义二、术语简介三、协议的组成要素四、网络层次划分五、常见网络协议划分六、常用协议介绍&#xff08;一&#xff09;TCP/IP&#xff08;二&#xff09;HTTP协议&#xff08;超文本传输协议&#xff09;&#xff08;三&#xff09;SSH协议 相关系列…

Python小知识 - 如何使用Python进行机器学习

如何使用Python进行机器学习 Python是一种解释型、面向对象、动态数据类型的高级程序设计语言。 机器学习是人工智能的一个分支&#xff0c;是让计算机自动“学习”。学习的过程是从经验E中获得知识K。经验E可以是一个数据集&#xff0c;比如一个图像数据集。知识K可以是计算机…

【系统设计系列】 负载均衡和反向代理

系统设计系列初衷 System Design Primer&#xff1a; 英文文档 GitHub - donnemartin/system-design-primer: Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards. 中文版&#xff1a; https://github.com/donnemart…

如何获取springboot中所有的bean

代码 Component public class TestS {Autowiredprivate Map<String, Object> allBean Maps.newConcurrentMap();public void testA(){System.out.println("测试下");}}这段代码是一个使用 Spring Framework 的依赖注入&#xff08;DI&#xff09;功能的示例。…

运算符重载(个人学习笔记黑马学习)

1、加号运算符重载 #include <iostream> using namespace std; #include <string>//加号运算符重载 class Person { public://1、成员函数重载号//Person operator(Person& p) {// Person temp;// temp.m_A this->m_A p.m_A;// temp.m_B this->m_B p…

【算法】快速排序 详解

快速排序 详解 快速排序1. 挖坑法2. 左右指针法 &#xff08;Hoare 法&#xff09;3. 前后指针法4. 快排非递归 代码优化 排序&#xff1a; 排序&#xff0c;就是使一串记录&#xff0c;按照其中的某个或某些关键字的大小&#xff0c;递增或递减的排列起来的操作。 稳定性&…

docker介绍和安装

docker安装 下载Docker依赖组件 yum -y install yum-utils device-mapper-persistent-data lvm2 设置下载Docker的镜像源为阿里云 yum-config-manager --add-repo http://mirrors.aliyun.com/dockerce/linux/centos/docker-ce.repo 安装Docker服务 yum -y install docker-ce 安…

OpenCV项目实战(1)— 如何去截取视频中的帧

前言&#xff1a;Hello大家好&#xff0c;我是小哥谈。针对一段视频&#xff0c;如何去截取视频中的帧呢&#xff1f;本节课就给大家介绍两种方式&#xff0c;一种方式是按一定间隔来截取视频帧&#xff0c;另一种方式是截取视频的所有帧。希望大家学习之后能够有所收获&#x…

Web学习笔记-React(路由)

笔记内容转载自 AcWing 的 Web 应用课讲义&#xff0c;课程链接&#xff1a;AcWing Web 应用课。 CONTENTS 1. Web分类2. Route组件3. URL中传递参数4. Search Params传递参数5. 重定向6. 嵌套路由 本节内容是如何将页面和 URL 一一对应起来。 1. Web分类 Web 页面可以分为两…

微信小程序 wx:if使用

在微信小程序中&#xff0c;可以使用wx:if指令来控制某个元素是否需要被渲染到页面上。根据条件表达式的结果&#xff0c;wx:if指令决定元素是否显示。 下面是使用wx:if的基本示例&#xff1a; <view><view wx:if"{{condition}}"><!-- 条件为真时显…

计算机网络概述

目录 一、计算机网络的作用及互联网概述 1.1计算机网络在信息时代中的作用 1.2基本概念 1.3互联网基础架构发展三个阶段 1.4互联网的标准化工作 二、互联网的组成 2.1互联网组成 2.2互联网的边缘部分 2.3互联网的核心部分 三、计算机网络的类别 3.1计算机网络的定义:…

yapi以及gitlab的容器化部署

yapi部署&#xff1a; https://blog.csdn.net/Chimengmeng/article/details/132074922 gitlab部署 使用docker-compose.yml version: 3 services: web: image: twang2218/gitlab-ce-zh:10.5 restart: always hostname: 192.168.xx.xx environm…

企业架构LNMP学习笔记19

Nginx 第三方模块的使用&#xff1a; Nginx官方没有的功能&#xff0c;开源开发人员定制开发了一些功能&#xff0c;把代码公布出来&#xff0c;可以通过编译加载第三方模块的方式&#xff0c;使用新功能。 NGINX 3rd Party Modules | NGINX shell > tar xvf ngx-fancyinde…

IDEA中的MySQL数据库所需驱动包的下载和导入方法

文章目录 下载驱动导入方法 下载驱动 MySQL数据库驱动文件下载方法&#xff1a; 最新版的MySQL版本的驱动获取方法&#xff0c;这个超链接是下载介绍的博客 除最新版以外的MySQL版本的驱动获取方法&#xff0c;选择Platform Independent&#xff0c;选择第二个zip压缩包虾藻…