当前位置:   article > 正文

海思嵌入式开发-005-OpenHarmony源码编译问题_.ninja_log not exists

.ninja_log not exists

一、问题描述

按照链接拉取master源码,出现如下问题,打开build.log文件 提示相应位置的文件没找到。

The target_cpu needs to be specified, default target_cpu=arm
[OHOS INFO] Set cache size limit to 100.0 GB
[OHOS INFO] root_out_dir=//out/hispark_pegasus/wifiiot_hispark_pegasus
[OHOS INFO] root_build_dir=//out/hispark_pegasus/wifiiot_hispark_pegasus
[OHOS INFO] root_gen_dir=//out/hispark_pegasus/wifiiot_hispark_pegasus/gen
[OHOS INFO] current_toolchain=//build/lite/toolchain:riscv32-unknown-elf
[OHOS INFO] host_toolchain=//build/toolchain/linux:clang_x64
[OHOS INFO] build configs generation is complete.
[OHOS INFO] ERROR at //build/core/gn/BUILD.gn:54:14: Unable to load "/home/matata/OpenHarmony_master/out/hispark_pegasus/wifiiot_hispark_pegasus/build_configs/BUILD.gn".
[OHOS INFO]     deps = [ "$root_build_dir/build_configs:inner_kits" ]
[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/matata/OpenHarmony_master/out/hispark_pegasus/wifiiot_hispark_pegasus/.ninja_log not exists
[OHOS INFO] parse file fail
[OHOS ERROR] Please check build log in /home/matata/OpenHarmony_master/out/hispark_pegasus/wifiiot_hispark_pegasus/build.log
scons: *** [out/hispark_pegasus/wifiiot_hispark_pegasus/Hi3861_wifiiot_app.out] Error -1

please check the compilation log: /home/matata/.deveco-device-tool/logs/build/build.log
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

后面看技术交流群的群友也有类似的问题
在这里插入图片描述

二、解决方案

2.1解决原理

因为OpenHarmony源码有Master分支,即主干分支,里面包含最新发布的代码,有很多功能特性都在开发、完善、测试中,而且每天都会有非常多的提交,因此代码可能不稳定。Master分支比较适合新功能的尝鲜体验或者日常开发;以及Release分支,即发布分支或LTs分支,是waster分支的子集,里面的代码可能会滞后Master分支多个版本。基本上是Master分支上开发完善、经过测试确认稳定之后的功能特性,才会同步到Release分支上,以供商业产品使用。目前,Release分支已有多个版本,商业公司可根据自己项目的需要选择合适的版本。

主要是目前master分支有这个问题,所以需要切换到release分支。

OpenHarmony源码下载地址:https://www.openharmony.cn/download
OpenHarmony发布版本获取源码方式:OpenHarmony Release Notes

2.2获取OpenHarmony 3.1.1 Release源码

  • 步骤1:注册码云gitee账号
  • 步骤2:在Ubuntu的用户目录下,分步执行下面的命令,安装git客户端git-lfs并配置用户信息。
sudo apt install git git-lfs curl -y
git config --global user.name "yourname"             # 你自己gitee的用户名
git config --global user.email "your-email-address"  # 你自己gitee绑定的邮箱地址
git config --global credential.helper store
  • 1
  • 2
  • 3
  • 4
  • 步骤3:在Ubuntu的用户目录下,分步执行下面的命,安装码云repo工具
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > repo
sudo cp repo /usr/local/bin/repo
sudo chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
  • 1
  • 2
  • 3
  • 4
  • 步骤4:分步执行下面的命令,配置python3环境
cd /usr/bin
sudo ln -s /usr/bin/python3.8  python
  • 1
  • 2
  • 步骤5:执行下面的命令,通过repo + https下载OpenHarmony主干代码
cd ~
mkdir OpenHarmony_master
cd OpenHarmony_master
repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1.1-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
repo forall -c git checkout -b weekly_20220419
bash build/prebuilts_download.sh
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

2.3最后解决问题,编译成功。

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/300440
推荐阅读
相关标签
  

闽ICP备14008679号