Py_SetPath导致的BUG一例(issue11320)

本文详细探讨了Python中Py_SetPath函数的使用误区及其引发的问题,包括路径分隔符的平台差异、sys.prefix为空导致的错误等,并提出了可行的替代方案。

为了找出这个问题,用了整天一天的时间来看Python的源码,不过还好,至少还熟悉了一下Python中这些杂乱的路径,并找到了原因。

issue11320 涉及的到就是Py_SetPath这个函数!

Manual中是这么介绍这个函数的:

void Py_SetPath(const wchar_t *)

Set the default module search path. If this function is called before Py_Initialize(), then Py_GetPath() won’t attempt to compute a default search path but uses the one provided instead. This is useful if Python is embedded by an application that has full knowledge of the location of all modules. The path components should be separated by semicolons.

此外:源码的注释中,也在建议使用这个函数:

 * An embedding application can use Py_SetPath() to override all of
 * these authomatic path computations.

起源

非常简单的一个程序:

#include "Python.h"
int main()
{
    Py_SetPath(L"/home/debao/Download/python/lib/python3.2/;"
               "/home/debao/Download/python/lib/python3.2/plat-linux2;"
               "/home/debao/Download/python/lib/python3.2/lib-dynload");
    Py_Initialize();
    PyRun_SimpleString("print(\'Hello C/C++\')");
    Py_Finalize();
    return 0;
}

额,为了调试的方便,我用的Qt Creator,使用的.pro文件如下:

CONFIG -=qt
SOURCES += test.cpp
INCLUDEPATH += ../include/python3.2m
LIBS += -L../lib -lpython3.2m -lpthread -ldl -lutil

编译,运行,结果出错:

  Fatal Python error: Py_Initialize: Unable to get the locale encoding
  LookupError: no codec search functions registered: can't find encoding

错误出在,Py_InitalizeExinitfsencoding(interp)一句,调试,调试,调试

最终发现Manual中说错了一句。路径中不是分号分割,而是用 冒号。准确一点,Windows下用分号,其他平台用冒号。

恩,我改

#include "Python.h"
int main()
{
    Py_SetPath(L"/home/debao/Download/python/lib/python3.2/:"
               "/home/debao/Download/python/lib/python3.2/plat-linux2:"
               "/home/debao/Download/python/lib/python3.2/lib-dynload");
    Py_Initialize();
    PyRun_SimpleString("print(\'Hello C/C++\')");
    Py_Finalize();
    return 0;
}

这下好了,上面的错误没有了,可是,错误信息更长了....

Traceback (most recent call last):
  File "/home/debao/Download/python/lib/python3.2/sysconfig.py", line 339, in _init_posix
    _parse_makefile(makefile, vars)
  File "/home/debao/Download/python/lib/python3.2/sysconfig.py", line 222, in _parse_makefile
    with open(filename, errors="surrogateescape") as f:
IOError: [Errno 2] No such file or directory: 'lib/python3.2/config-3.2m/Makefile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/debao/Download/python/lib/python3.2/site.py", line 529, in <module>
    main()
  File "/home/debao/Download/python/lib/python3.2/site.py", line 517, in main
    known_paths = addusersitepackages(known_paths)
...

过程就不描述了,这个问题就是7个月前的issue11320所报告的。

原因

调用Py_SetPath会使得 sys.prefix 和 sys.exec_prefix 都为空。这点Manual中也提到了:

This also causes sys.executable to be set only to the raw program name (see Py_SetProgramName()) and for sys.prefix and sys.exec_prefix to be empty. 

可是,在sysconfig.py文件中,需要使用 sys.prefix 来找到一个配置用的 makefile 文件,而空串 sys.prefix 导致生成错误的文件路径名:lib/python3.2/config-3.2m/Makefile,因此该文件无法被找到。

Py_InitializeEx执行的后期,会导入 site.py 模块,而 site.py 模块需要 sysconfig.py 模块,从而导致这个问题。

如何解决?

不清楚这个bug如何解决,反正暂时在issue11320留下commit了,希望对官方解决这个问题能有帮助。

Py_SetPath目前是用不成了,不过还好,我们可以使用Py_SetPythonHome或者Py_SetProgramName。除此之外,环境变量也是可以用的,只是个人不太喜欢。

