OpenHarmony开发者论坛
标题:
OpenHarmony4.0编译qemu-arm-linux-headless产品报错:file '../../sdk/ohos-arm/runtime_core/sdk_info.json' doesn't exist.
[打印本页]
作者:
wqer
时间:
2024-11-13 14:46
标题:
OpenHarmony4.0编译qemu-arm-linux-headless产品报错:file '../../sdk/ohos-arm/runtime_core/sdk_info.json' doesn't exist.
[md]### 【问题描述】
1. 介绍问题现象和发生的背景
OpenHarmony4.0编译qemu-arm-linux-headless产品报错:
```
[OHOS INFO] Excuting gn command: /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"qemu-arm-linux-headless\" product_path=\"/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/vendor/ohemu/qemu_arm_linux_headless\" product_config_path=\"/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/vendor/ohemu/qemu_arm_linux_headless\" device_name=\"qemu-arm-linux\" device_path=\"/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/device/board/qemu/qemu-arm-linux\" device_company=\"qemu\" device_config_path=\"/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/device/board/qemu/qemu-arm-linux\" target_cpu=\"arm\" is_standard_system=true ohos_build_compiler_specified=\"\" ohos_build_time=1731450376154 ohos_build_datetime=\"2024-11-13 14:26:16\" hichecker_support_asan=false device_manager_no_interaction_auth=true ability_runtime_power=false ability_runtime_graphics=false dmsfwk_mission_manager=false dmsfwk_standard_form_share=false bundle_framework_graphics=false napi_enable_container_scope=false common_event_service_with_graphics=false native_appdatamgr_rdb_support_icu=false storage_service_graphic=false resource_management_support_icu=false hiprofiler_SmartPerf=false ohos_build_enable_ccache=true ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" runtime_mode=\"release\"" /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux
[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] ERROR at //build/templates/cxx/cxx.gni:1190:26: Script returned non-zero exit code.
[OHOS INFO] handler_result = exec_script(external_deps_script, arguments, "string")
[OHOS INFO] ^----------
[OHOS INFO] Current dir: /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux/
[OHOS INFO] Command: /usr/bin/env /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/templates/common/external_deps_handler.py --external-deps runtime_core:libarkassembler_frontend_static runtime_core:libarkbase_frontend_static runtime_core:libarkfile_frontend_static runtime_core:libarkziparchive_frontend_static runtime_core:libarkbytecodeopt_frontend_static runtime_core:libarkcompiler_frontend_static --parts-src-flag-file build_configs/parts_src_flag.json --external-deps-temp-file gen/arkcompiler/ets_frontend/es2panda/ets_frontend__es2panda_lib_external_deps_temp.json --sdk-base-dir ../../sdk/ohos-arm --sdk-dir-name sdk/ohos-arm --current-toolchain //build/toolchain/ohos:ohos_clang_arm --innerkits-adapter-info-file ../../build/ohos/inner_kits_adapter.json --component-override-map /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux/build_configs/component_override_map.json
[OHOS INFO] Returned 1 and printed out:
[OHOS INFO]
[OHOS INFO] file '../../sdk/ohos-arm/runtime_core/sdk_info.json' doesn't exist.
[OHOS INFO]
[OHOS INFO] stderr:
[OHOS INFO]
[OHOS INFO] Traceback (most recent call last):
[OHOS INFO] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/templates/common/external_deps_handler.py", line 262, in <module>
[OHOS INFO] sys.exit(main())
[OHOS INFO] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/templates/common/external_deps_handler.py", line 229, in main
[OHOS INFO] sdk_module_info, adapted_ok = _get_external_module_from_sdk(
[OHOS INFO] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/templates/common/external_deps_handler.py", line 74, in _get_external_module_from_sdk
[OHOS INFO] raise Exception("part '{}' doesn't exist in sdk modules.".format(
[OHOS INFO] Exception: part 'runtime_core' doesn't exist in sdk modules.
[OHOS INFO]
[OHOS INFO] See //arkcompiler/ets_frontend/es2panda/BUILD.gn:379:1: whence it was called.
[OHOS INFO] ohos_static_library("es2panda_lib") {
[OHOS INFO] ^------------------------------------
[OHOS INFO] See //out/qemu-arm-linux/build_configs/arkcompiler/ets_frontend/BUILD.gn:16:21: which caused the file to be included.
[OHOS INFO] test_packages = [ "//arkcompiler/ets_frontend/es2panda:es2abc_tests" ]
[OHOS INFO] ^-------------------------------------------------
[OHOS INFO] bundle_framework_power_mgr_enable = false
[OHOS INFO] bundle_framework_graphics = false
[OHOS INFO] bundle_framework_free_install = false
[OHOS INFO] bundle_framework_default_app = true
[OHOS INFO] bundle_framework_launcher = true
[OHOS INFO] bundle_framework_sandbox_app = true
[OHOS INFO] bundle_framework_quick_fix = true
[OHOS INFO] bundle_framework_app_control = true
[OHOS INFO] distributed_bundle_framework = true
[OHOS INFO] ability_runtime_enable = true
[OHOS INFO] account_enable = true
[OHOS INFO] configpolicy_enable = false
[OHOS INFO] global_resmgr_enable = true
[OHOS INFO] hicollie_enable = false
[OHOS INFO] support_jsapi = true
[OHOS INFO] hisysevent_enable = true
[OHOS INFO] bundle_framework_overlay_install = true
[OHOS INFO] has_hisysevent_part = false
[OHOS INFO] default_toolchain = //build/toolchain/ohos:ohos_clang_arm
[OHOS INFO] current_toolchain = //build/toolchain/ohos:ohos_clang_arm
[OHOS INFO] host_toolchain = //build/toolchain/linux:clang_x64
[OHOS INFO] root_out_dir = //out/qemu-arm-linux
[OHOS INFO] root_output_dir_proto = out/qemu-arm-linux/clang_x64
[OHOS INFO] distributed_bundle_framework_graphics = true
[OHOS INFO] ability_runtime_enable_dbms = true
[OHOS INFO] account_enable_dbms = true
[OHOS INFO] distributed_bundle_framework_enable = true
[OHOS INFO] hisysevent_enable_dbms = false
[OHOS INFO] accessibility_enable = false
[OHOS INFO] openssl detecting os now...
[OHOS INFO] current_cpu = arm
[OHOS INFO] current_os = ohos
[OHOS INFO] host_os = linux
[OHOS INFO] is_mingw = false
[OHOS INFO] openssl selected linux-armv4
[OHOS INFO] openssl detecting os done. openssl_selected_platform = linux-armv4
[OHOS INFO] e2fsprogs installed successfully
[OHOS INFO] cmd ['/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/third_party/openssl/make_openssl_build_all_generated.sh', '/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/third_party/openssl', '/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux/obj/third_party/openssl/build_all_generated', 'linux-armv4'] start
[OHOS INFO] result.returncode = 0
[OHOS INFO] result.stdout = /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux
[OHOS INFO] /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux/obj/third_party/openssl/build_all_generated/linux-armv4 /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux
[OHOS INFO] /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/third_party/openssl/Configure linux-armv4 no-shared no-module
[OHOS INFO] Configuring OpenSSL version 3.0.7 for target linux-armv4
[OHOS INFO] Using os-specific seed configuration
[OHOS INFO] Created configdata.pm
[OHOS INFO] Running configdata.pm
[OHOS INFO] Created Makefile.in
[OHOS INFO] Created Makefile
[OHOS INFO] Created include/openssl/configuration.h
[OHOS INFO]
[OHOS INFO] **********************************************************************
[OHOS INFO] *** ***
[OHOS INFO] *** OpenSSL has been successfully configured ***
[OHOS INFO] *** ***
[OHOS INFO] *** If you encounter a problem while building, please open an ***
[OHOS INFO] *** issue on GitHub <
https://github.com/openssl/openssl/issues
> ***
[OHOS INFO] *** and include the output from the following command: ***
[OHOS INFO] *** ***
[OHOS INFO] *** perl configdata.pm --dump ***
[OHOS INFO] *** ***
[OHOS INFO] *** (If you are new to OpenSSL, you might want to consult the ***
[OHOS INFO] *** 'Troubleshooting' section in the INSTALL.md file first) ***
[OHOS INFO] *** ***
[OHOS INFO] **********************************************************************
[OHOS INFO] /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux
[OHOS INFO]
[OHOS INFO] cmd ['/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/third_party/openssl/make_openssl_build_all_generated.sh', '/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/third_party/openssl', '/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux/obj/third_party/openssl/build_all_generated', 'linux-armv4'] ok
[OHOS INFO]
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/hb/services/gn.py", line 176, in _execute_gn_gen_cmd
[OHOS ERROR] SystemUtil.exec_command(gn_gen_cmd, self.config.log_path)
[OHOS ERROR] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/hb/util/system_util.py", line 63, in exec_command
[OHOS ERROR] raise OHOSException(
[OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/oh/OpenHarmony-v4.0-Release/OpenHarmony/out/qemu-arm-linux/build.log
[OHOS ERROR]
[OHOS ERROR] During handling of the above exception, another exception occurred:
[OHOS ERROR]
[OHOS ERROR] Traceback (most recent call last):
[OHOS ERROR] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/hb/containers/status.py", line 47, in wrapper
[OHOS ERROR] return func(*args, **kwargs)
[OHOS ERROR] File "/home/oh/OpenHarmony-v4.0-Release/OpenHarmony/build/hb/services/gn.py", line 178, in _execute_gn_gen_cmd
[OHOS ERROR] raise OHOSException('GN phase failed', '3000')
[OHOS ERROR] exceptions.ohos_exception.OHOSException: GN phase failed
[OHOS ERROR]
[OHOS ERROR] Code: 3000
[OHOS ERROR]
[OHOS ERROR] Reason: GN phase failed
[OHOS ERROR]
[OHOS ERROR] Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs.
[OHOS ERROR] Or you can try the following steps to solve this problem:
[OHOS ERROR] 1. cd to OHOS root path
[OHOS ERROR] 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'.
[OHOS ERROR] 3. repo sync
[OHOS ERROR] 4. repo forall -c 'git lfs pull'
[OHOS ERROR] 5. bash build/prebuilts_download.sh
[OHOS ERROR] 6. rebuild your product or component
[OHOS ERROR]
[OHOS ERROR] If you still cannot solve this problem, you could post this problem on:
[OHOS ERROR]
https://gitee.com/openharmony/build/issues
[OHOS ERROR]
=====build error=====
```
详细编译日志见附件
2. 编译步骤
```
# bash ./build/build_scripts/env_setup.sh
# bash build/prebuilts_download.sh
# ./build.sh --product-name qemu-arm-linux-headless --skip-partlist-check
```
3. 我想要达到的结果
编译OpenHarmony4.0成功。
### 【运行环境】
OpenHarmony-docker镜像
操作系统版本:ubuntu20.04.1 LTS (Focal Fossa)
架构: x86_64
[/md]
作者:
wqer
时间:
2024-11-13 14:47
这是详细的编译日志
作者:
Song
时间:
4 天前
python 版本问题,需要更新到3.8以上 。
欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/)
Powered by Discuz! X3.5