OH編譯構建分析 - 依賴關系檢查
背景
OHOS的編譯構建系統是由sh腳本(或bat腳本),python腳本,Gn和Ninja工具組成的編譯構建框架。總體編譯構建流程是根據產品配置,生成具體依賴關系,然后使用Gn配置構建目標,通過Gn生成ninja文件,然后執行ninja生成二進制,最后打包生成鏡像的過程。本篇主要涉及配置文件規則和編譯初期的規則檢查。
編譯初期(prebuild)
[OHOS INFO] Start building...
[OHOS INFO] Set cache size limit to 100.0 GB
[OHOS INFO] generated build prop info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/build.prop
[OHOS INFO] generated build config info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/build_config.json
[OHOS INFO] generated product parts info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/parts.json
[OHOS INFO] generated parts config info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/parts_config.json
[OHOS INFO] generated build gnargs prop info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/build_gnargs.prop
[OHOS INFO] generated features info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/features.json
[OHOS INFO] generated syscap info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/syscap.json
[OHOS INFO] generated exclusion modules info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/exclusion_modules.json
[OHOS INFO] generated platforms build info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/platforms.build
[OHOS INFO] generated subsystem config info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/subsystem_config.json
[OHOS INFO] generated system capability info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/systemcapability.json
[OHOS INFO] generated compile_standard_whitelist info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/compile_standard_whitelist.json
[OHOS INFO] generated compile_env_allowlist info to /home/anybody/ohos/master/newsrc/out/preloader/rk3568/compile_env_allowlist.json
[OHOS INFO] Checking all build args...
[OHOS INFO] subsytem config scan completed
warning: subsystem name config incorrect in '/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568/ohos.build', build file subsystem name is product_hihope,configured subsystem name is product_rk3568.
warning: subsystem name config incorrect in '/home/anybody/ohos/master/newsrc/device/board/hihope/rk3568/ohos.build', build file subsystem name is rockchip_products,configured subsystem name is device_rk3568.
[OHOS INFO] all parts scan completed
[OHOS INFO] Loading configuration file...
[OHOS INFO] loader args:['platforms_config_file="/home/anybody/ohos/master/newsrc/out/preloader/rk3568/platforms.build"', 'subsystem_config_file="/home/anybody/ohos/master/newsrc/out/preloader/rk3568/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/anybody/ohos/master/newsrc/out/preloader/rk3568/exclusion_modules.json"', 'source_root_dir="/home/anybody/ohos/master/newsrc/"', 'gn_root_out_dir="out/rk3568"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm', 'os_level=standard', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False']
[OHOS INFO] Checking parts config...
[OHOS INFO] generated subsystem build config to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/subsystem_build_config.json'
[OHOS INFO] generated src subsystem info to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/src_subsystem_info.json'
[OHOS INFO] generated no src subsystem info to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/no_src_subsystem_info.json'
[OHOS INFO] generate target platform parts to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/target_platforms_parts.json'
[OHOS INFO] generated system capabilities to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/phone_system_capabilities.json'
[OHOS INFO] generated platforms parts by src to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/platforms_parts_by_src.json'
[OHOS INFO] generate required parts targets to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/required_parts_targets.json'
[OHOS INFO] generate build targets list file to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/required_parts_targets_list.json'
[OHOS INFO] generated parts src flag to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/subsystem_info/parts_src_flag.json'
[OHOS INFO] generate auto install part to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/auto_install_parts.json'
[OHOS INFO] generate platforms list to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/platforms_list.gni'
[OHOS INFO] generate part different info to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/parts_different_info.json'
[OHOS INFO] generate infos for testfwk to '/home/anybody/ohos/master/newsrc/out/rk3568/build_configs/infos_for_testfwk.json'
[OHOS INFO] Checking all product features...
[OHOS INFO] generate syscap info file to '/home/anybody/ohos/master/newsrc/out/preloader/rk3568/system/etc/SystemCapability.json'
[OHOS INFO] generate syscap info with part name list to '/home/anybody/ohos/master/newsrc/out/preloader/rk3568/system/etc/syscap.json'
[OHOS INFO] generate target syscap for init list to '/home/anybody/ohos/master/newsrc/out/preloader/rk3568/system/etc/param/syscap.para'
[OHOS INFO] Excuting gn command: /home/anybody/ohos/master/newsrc/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"rk3568\" product_path=\"/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568\" product_config_path=\"/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568\" device_name=\"rk3568\" device_path=\"/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568\" device_company=\"rockchip\" device_config_path=\"/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568\" target_cpu=\"arm\" is_standard_system=true ohos_build_compiler_specified=\"\" ohos_build_time=1704150237815 ohos_build_datetime=\"2024-01-02 15:03:57\" ace_engine_feature_enable_accessibility=true ace_engine_feature_enable_web=true datamgr_service_udmf=true code_signature_support_oh_code_sign=false enable_ohos_startup_init_feature_ab_partition=true enable_ohos_startup_init_feature_loader=true dsoftbus_feature_conn_p2p=true dsoftbus_feature_disc_ble=true dsoftbus_feature_conn_br=true dsoftbus_feature_conn_ble=true dsoftbus_feature_trans_udp_stream=true wifi_feature_non_seperate_p2p=true wifi_feature_non_hdf_driver=true graphic_2d_feature_rs_enable_eglimage=true graphic_2d_feature_use_texgine=true audio_framework_feature_dtmf_tone=true audio_framework_feature_opensl_es=true input_feature_combination_key=true input_feature_pointer_drawing=true input_feature_interceptor=true input_feature_monitor=true input_feature_keyboard=true input_feature_mouse=true input_feature_touchscreen=true input_feature_input_device=true memmgr_purgeable_memory=true fusion_interaction_coordination=false wpa_supplicant_driver_nl80211=true hdf_core_platform_test_support=true drivers_peripheral_input_feature_model=true drivers_peripheral_display_community=true drivers_peripheral_display_vdi_default=true drivers_peripheral_wlan_feature_enable_HDF_NL80211=true drivers_peripheral_wlan_feature_enable_HDF_UT=false drivers_peripheral_sensor_feature_model=true drivers_peripheral_audio_feature_full_test_suite=true drivers_peripheral_audio_feature_alsa_lib=false drivers_peripheral_audio_feature_effect=true drivers_peripheral_light_feature_model=true drivers_peripheral_vibrator_feature_model=true drivers_peripheral_codec_feature_support_omx_extend_test=true drivers_peripheral_codec_feature_support_hdi_v1=true use_ffrt=true ohos_build_enable_ccache=true ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" root_perf_main=\"main\" runtime_mode=\"release\"" --args=product_name="rk3568" product_path="/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568" product_config_path="/home/anybody/ohos/master/newsrc/vendor/hihope/rk3568" device_name="rk3568" device_path="/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568" device_company="rockchip" device_config_path="/home/anybody/ohos/master/newsrc/device/board/rockchip/rk3568" target_cpu="arm" is_standard_system=true ohos_build_compiler_specified="" ohos_build_time=1704150237815 ohos_build_datetime="2024-01-02 15:03:57" ace_engine_feature_enable_accessibility=true ace_engine_feature_enable_web=true datamgr_service_udmf=true code_signature_support_oh_code_sign=false enable_ohos_startup_init_feature_ab_partition=true enable_ohos_startup_init_feature_loader=true dsoftbus_feature_conn_p2p=true dsoftbus_feature_disc_ble=true dsoftbus_feature_conn_br=true dsoftbus_feature_conn_ble=true dsoftbus_feature_trans_udp_stream=true wifi_feature_non_seperate_p2p=true wifi_feature_non_hdf_driver=true graphic_2d_feature_rs_enable_eglimage=true graphic_2d_feature_use_texgine=true audio_framework_feature_dtmf_tone=true audio_framework_feature_opensl_es=true input_feature_combination_key=true input_feature_pointer_drawing=true input_feature_interceptor=true input_feature_monitor=true input_feature_keyboard=true input_feature_mouse=true input_feature_touchscreen=true input_feature_input_device=true memmgr_purgeable_memory=true fusion_interaction_coordination=false wpa_supplicant_driver_nl80211=true hdf_core_platform_test_support=true drivers_peripheral_input_feature_model=true drivers_peripheral_display_community=true drivers_peripheral_display_vdi_default=true drivers_peripheral_wlan_feature_enable_HDF_NL80211=true drivers_peripheral_wlan_feature_enable_HDF_UT=false drivers_peripheral_sensor_feature_model=true drivers_peripheral_audio_feature_full_test_suite=true drivers_peripheral_audio_feature_alsa_lib=false drivers_peripheral_audio_feature_effect=true drivers_peripheral_light_feature_model=true drivers_peripheral_vibrator_feature_model=true drivers_peripheral_codec_feature_support_omx_extend_test=true drivers_peripheral_codec_feature_support_hdi_v1=true use_ffrt=true ohos_build_enable_ccache=true ohos_build_type="debug" device_type="default" build_variant="root" root_perf_main="main" runtime_mode="release" /home/anybody/ohos/master/newsrc/out/rk3568
簡單解讀(基本規則)
- 編譯構建的重要組成部分:
OHOS的編譯構建以下三個倉是編譯構建重要的三個倉:
- productdefine:產品配置倉,包含了基礎部件的組成形態,主要看/produdctdefine/common/base目錄下的文件。
- vendor:各廠家的產品倉,如大家最熟悉的/vendor/hihope/rk3568,編譯命令指定–product-name來尋找對應的產品。
- build:編譯構建倉,包括規范,檢查工具,編譯構建腳本等等,OHOS編譯構建的核心倉
- 關注重點
- BUILD.gn:每個模塊都對應一個BUILD.gn文件。可以使用提供的模板,也可以使用gn語法規則自定義編寫。
例子:
ohos_shared_library示例:
```
import("http://build/ohos.gni")
ohos_shared_library("helloworld") {
sources = []
include_dirs = []
cflags = []
cflags_c = []
cflags_cc = []
ldflags = []
configs = []
deps =[] # 部件內模塊依賴
# 跨部件模塊依賴定義,
# 定義格式為 "部件名:模塊名稱"
# 這里依賴的模塊必須是依賴的部件聲明在inner_kits中的模塊
external_deps = [
"part_name:module_name",
]
output_name = "" # 可選,模塊輸出名
output_extension = "" # 可選,模塊名后綴
module_install_dir = "" # 可選,缺省在/system/lib64或/system/lib下, 模塊安裝路徑,模塊安裝路徑,從system/,vendor/后開始指定
relative_install_dir = "" # 可選,模塊安裝相對路徑,相對于/system/lib64或/system/lib;如果有module_install_dir配置時,該配置不生效
install_images = [] # 可選,缺省值system,指定模塊安裝到那個分區鏡像中,可以指定多個
part_name = "" # 必選,所屬部件名稱
}
```
ohos_executable示例:
ohos_executable模板屬性和ohos_shared_library基本一致。
注意:可執行模塊(即ohos_executable模板定義的)默認是不安裝的,如果要安裝,需要指定install_enable = true。
ohos_prebuilt_etc示例:
```
import("http://build/ohos.gni")
ohos_prebuilt_etc("etc_file") {
source = "file"
deps = [] # 部件內模塊依賴
module_install_dir = "" #可選,模塊安裝路徑,從system/,vendor/后開始指定
relative_install_dir = "" #可選,模塊安裝相對路徑,相對于system/etc;如果有module_install_dir配置時,該配置不生效
install_images = [] # 可選,缺省值system,指定模塊安裝到那個分區鏡像中,可以指定多個
part_name = "" # 必選,所屬部件名稱
}
```
更多詳細的模板信息請參照模塊配置規則。
- bundle.json:定義了子系統包含的部件。每個部件定義它所包含的模塊目標component.build.sub_component,以及部件間交互的接口component.build.inner_kits,測試用例component.build.test_list。部件包含的模塊目標component.build.sub_component是必須要說明的。原來老版本有ohos.build,后面全部整改為bundle.json。
{
"name": "@ohos/<component_name>", # HPM部件英文名稱,格式"@組織/部件名稱"
"description": "xxxxxxxxxxxxxxxxxxx", # 部件功能一句話描述
"version": "3.1", # 版本號,版本號與OpenHarmony版本號一致
"license": "MIT", # 部件License
"publishAs": "code-segment", # HPM包的發布方式,當前默認都為code_segment
"segment": {
"destPath": ""
}, # 發布類型為code_segment時為必填項,定義發布類型code_segment的代碼還原路徑(源碼路徑)
"dirs": {}, # HPM包的目錄結構,字段必填內容可以留空
"scripts": {}, # HPM包定義需要執行的腳本,字段必填,值非必填
"licensePath": "COPYING",
"readmePath": {
"en": "README.rst"
},
"component": { # 部件屬性
"name": "<component_name>", # 部件名稱
"subsystem": "", # 部件所屬子系統
"syscap": [], # 部件為應用提供的系統能力
"features": [], # 部件對外的可配置特性列表,一般與build中的sub_component對應,可供產品配置
"adapted_system_type": [], # 輕量(mini)小型(small)和標準(standard),可以是多個
"rom": "xxxKB" # ROM基線,沒有基線寫當前值
"ram": "xxxKB", # RAM基線,沒有基線寫當前值
"deps": {
"components": [], # 部件依賴的其他部件
"third_party": [] # 部件依賴的三方開源軟件
},
"build": { # 編譯相關配置
"sub_component": ["部件包含模塊的gn目標"], # 部件編譯入口,新增模塊在此處配置
"inner_kits": [], # 部件間接口
"test": [] # 部件測試用例編譯入口
}
}
}
新增部件的大致步驟就是在在部件目錄中新建一個bundle.json,然后再在//vendor/{product_company}/{product-name}/config.json中添加對應的部件,直接添加到原有部件后即可。具體流程請參照編譯構建指導的配置規則與新增并編譯不同配置,其中詳細的介紹了如何添加一個模塊、部件或者子系統。
- vendor里的config.json:指明了產品名,產品廠商,產品設備,版本,要編譯的系統類型,以及產品包含的子系統。
{
"product_name": "MyProduct",
"version": "3.0",
"type": "standard",
"target_cpu": "arm",
"ohos_version": "OpenHarmony 1.0",
"device_company": "MyProductVendor",
"board": "MySOC",
"enable_ramdisk": true,
"subsystems": [
{
"subsystem": "ace",
"components": [
{ "component": "ace_engine_lite", "features":[""] }
]
},
...
]
}
其他更詳細內容請查看:build: Compilation and building framework and scripts | 編譯構建框架和腳本 (gitee.com)
常見Q&A解讀(錯誤處理)
常見七類問題:
- subsystem_components
錯誤原因:
子系統配置清單中的子系統名和部件配置清單中的子系統名不一致;或bundle.json中的部件名和部件配置清單中的部件名不一致
Warning: find subsystem startup_ext failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
或
Exception: find subsystem startup_ext failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
Warning: find component hiview_plugins_xxx failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
或
Exception: find component hiview_plugins failed, please check it in /home/XXX/workspace/system_single_frame/system_component/out/products_ext/vendor/xxx/XXX/config.json.
解讀:
“subsystem” 代表產品部件列表(config.json)配置的子系統名錯誤。
“component”代表產品部件列表(config.json)配置的部件名錯誤。
此類問題代表vendor\xxx\build\component_config\system\XXX\part_config.json 文件中配置的子系統名或者部件名錯誤,component 代表部件名配置錯誤, subsystem 代表子系統名配置錯誤。
整改方法:
如果是子系統名配置錯誤,請排查 part_config.json中配置的子系統名是否在subsystem_config.json中有配置
OHOS的subsystem_config.json路徑:build/subsystem_config.json。
如果是部件名配置錯誤,請排查part_config.json文件中的部件名是否和該部件的bundle.json中的部件名配置一致。
- bundle_subsystem_error
錯誤原因:
bundle.json中定義的子系統名和子系統配置清單中的不一致
具體日志
warning: subsystem name config incorrect in '/home/XXX/workspace/system_single_frame/system_component/foundation/ability/ability_base/bundle.json', build file subsystem name is ability, configured subsystem name is aafwk.
或
Exception: subsystem name config incorrect in '/home/XXX/workspace/system_single_frame/system_component/foundation/ability/ability_base/bundle.json', build file subsystem name is ability, configured subsystem name is aafwk.
解讀:
該問題代表bundle.json里的子系統名稱配置和subsystem_config.json配置不一致,需要整改bundle.json的子系統名稱。
bundle.json路徑:foundation/ability/ability_base/bundle.json。
整改方法:
請檢查本部件bundle.json中是否有配置子系統并且配置的子系統名與subsystem_config.json中一致,若不一致,請將bundle.json中的子系統名改為subsystem_config.json中的子系統名。
- gn_part_or_subsystem_error。
錯誤原因:
BUILD.gn中定義的部件名或子系統名與bundle.json中定義的不一致。
具體日志:
[OHOS INFO] warning: subsystem name or part name is incorrect, target is //foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio/hdi_service/audio/v1_0:libaudio_manager_daudio_primary_service_1.0, subsystem name is hdf, part name is drivers_peripheral_distributed_audio
或
Exception: subsystem name or part name is incorrect, target is //foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio/hdi_service/audio/v1_0:libaudio_manager_daudio_primary_service_1.0, subsystem name is hdf, part name is drivers_peripheral_distributed_audio
解讀:
該問題代表模塊的BUILD.gn里面配置的子系統名或者部件名不準確,需要和部件bundle.json對齊
BUILD.gn路徑:foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio/hdi_service/audio/v1_0/BUILD.gn。
編譯目標:libaudio_manager_daudio_primary_service_1.0
整改方法:
將本部件下該模塊BUILD.gn中的部件名與子系統名改為本部件bundle.json中的子系統名和部件名
如果已確認BUILD.gn和bundle.json中的子系統名和部件名一致,請再確認part_config.json中是否正確配置了該子系統名和部件名
part_config.json路徑:(和編譯命令中abi-type、device-type參數一致)
系統組件:
vendor/xxx/build/component_config/system/XXX/part_config.json
vendor/xxx/build/component_config/system/XXX/part_config.json
芯片組件:
vendor/xxx/build/component_config/chipset/XXX/part_config.json
vendor/xxx/build/component_config/chipset/XXX/part_config.json
- deps_added_external_part_module
錯誤原因:
BUILD.gn中使用deps依賴了外部部件的模塊
具體日志:
[OHOS INFO] WARNING:deps validation part_name: 'distributed_camera', target: '//foundation/distributedhardware/distributed_camera/services/channel:distributed_camera_channel', dep: '//foundation/distributedhardware/distributed_hardware_fwk/interfaces/inner_kits:libdhfwk_sdk' failed!!
解讀:
該問題代表該模塊通過deps依賴了部件外的模塊,應該用external_deps依賴。
BUILD.gn路徑:foundation/distributedhardware/distributed_camera/services/channel/BUILD.gn。
編譯目標:distributed_camera_channel。
deps中依賴的外部模塊:foundation/distributedhardware/distributed_hardware_fwk/interfaces/inner_kits:libdhfwk_sdk。
整改方法:
將該模塊從deps轉移到external_deps中。
注:deps中使用的是"路徑:模塊名",而改到external_deps中是使用 “部件名:模塊名” 的方式。
- external_deps_added_self_part_module
錯誤原因:
使用external_deps依賴了本部件的模塊。
具體日志:
[OHOS INFO] WARNING: preferences in target //foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences:preferences is dependency within part preferences, Need to used deps
或
Exception: preferences in target //foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences:preferences is dependency within part preferences, Need to used deps
解讀:
該日志代表該模塊通過external_deps依賴了本部件模塊,需要改成deps依賴
BUILD.gn路徑:foundation/distributeddatamgr/preferences/frameworks/js/napi/preferences
external_deps中依賴的本部件:preferences
整改方法:
將該依賴從external_deps轉移到deps中
- external_deps_bundle_not_add
**錯誤原因:**BUILD.gn中外部依賴了其他部件的模塊,但是bundle.json中沒有添加這個部件
注:對于三方部件,如果BUILD.gn里面用的是deps依賴,那在bundle.json中需要加到third_party中,如果使用的是external_deps依賴的三方部件,那在bundle.json中需要加到components中
具體日志:
[OHOS INFO] WARNING: //base/theme/wallpaper_mgr/frameworks/kits/extension:wallpaperextension depend part window_manager, need set part deps info to /home/XXX/workspace/system_single_frame/system_component/base/theme/wallpaper_mgr/bundle.json.
或
Exception: //base/theme/wallpaper_mgr/frameworks/kits/extension:wallpaperextension depend part window_manager, need set part deps info to /home/XXX/workspace/system_single_frame/system_component/base/theme/wallpaper_mgr/bundle.json.
解讀:
該日志代表該模塊(BUILD.gn)里面依賴的外部部件,但沒有在部件bundle.json聲明,需要在bundle.json聲明。
- BUILD.gn路徑:base/theme/wallpaper_mgr/frameworks/kits/extension/BUILD.gn
- 編譯目標:wallpaperextension
- 依賴的部件:window_manager
- bundle.json路徑:base/theme/wallpaper_mgr/bundle.json.
整改方法:
將被依賴的外部部件添加到bundle.json中的deps:components字段中,如上述例子中,需要將”input”和”window_manager”添加到bundle.json中
- third_deps_bundle_not_add
錯誤原因:
BUILD.gn中依賴了三方部件,但是部件bundle.json中沒有添加該三方部件
具體日志:
[OHOS INFO] WARNING: //base/security/device_auth/services:deviceauth_service depend part //third_party/cJSON:cjson, need set part deps cjson info to /home/XXX/workspace/chipset_single_frame/vendor_baltimore_musl/base/security/device_auth/bundle.json.
或
Exception: //base/security/device_auth/services:deviceauth_service depend part //third_party/cJSON:cjson, need set part deps cjson info to /home/XXX/workspace/chipset_single_frame/vendor_baltimore_musl/base/security/device_auth/bundle.json.
解讀:
該日志代表該模塊(BUILD.gn)里面依賴的三方部件,沒有在部件bundle.json中的third_party中聲明,需要在bundle.json聲明。
- BUILD.gn路徑:base/security/device_auth/services
- 編譯目標:deviceauth_service
- 依賴的三方部件:cjson
- bundle.json路徑:vendor_baltimore_musl/base/security/device_auth/bundle.json
整改方法:
將被依賴的三方部件添加到bundle.json中的deps:third_party字段中,如上述例子中,需要將 “cjson” 添加到bundle.json中。