OpenHarmony开发者论坛

标题: OpenHarmony源码3.1.7里面不支持qemu-arm-linux去做编译仿真,报错缺失文件file '../../sdk/ohos-arm/native_appdatamgr/sdk_info.json' doesn't exist. [打印本页]

作者: liangzhijiang    时间: 2024-7-26 10:49
标题: OpenHarmony源码3.1.7里面不支持qemu-arm-linux去做编译仿真,报错缺失文件file '../../sdk/ohos-arm/native_appdatamgr/sdk_info.json' doesn't exist.
[md]### 【问题描述】

1. 【介绍问题现象和发生的背景】
   我按照官方文档介绍安装并通过gitee ssh下载好了OpenHarmony源码3.1.7版本,hb工具也已经正常安装,并且也有执行bash build/prebuilts_downloads.sh,然后hb set选择qemu-arm-linux,然后报错缺失文件:
   zj@lzj-vmware:~/workspace/OpenHarmony3_1_7$ ./build.sh --product-name qemu-arm-linux-min --ccache --jobs 4
   ++++++++++++++++++++++++++++++++++++++++
   2024-07-26 09:51:29
   --product-name qemu-arm-linux-min --ccache --jobs 4
   OS version 22.04.4 is not supported for ohos build.
   Avaliable OS version are 18.04, 20.04.
   [OHOS INFO] Set cache size limit to 50.0 GB
   [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_arm
   [OHOS INFO] host_toolchain=//build/toolchain/linux:clang_x64
   [OHOS INFO]
   [OHOS INFO] args: Namespace(platforms_config_file='/home/lzj/workspace/OpenHarmony3_1_7/out/preloader/qemu-arm-linux-min/platforms.build', subsystem_config_file='/home/lzj/workspace/OpenHarmony3_1_7/out/preloader/qemu-arm-linux-min/subsystem_config.json', example_subsystem_file=None, source_root_dir='/home/lzj/workspace/OpenHarmony3_1_7/', gn_root_out_dir='/home/lzj/workspace/OpenHarmony3_1_7/out/qemu-arm-linux', build_platform_name='phone', build_xts=False, target_os='ohos', target_cpu='arm', os_level='standard', ignore_api_check=['xts', 'common', 'developertest'], scalable_build=False)
   [OHOS INFO]
   [OHOS INFO] build configs generation is complete.
   [OHOS INFO] ERROR at //build/templates/cxx/cxx.gni:501:7: Script returned non-zero exit code.
   [OHOS INFO]       exec_script(external_deps_script, arguments, "string")
   [OHOS INFO]       ^----------
   [OHOS INFO] Current dir: /home/lzj/workspace/OpenHarmony3_1_7/out/qemu-arm-linux/
   [OHOS INFO] Command: /usr/bin/env /home/lzj/workspace/OpenHarmony3_1_7/build/templates/common/external_deps_handler.py --external-deps hilog_native:libhilog ipc:ipc_core native_appdatamgr:native_rdb --parts-src-flag-file build_configs/parts_src_flag.json --external-deps-temp-file gen/foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability/native_appdatamgr__native_dataability_external_deps_temp.json --sdk-base-dir ../../sdk/ohos-arm --sdk-dir-name sdk/ohos-arm --current-toolchain //build/toolchain/ohos:ohos_clang_arm
   [OHOS INFO] Returned 1 and printed out:
   [OHOS INFO]
   [OHOS INFO] file '../../sdk/ohos-arm/native_appdatamgr/sdk_info.json' doesn't exist.
   [OHOS INFO]
   [OHOS INFO] stderr:
   [OHOS INFO]
   [OHOS INFO] Traceback (most recent call last):
   [OHOS INFO]   File "/home/lzj/workspace/OpenHarmony3_1_7/build/templates/common/external_deps_handler.py", line 239, in <module>
   [OHOS INFO]     sys.exit(main())
   [OHOS INFO]   File "/home/lzj/workspace/OpenHarmony3_1_7/build/templates/common/external_deps_handler.py", line 205, in main
   [OHOS INFO]     sdk_module_info, adapted_ok = _get_external_module_from_sdk(
   [OHOS INFO]   File "/home/lzj/workspace/OpenHarmony3_1_7/build/templates/common/external_deps_handler.py", line 73, in _get_external_module_from_sdk
   [OHOS INFO]     raise Exception("part '{}' doesn't exist in sdk modules.".format(
   [OHOS INFO] Exception: part 'native_appdatamgr' doesn't exist in sdk modules.
   [OHOS INFO]
   [OHOS INFO] See //foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability/BUILD.gn:33:1: whence it was called.
   [OHOS INFO] ohos_shared_library("native_dataability") {
   [OHOS INFO] ^------------------------------------------
   [OHOS INFO] See //foundation/communication/dsoftbus/core/adapter/core_adapter.gni:48:5: which caused the file to be included.
   [OHOS INFO]     "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability:native_dataability",
   [OHOS INFO]     ^------------------------------------------------------------------------------------------------------
   [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/lzj/workspace/OpenHarmony3_1_7/out/qemu-arm-linux/.ninja_log not exists
   [OHOS INFO] parse file fail
   [OHOS ERROR] Please check build log in /home/lzj/workspace/OpenHarmony3_1_7/out/qemu-arm-linux/build.log
   =====build  error=====
2. 【相关的代码操作】

   repo下载完源码后,hb set选择qemu-arm-linux,然后执行hb build -f;
3. 运行结果、错误截图

   ![1721961390959.png](https://forums-obs.openharmony.c ... d10k07stbd1s7sw.png "1721961390959.png")
4. 【我尝试过的解决方法和结果】

   如果是hb set 选择的是qemu_small_system_demo,能够正常仿真运行liteos-a的内核,但是选择qemu-arm-linux就编译不过去,然后我对比发现路径OpenHarmony3_1_7/vendor/ohemu/qemu_arm_linux_min目录也缺少了较多文件,例如hals层的支持(不知道是不是正常的,我看4.0源码也是一样)

   ![1e1615dadcb62aaa9a471f7d178f1f4.png](https://forums-obs.openharmony.c ... mqbftq3z74c21vo.png "1e1615dadcb62aaa9a471f7d178f1f4.png")
5. 【我想要达到的结果】

   希望各位大佬帮忙看看,是不是openHarmony已经放弃支持qemu的linux内核仿真,是不是还需要下载什么文件?才能编译qemu-arm-linux。 我最终是编译完,需要通过qemu仿真运行的。
[/md]
作者: fengyunrenwu    时间: 2024-8-16 16:45
高度怀疑是环境问题,下载的是什么时候的代码?看起来只有分支名~~




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