#include "Python.h"
int main()
{
#if 0
    Py_SetPythonHome(L"/home/debao/Download/python/");
#else
    Py_SetProgramName(L"/home/debao/Download/python/bin/python3");
#endif
    Py_Initialize();
    PyRun_SimpleString("print(\'Hello C/C++\')");
    Py_Finalize();
    return 0;
}

参考


Ninja 时间戳错误rongxia@rongxia-VirtualBox:~/OpenHarmony_master$ hb build -f [OHOS INFO] Set cache size limit to 100.0 GB [OHOS WARNING] [PRELOAD] The target_cpu needs to be specified, default target_cpu=arm [OHOS INFO] [PRELOAD] generated build prop info to /home/rongxia/OpenHarmony_master/out/preloader/product1/build.prop [OHOS INFO] [PRELOAD] generated build config info to /home/rongxia/OpenHarmony_master/out/preloader/product1/build_config.json [OHOS INFO] [PRELOAD] generated product parts info to /home/rongxia/OpenHarmony_master/out/preloader/product1/parts.json [OHOS INFO] [PRELOAD] generated parts config info to /home/rongxia/OpenHarmony_master/out/preloader/product1/parts_config.json [OHOS INFO] [PRELOAD] generated build gnargs prop info to /home/rongxia/OpenHarmony_master/out/preloader/product1/build_gnargs.prop [OHOS INFO] [PRELOAD] generated features info to /home/rongxia/OpenHarmony_master/out/preloader/product1/features.json [OHOS INFO] [PRELOAD] generated syscap info to /home/rongxia/OpenHarmony_master/out/preloader/product1/syscap.json [OHOS INFO] [PRELOAD] generated exclusion modules info to /home/rongxia/OpenHarmony_master/out/preloader/product1/exclusion_modules.json [OHOS INFO] [PRELOAD] generated platforms build info to /home/rongxia/OpenHarmony_master/out/preloader/product1/platforms.build [OHOS INFO] [PRELOAD] generated subsystem config info to /home/rongxia/OpenHarmony_master/out/preloader/product1/subsystem_config.json [OHOS INFO] [PRELOAD] generated system capability info to /home/rongxia/OpenHarmony_master/out/preloader/product1/systemcapability.json [OHOS INFO] [PRELOAD] generated compile_standard_whitelist info to /home/rongxia/OpenHarmony_master/out/preloader/product1/compile_standard_whitelist.json [OHOS INFO] [PRELOAD] generated compile_env_allowlist info to /home/rongxia/OpenHarmony_master/out/preloader/product1/compile_env_allowlist.json [OHOS INFO] [PRELOAD] generated hvigor_compile_whitelist info to /home/rongxia/OpenHarmony_master/out/preloader/product1/hvigor_compile_hap_whitelist.json [OHOS INFO] The run time for _prebuild_and_preload is 0.06 s [OHOS INFO] [LOAD] Checking all build args... [OHOS INFO] [LOAD] The thread num for subsytem config scan is 8 [OHOS INFO] [LOAD] subsytem config scan completed [OHOS INFO] [LOAD] all parts scan completed [OHOS INFO] [LOAD] Loading configuration file... [OHOS INFO] [LOAD] loader args:['platforms_config_file="/home/rongxia/OpenHarmony_master/out/preloader/product1/platforms.build"', 'subsystem_config_file="/home/rongxia/OpenHarmony_master/out/preloader/product1/subsystem_config.json"', 'example_subsystem_file=""', 'exclusion_modules_config_file="/home/rongxia/OpenHarmony_master/out/preloader/product1/exclusion_modules.json"', 'source_root_dir="/home/rongxia/OpenHarmony_master/"', 'gn_root_out_dir="out/hispark_pegasus/product1"', 'build_platform_name=phone', 'build_xts=False', 'load_test_config=True', 'target_os=ohos', 'target_cpu=arm', 'os_level=mini', "ignore_api_check=['xts', 'common', 'testfwk']", 'scalable_build=False', 'skip_partlist_check=False'] [OHOS INFO] [LOAD] Checking parts config... [OHOS INFO] [LOAD] generated subsystem build config to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/subsystem_info/subsystem_build_config.json' [OHOS INFO] [LOAD] generated src subsystem info to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/subsystem_info/src_subsystem_info.json' [OHOS INFO] [LOAD] generated no src subsystem info to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/subsystem_info/no_src_subsystem_info.json' [OHOS INFO] [LOAD] generate target platform parts to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/target_platforms_parts.json' [OHOS INFO] [LOAD] generated system capabilities to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/phone_system_capabilities.json' [OHOS INFO] [LOAD] generated platforms parts by src to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/platforms_parts_by_src.json' [OHOS INFO] [LOAD] generate required parts targets to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/required_parts_targets.json' [OHOS INFO] [LOAD] generate build targets list file to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/required_parts_targets_list.json' [OHOS INFO] [LOAD] generated parts src flag to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/subsystem_info/parts_src_flag.json' [OHOS INFO] [LOAD] generate auto install part to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/auto_install_parts.json' [OHOS INFO] [LOAD] generate platforms list to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/platforms_list.gni' [OHOS INFO] [LOAD] generate part different info to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/parts_different_info.json' [OHOS INFO] [LOAD] generate infos for testfwk to '/home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build_configs/infos_for_testfwk.json' [OHOS INFO] [LOAD] Checking all product features... [OHOS INFO] [LOAD] generate syscap info file to '/home/rongxia/OpenHarmony_master/out/preloader/product1/system/etc/SystemCapability.json' [OHOS INFO] [LOAD] generate syscap info with part name list to '/home/rongxia/OpenHarmony_master/out/preloader/product1/system/etc/syscap.json' [OHOS INFO] [LOAD] generate target syscap for init list to '/home/rongxia/OpenHarmony_master/out/preloader/product1/system/etc/param/syscap.para' [OHOS INFO] [GN] Excuting gn command: /home/rongxia/OpenHarmony_master/prebuilts/build-tools/linux-x86/bin/gn gen --args="product_name=\"product1\" product_path=\"/home/rongxia/OpenHarmony_master/vendor/dragon/product1\" product_config_path=\"/home/rongxia/OpenHarmony_master/vendor/dragon/product1\" device_name=\"hispark_pegasus\" device_path=\"/home/rongxia/OpenHarmony_master/device/board/hisilicon/hispark_pegasus/liteos_m\" device_company=\"hisilicon\" device_config_path=\"/home/rongxia/OpenHarmony_master/device/board/hisilicon/hispark_pegasus/liteos_m\" precise_branch=\"\" is_mini_system=true ohos_kernel_type=\"liteos_m\" ohos_build_compiler_specified=\"gcc\" ohos_build_time=1761066533160 ohos_build_datetime=\"2025-10-22 09:08:53\" ohos_build_enable_ccache=true use_thin_lto=false ohos_build_type=\"debug\" device_type=\"default\" build_variant=\"root\" root_perf_main=\"main\" runtime_mode=\"release\"" --args=product_name="product1" product_path="/home/rongxia/OpenHarmony_master/vendor/dragon/product1" product_config_path="/home/rongxia/OpenHarmony_master/vendor/dragon/product1" device_name="hispark_pegasus" device_path="/home/rongxia/OpenHarmony_master/device/board/hisilicon/hispark_pegasus/liteos_m" device_company="hisilicon" device_config_path="/home/rongxia/OpenHarmony_master/device/board/hisilicon/hispark_pegasus/liteos_m" precise_branch="" is_mini_system=true ohos_kernel_type="liteos_m" ohos_build_compiler_specified="gcc" ohos_build_time=1761066533160 ohos_build_datetime="2025-10-22 09:08:53" ohos_build_enable_ccache=true use_thin_lto=false ohos_build_type="debug" device_type="default" build_variant="root" root_perf_main="main" runtime_mode="release" /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1 --script-executable=/usr/bin/python3 [OHOS INFO] [GN] root_out_dir=//out/hispark_pegasus/product1 [OHOS INFO] [GN] root_build_dir=//out/hispark_pegasus/product1 [OHOS INFO] [GN] root_gen_dir=//out/hispark_pegasus/product1/gen [OHOS INFO] [GN] current_toolchain=//build/lite/toolchain:riscv32-unknown-elf [OHOS INFO] [GN] host_toolchain=//build/toolchain/linux:clang_x64 [OHOS INFO] [GN] ohos_build_compiler: gcc [OHOS INFO] [GN] ohos_kernel_type: liteos_m [OHOS INFO] [GN] liteos_config_file: /home/rongxia/OpenHarmony_master/vendor/dragon/product1/kernel_configs/debug.config [OHOS INFO] [GN] WARNING at the command-line "--args":1:443: Build argument has no effect. [OHOS INFO] [GN] product_name="product1" product_path="/home/rongxia/OpenHarmony_master/vendor/dragon/product1" product_config_path="/home/rongxia/OpenHarmony_master/vendor/dragon/product1" device_name="hispark_pegasus" device_path="/home/rongxia/OpenHarmony_master/device/board/hisilicon/hispark_pegasus/liteos_m" device_company="hisilicon" device_config_path="/home/rongxia/OpenHarmony_master/device/board/hisilicon/hispark_pegasus/liteos_m" precise_branch="" is_mini_system=true ohos_kernel_type="liteos_m" ohos_build_compiler_specified="gcc" ohos_build_time=1761066533160 ohos_build_datetime="2025-10-22 09:08:53" ohos_build_enable_ccache=true use_thin_lto=false ohos_build_type="debug" device_type="default" build_variant="root" root_perf_main="main" runtime_mode="release" [OHOS INFO] [GN] ^- [OHOS INFO] [GN] The variable "precise_branch" was set as a build argument [OHOS INFO] [GN] but never appeared in a declare_args() block in any buildfile. [OHOS INFO] [GN] [OHOS INFO] [GN] To view all possible args, run "gn args --list <out_dir>" [OHOS INFO] [GN] [OHOS INFO] [GN] The build continued as if that argument was unspecified. [OHOS INFO] [GN] [OHOS INFO] [GN] Done. Made 185 targets from 174 files in 3613ms [OHOS INFO] The run time for _gn is 3.63 s [OHOS INFO] [NINJA] Excuting ninja command: /home/rongxia/OpenHarmony_master/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1 images make_all make_test [OHOS INFO] [NINJA] [0/1] Regenerating ninja files [OHOS INFO] [NINJA] [0/2] Regenerating ninja files [OHOS INFO] [NINJA] [0/3] Regenerating ninja files [OHOS INFO] [NINJA] [0/4] Regenerating ninja files [OHOS INFO] [NINJA] [0/5] Regenerating ninja files [OHOS INFO] [NINJA] [0/6] Regenerating ninja files [OHOS INFO] [NINJA] [0/7] Regenerating ninja files [OHOS INFO] [NINJA] [0/8] Regenerating ninja files [OHOS INFO] [NINJA] [0/9] Regenerating ninja files [OHOS INFO] [NINJA] [0/10] Regenerating ninja files [OHOS INFO] [NINJA] [0/11] Regenerating ninja files [OHOS INFO] [NINJA] [0/12] Regenerating ninja files [OHOS INFO] [NINJA] [0/13] Regenerating ninja files [OHOS INFO] [NINJA] [0/14] Regenerating ninja files [OHOS INFO] [NINJA] [0/15] Regenerating ninja files [OHOS INFO] [NINJA] [0/16] Regenerating ninja files [OHOS INFO] [NINJA] [0/17] Regenerating ninja files [OHOS INFO] [NINJA] [0/18] Regenerating ninja files [OHOS INFO] [NINJA] [0/19] Regenerating ninja files [OHOS INFO] [NINJA] [0/20] Regenerating ninja files [OHOS INFO] [NINJA] [0/21] Regenerating ninja files [OHOS INFO] [NINJA] [0/22] Regenerating ninja files [OHOS INFO] [NINJA] [0/23] Regenerating ninja files [OHOS INFO] [NINJA] [0/24] Regenerating ninja files [OHOS INFO] [NINJA] [0/25] Regenerating ninja files [OHOS INFO] [NINJA] [0/26] Regenerating ninja files [OHOS INFO] [NINJA] [0/27] Regenerating ninja files [OHOS INFO] [NINJA] [0/28] Regenerating ninja files [OHOS INFO] [NINJA] [0/29] Regenerating ninja files [OHOS INFO] [NINJA] [0/30] Regenerating ninja files [OHOS INFO] [NINJA] [0/31] Regenerating ninja files [OHOS INFO] [NINJA] [0/32] Regenerating ninja files [OHOS INFO] [NINJA] [0/33] Regenerating ninja files [OHOS INFO] [NINJA] [0/34] Regenerating ninja files [OHOS INFO] [NINJA] [0/35] Regenerating ninja files [OHOS INFO] [NINJA] [0/36] Regenerating ninja files [OHOS INFO] [NINJA] [0/37] Regenerating ninja files [OHOS INFO] [NINJA] [0/38] Regenerating ninja files [OHOS INFO] [NINJA] [0/39] Regenerating ninja files [OHOS INFO] [NINJA] [0/40] Regenerating ninja files [OHOS INFO] [NINJA] [0/41] Regenerating ninja files [OHOS INFO] [NINJA] [0/42] Regenerating ninja files [OHOS INFO] [NINJA] [0/43] Regenerating ninja files [OHOS INFO] [NINJA] [0/44] Regenerating ninja files [OHOS INFO] [NINJA] [0/45] Regenerating ninja files [OHOS INFO] [NINJA] [0/46] Regenerating ninja files [OHOS INFO] [NINJA] [0/47] Regenerating ninja files [OHOS INFO] [NINJA] [0/48] Regenerating ninja files [OHOS INFO] [NINJA] [0/49] Regenerating ninja files [OHOS INFO] [NINJA] [0/50] Regenerating ninja files [OHOS INFO] [NINJA] [0/51] Regenerating ninja files [OHOS INFO] [NINJA] [0/52] Regenerating ninja files [OHOS INFO] [NINJA] [0/53] Regenerating ninja files [OHOS INFO] [NINJA] [0/54] Regenerating ninja files [OHOS INFO] [NINJA] [0/55] Regenerating ninja files [OHOS INFO] [NINJA] [0/56] Regenerating ninja files [OHOS INFO] [NINJA] [0/57] Regenerating ninja files rrrrr[OHOS INFO] [NINJA] [0/58] Regenerating ninja files [OHOS INFO] [NINJA] [0/59] Regenerating ninja files [OHOS INFO] [NINJA] [0/60] Regenerating ninja files [OHOS INFO] [NINJA] [0/61] Regenerating ninja files [OHOS INFO] [NINJA] [0/62] Regenerating ninja files [OHOS INFO] [NINJA] [0/63] Regenerating ninja files [OHOS INFO] [NINJA] [0/64] Regenerating ninja files [OHOS INFO] [NINJA] [0/65] Regenerating ninja files [OHOS INFO] [NINJA] [0/66] Regenerating ninja files [OHOS INFO] [NINJA] [0/67] Regenerating ninja files [OHOS INFO] [NINJA] [0/68] Regenerating ninja files [OHOS INFO] [NINJA] [0/69] Regenerating ninja files [OHOS INFO] [NINJA] [0/70] Regenerating ninja files [OHOS INFO] [NINJA] [0/71] Regenerating ninja files [OHOS INFO] [NINJA] [0/72] Regenerating ninja files [OHOS INFO] [NINJA] [0/73] Regenerating ninja files [OHOS INFO] [NINJA] [0/74] Regenerating ninja files [OHOS INFO] [NINJA] [0/75] Regenerating ninja files [OHOS INFO] [NINJA] [0/76] Regenerating ninja files [OHOS INFO] [NINJA] [0/77] Regenerating ninja files [OHOS INFO] [NINJA] [0/78] Regenerating ninja files [OHOS INFO] [NINJA] [0/79] Regenerating ninja files [OHOS INFO] [NINJA] [0/80] Regenerating ninja files [OHOS INFO] [NINJA] [0/81] Regenerating ninja files [OHOS INFO] [NINJA] [0/82] Regenerating ninja files [OHOS INFO] [NINJA] [0/83] Regenerating ninja files [OHOS INFO] [NINJA] [0/84] Regenerating ninja files [OHOS INFO] [NINJA] [0/85] Regenerating ninja files [OHOS INFO] [NINJA] [0/86] Regenerating ninja files [OHOS INFO] [NINJA] [0/87] Regenerating ninja files [OHOS INFO] [NINJA] [0/88] Regenerating ninja files [OHOS INFO] [NINJA] [0/89] Regenerating ninja files [OHOS INFO] [NINJA] [0/90] Regenerating ninja files [OHOS INFO] [NINJA] [0/91] Regenerating ninja files [OHOS INFO] [NINJA] [0/92] Regenerating ninja files [OHOS INFO] [NINJA] [0/93] Regenerating ninja files [OHOS INFO] [NINJA] [0/94] Regenerating ninja files [OHOS INFO] [NINJA] [0/95] Regenerating ninja files [OHOS INFO] [NINJA] [0/96] Regenerating ninja files [OHOS INFO] [NINJA] [0/97] Regenerating ninja files [OHOS INFO] [NINJA] [0/98] Regenerating ninja files [OHOS INFO] [NINJA] [0/99] Regenerating ninja files [OHOS INFO] [NINJA] [0/100] Regenerating ninja files [OHOS ERROR] [NINJA] command failed: "/home/rongxia/OpenHarmony_master/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1 images make_all make_test" , ret_code: 1 [OHOS ERROR] [NINJA] ninja: error: manifest 'build.ninja' still dirty after 100 tries, perhaps system time is not set [OHOS INFO] User Cpu%: 0.0% [OHOS INFO] System Cpu%: 1.5% [OHOS INFO] Idle CPU%: 98.5% [OHOS INFO] Total Memory: 3.8GB [OHOS INFO] Free Memory: 0.2GB [OHOS INFO] Swap Memory: 2.0GB [OHOS INFO] Filesystem: udev, Size: 1.9G, Used: 0, Available: 1.9G, Use%: 0%, Mounted on: /dev [OHOS INFO] Filesystem: tmpfs, Size: 392M, Used: 2.8M, Available: 390M, Use%: 1%, Mounted on: /run [OHOS INFO] Filesystem: /dev/sda1, Size: 197G, Used: 109G, Available: 79G, Use%: 59%, Mounted on: / [OHOS INFO] Filesystem: tmpfs, Size: 2.0G, Used: 0, Available: 2.0G, Use%: 0%, Mounted on: /dev/shm [OHOS INFO] Filesystem: tmpfs, Size: 5.0M, Used: 4.0K, Available: 5.0M, Use%: 1%, Mounted on: /run/lock [OHOS INFO] Filesystem: tmpfs, Size: 2.0G, Used: 0, Available: 2.0G, Use%: 0%, Mounted on: /sys/fs/cgroup [OHOS INFO] Filesystem: /dev/loop0, Size: 128K, Used: 128K, Available: 0, Use%: 100%, Mounted on: /snap/bare/5 [OHOS INFO] Filesystem: /dev/loop2, Size: 56M, Used: 56M, Available: 0, Use%: 100%, Mounted on: /snap/core18/2947 [OHOS INFO] Filesystem: /dev/loop1, Size: 56M, Used: 56M, Available: 0, Use%: 100%, Mounted on: /snap/core18/2952 [OHOS INFO] Filesystem: /dev/loop3, Size: 67M, Used: 67M, Available: 0, Use%: 100%, Mounted on: /snap/core24/1151 [OHOS INFO] Filesystem: /dev/loop4, Size: 64M, Used: 64M, Available: 0, Use%: 100%, Mounted on: /snap/core20/2599 [OHOS INFO] Filesystem: /dev/loop5, Size: 64M, Used: 64M, Available: 0, Use%: 100%, Mounted on: /snap/core20/2669 [OHOS INFO] Filesystem: /dev/loop6, Size: 9.5M, Used: 9.5M, Available: 0, Use%: 100%, Mounted on: /snap/gnome-characters/805 [OHOS INFO] Filesystem: /dev/loop7, Size: 2.2M, Used: 2.2M, Available: 0, Use%: 100%, Mounted on: /snap/gnome-calculator/972 [OHOS INFO] Filesystem: /dev/loop8, Size: 67M, Used: 67M, Available: 0, Use%: 100%, Mounted on: /snap/core24/1196 [OHOS INFO] Filesystem: /dev/loop9, Size: 2.5M, Used: 2.5M, Available: 0, Use%: 100%, Mounted on: /snap/gnome-calculator/884 [OHOS INFO] Filesystem: /dev/loop11, Size: 1.8M, Used: 1.8M, Available: 0, Use%: 100%, Mounted on: /snap/gnome-system-monitor/193 [OHOS INFO] Filesystem: /dev/loop10, Size: 2.5M, Used: 2.5M, Available: 0, Use%: 100%, Mounted on: /snap/gnome-system-monitor/163 [OHOS INFO] Filesystem: /dev/loop12, Size: 640K, Used: 640K, Available: 0, Use%: 100%, Mounted on: /snap/gnome-logs/106 [OHOS INFO] Filesystem: /dev/loop13, Size: 768K, Used: 768K, Available: 0, Use%: 100%, Mounted on: /snap/gnome-characters/726 [OHOS INFO] Filesystem: /dev/loop14, Size: 896K, Used: 896K, Available: 0, Use%: 100%, Mounted on: /snap/gnome-logs/129 [OHOS INFO] Filesystem: /dev/loop15, Size: 51M, Used: 51M, Available: 0, Use%: 100%, Mounted on: /snap/snapd/25202 [OHOS INFO] Filesystem: tmpfs, Size: 392M, Used: 28K, Available: 392M, Use%: 1%, Mounted on: /run/user/1000 [OHOS INFO] Filesystem: /dev/sr0, Size: 52M, Used: 52M, Available: 0, Use%: 100%, Mounted on: /media/rongxia/VBox_GAs_7.0.20 [OHOS ERROR] [NINJA] Traceback (most recent call last): [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/containers/status.py", line 47, in wrapper [OHOS ERROR] [NINJA] return func(*args, **kwargs) [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/modules/ohos_build_module.py", line 70, in run [OHOS ERROR] [NINJA] raise exception [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/modules/ohos_build_module.py", line 67, in run [OHOS ERROR] [NINJA] super().run() [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/modules/interface/build_module_interface.py", line 70, in run [OHOS ERROR] [NINJA] raise exception [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/modules/interface/build_module_interface.py", line 68, in run [OHOS ERROR] [NINJA] self._ninja() [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/util/timer_util.py", line 30, in inner [OHOS ERROR] [NINJA] res = func(*arg, **kwarg) [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/modules/interface/build_module_interface.py", line 125, in _ninja [OHOS ERROR] [NINJA] self._target_compilation() [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/modules/ohos_build_module.py", line 112, in _target_compilation [OHOS ERROR] [NINJA] self.target_compiler.run() [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/services/ninja.py", line 39, in run [OHOS ERROR] [NINJA] self._execute_ninja_cmd() [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/services/ninja.py", line 70, in _execute_ninja_cmd [OHOS ERROR] [NINJA] SystemUtil.exec_command( [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/util/system_util.py", line 137, in exec_command [OHOS ERROR] [NINJA] LogUtil.get_failed_log(log_path, cmd) [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/util/log_util.py", line 220, in get_failed_log [OHOS ERROR] [NINJA] LogUtil.get_ninja_failed_log(log_path) [OHOS ERROR] [NINJA] File "/home/rongxia/OpenHarmony_master/build/hb/util/log_util.py", line 173, in get_ninja_failed_log [OHOS ERROR] [NINJA] raise OHOSException( [OHOS ERROR] [NINJA] exceptions.ohos_exception.OHOSException: NINJA Failed! Please check error in /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/error.log, and for more build information in /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build.log [OHOS ERROR] [NINJA] [OHOS ERROR] [NINJA] Code: 4000 [OHOS ERROR] [NINJA] [OHOS ERROR] [NINJA] Reason: NINJA Failed! Please check error in /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/error.log, and for more build information in /home/rongxia/OpenHarmony_master/out/hispark_pegasus/product1/build.log [OHOS ERROR] [NINJA] [OHOS ERROR] [NINJA] Error Type: Ninja build error [OHOS ERROR] [NINJA] [OHOS ERROR] [NINJA] Description: An unknown error occurred while executing 'ninja -C'. [OHOS ERROR] [NINJA] [OHOS ERROR] [NINJA] Solution: no solution [OHOS ERROR] [NINJA]
最新发布
10-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值