更新时间:2022-05-01 09:33:42浏览次数:57+次
在OpenHarmony开发中,hb build和hb build -f有什么区别?哪种情况用hb build,哪种情况用hb build -f?
解答
hb build 是自动增量编译,只编译有修改过的文件。hb build -f是“full code compilation”,即全编译,相当于先做hb clean,再做hb build。如果不知道用哪个,可以都试一下,看看差异在哪里。
实用hb build -f的错误,附原因
1、hi3516dv300编译问题:hb build -f报错ERROR at //kernel/liteos_a/kernel/extended/BUILD.gn:39:5
进行最小系统搭建3516开发板运行,到hb build -f(执行编译),报错:
ERROR at //kernel/liteos_a/kernel/extended/BUILD.gn:39:5: Unable to load "/home/linhr3/Desktop/code-v3.0-LTS/OpenHarmony/kernel/liteos_a/kernel/extended/pipes/BUILD.gn".
[OHOS INFO] "pipes",
[OHOS INFO] ^------
完整截图如下:
已用官方docker搭建编译环境,但到hb build -f还是报同一个错误。最后查明,从服务器下源码的过程有问题,源码不完整。
2、鸿蒙HI3516编译出现问题
harmony@harmony-virtual-machine:~/harmony/hisicode/code-404$ hb build -f
[OHOS INFO] ERROR at //build/lite/config/test.gni:40:14: Unknown function.
[OHOS INFO] list_tmp = string_split(target_name, "_test")
[OHOS INFO] ^-----------
[OHOS INFO] See //foundation/distributedschedule/dmsfwk_lite/moduletest/dtbschedmgr_lite/BUILD.gn:18:3: whence it was called.
[OHOS INFO] unittest("distributed_schedule_test_dms") {
[OHOS INFO] ^------------------------------------------
[OHOS INFO] See //build/lite/BUILD.gn:68:25: which caused the file to be included.
[OHOS INFO] deps += [ component_target ]
[OHOS INFO] ^---------------
[OHOS ERROR] you can check build log in /home/harmony/harmony/hisicode/code-404/out/hispark_taurus/ipcamera_hispark_taurus/build.log
[OHOS ERROR] /home/harmony/gn/gn gen /home/harmony/harmony/hisicode/code-404/out/hispark_taurus/ipcamera_hispark_taurus --root=/home/harmony/harmony/hisicode/code-404 --dotfile=/home/harmony/harmony/hisicode/code-404/build/lite/.gn --args=ohos_build_type="debug" ohos_build_compiler_specified="clang" ohos_build_compiler_dir="/home/harmony/llvm" product_path="//vendor/hisilicon/hispark_taurus" device_path="//device/hisilicon/hispark_taurus/sdk_liteos" ohos_kernel_type="liteos_a" enable_ohos_appexecfwk_feature_ability = true enable_graphic_font = true enable_screensaver = true ohos_full_compile=true failed, return code is 1
最后查明,是GN版本不对,需要更新下gn。
注:如果要实践的,可改换成hb build看看最终的结果。
相关资讯