OpenHarmony开发者论坛

标题: 4.1标准版编译yangfan时报错 [打印本页]

作者: ohbrn    时间: 2024-10-31 19:55
标题: 4.1标准版编译yangfan时报错
[md]### 【问题描述】

1. 介绍问题现象和发生的背景
2. 相关的代码(请勿使用截图)

   1. 执行 hb build -f
   2.

   def throw_exception(func):
   """Description: Function decorator that catch all exception raised by target function,
   please DO NOT use this function directly
   @parameter: "func": The function to be decorated
   @return:None
   @OHOSException: The first digit of the code represents the compilation stage,
   '1', '2', '3', '4' corresponds to preloader, loader, gn, ninja stages respectively

   ```
   Usage:

   @throw_exception
   def foo():
       ...
       raise OHOSException('SOME ERROR HAPPENDED', '0000')
       ...

   """
   def wrapper(*args, **kwargs):
       try:
           return func(*args, **kwargs)
       except OHOSException and Exception as exception:
           _code = ''
           _type = ''
           _desc = ''
           _solution = ''

           if isinstance(exception, OHOSException):
               _code = exception._code
               _type = exception.get_type()
               _desc = exception.get_desc()
               _solution = exception.get_solution()
           else:
               _code = '0000'
               _type = 'UNKNOWN ERROR TYPE'
               _desc = 'NO DESCRIPTION'
               _solution = 'NO SOLUTION'

           _print_formatted_tracebak(_code, str(exception), _type, _desc, _solution)
           exit(-1)
   return wrapper
   ```
3. vendor中yangfan的ohos.build

   {
   "parts": {
   "product_yangfan": {
   "module_list": [
   "//vendor/isoftstone/yangfan/hdf_config/uhdf:hdf_config"
   ]
   }
   },
   "subsystem": "product_isoftstone"
   }

   1. config.json 如下{
      "product_name": "yangfan",
      "device_company": "rockchip",
      "device_build_path": "device/board/isoftstone/yangfan",
      "target_cpu": "arm",
      "type": "standard",
      "version": "3.0",
      "board": "yangfan",
      "enable_ramdisk": true,
      "build_selinux": true,
      "inherit": [ "productdefine/common/inherit/rich.json", "productdefine/common/inherit/chipset_common.json" ],
      "subsystems": [
      {
      "subsystem": "security",
      "components": [
      {
      "component": "selinux_adapter",
      "features": []
      }
      ]
      },
      {
      "subsystem": "communication",
      "components": [
      {
      "component": "netmanager_ext",
      "features": []
      }
      ]
      },
      {
      "subsystem": "graphic",
      "components": [
      {
      "component": "graphic_2d",
      "features": [
      "graphic_2d_feature_ace_enable_gpu = true"
      ]
      }
      ]
      },
      {
      "subsystem": "hdf",
      "components": [
      {
      "component": "drivers_peripheral_audio",
      "features": [
      "drivers_peripheral_audio_feature_policy_config = false"
      ]
      }
      ]
      },
      {
      "subsystem": "rockchip_products",
      "components": [
      {
      "component": "rockchip_products",
      "features": []
      }
      ]
      },
      {
      "subsystem": "arkui",
      "components": [
      {
      "component": "ace_engine",
      "features": [
      "ace_engine_feature_enable_accessibility = true",
      "ace_engine_feature_enable_web = true"
      ]
      }
      ]
      },
      {
      "subsystem": "thirdparty",
      "components": [
      {
      "component": "wpa_supplicant",
      "features": [
      "wpa_supplicant_driver_nl80211 = true"
      ]
      }
      ]
      }
      ]
      }
   2. product.gni 如下

      import("//device/board/isoftstone/${device_name}/device.gni")
   3. device/board/isoftstone/yangfan 下ohos.build代码如下

      {
      "subsystem": "rockchip_products",
      "parts": {
      "rockchip_products": {
      "module_list": [
      "//device/board/isoftstone/${product_name}:rk3399_group",
      "//vendor/isoftstone/${product_name}/bluetooth:libbt_vendor",
      "//vendor/isoftstone/${product_name}/bluetooth:BCM4343A1.hcd",
      "//device/board/isoftstone/${product_name}/kernel/drivers/wifi:ap6xxx",
      "//device/board/isoftstone/${product_name}/kernel/hdf/drivers/camera:chipset_build",
      "//device/board/isoftstone/${product_name}/kernel/hdf/drivers/camera:camera_host_vdi_impl_1.0"
      ],
      "test_list": [
      "//device/board/isoftstone/${product_name}/kernel/hdf/drivers/camera:camera_board_test"
      ]
      }
      }
      }
   4. device.gni代码如下

   soc_company = "rockchip"
   soc_name = "rk3399"

   import("//device/soc/${soc_company}/${soc_name}/soc.gni")

   import("//build/ohos.gni")
   if (!defined(defines)) {
   defines = []
   }

   product_config_path = "//vendor/${product_company}/${product_name}"
   board_camera_path =
   "//device/board/${product_company}/${device_name}/kernel/hdf/drivers/camera"
   chipset_camera_path =
   "//device/board/${product_company}/${device_name}/kernel/hdf/drivers/camera"
   is_support_v4l2 = true
   if (is_support_v4l2) {
   is_support_mpi = false
   defines += [ "SUPPORT_V4L2" ]
   }
4. BUILD.gn 代码如下

   import("//build/ohos.gni")

   print("rk3399_group in")
   group("rk3399_group") {
   deps = [
   "bootanimation:bootanimation",
   "cfg/rootfs:init_configs",
   "kernel:kernel",
   "//device/soc/rockchip/rk3399/hardware:hardware_group",
   ]
   }
5. 运行结果、错误截图

   [OHOS ERROR] Traceback (most recent call last):
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/containers/status.py", line 47, in wrapper
   [OHOS ERROR]     return func(*args, **kwargs)
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/modules/ohos_build_module.py", line 65, in run
   [OHOS ERROR]     super().run()
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/modules/interface/build_module_interface.py", line 65, in run
   [OHOS ERROR]     self._load()
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/modules/ohos_build_module.py", line 84, in _load
   [OHOS ERROR]     self.loader.run()
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/services/interface/load_interface.py", line 45, in run
   [OHOS ERROR]     self.__post_init__()
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/services/loader.py", line 117, in __post_init__
   [OHOS ERROR]     self.parts_config_info = load_ohos_build.get_parts_info(
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/util/loader/load_ohos_build.py", line 933, in get_parts_info
   [OHOS ERROR]     _output_parts_info(parts_config_dict,
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/util/loader/load_ohos_build.py", line 742, in _output_parts_info
   [OHOS ERROR]     check_subsystem_and_component(parts_info_output_path, skip_partlist_check)
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/util/loader/load_ohos_build.py", line 674, in check_subsystem_and_component
   [OHOS ERROR]     compare_subsystem_and_component(subsystem_name, components_name, subsystem_compoents_whitelist_info,
   [OHOS ERROR]   File "/home/lxx/ohos/openharmony4.1/build/hb/util/loader/load_ohos_build.py", line 641, in compare_subsystem_and_component
   [OHOS ERROR]     raise Exception(message)
   [OHOS ERROR] Exception: find component device_yangfan failed, please check it in /home/lxx/ohos/openharmony4.1/out/preloader/yangfan/parts.json.
   [OHOS ERROR]

   [OHOS ERROR] Code:        0000
   [OHOS ERROR]
   [OHOS ERROR] Reason:      find component device_yangfan failed, please check it in /home/lxx/ohos/openharmony4.1/out/preloader/yangfan/parts.json.
   [OHOS ERROR]
   [OHOS ERROR] Error Type:  UNKNOWN ERROR TYPE
   [OHOS ERROR]
   [OHOS ERROR] Description: NO DESCRIPTION
   [OHOS ERROR]
   [OHOS ERROR] Solution:    NO SOLUTION
6. 我尝试过的解决方法和结果

   编译rk3568正常

### 【运行环境】

硬件:ubuntu20.4  4核16G 500G
ROM版本:
DevEvoStudio版本:4.0
SDK版本:4.1
[/md]
作者: kuaile    时间: 2024-11-5 09:06
报错原因见附件截图,因为没有这个形态,所以初始阶段就挂掉了




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5