当前位置: 首页 > news >正文

海思嵌入式开发-005-OpenHarmony源码编译问题

海思嵌入式开发-005-OpenHarmony源码编译问题

  • 一、问题描述
  • 二、解决方案
    • 2.1解决原理
    • 2.2获取OpenHarmony 3.1.1 Release源码
    • 2.3最后解决问题,编译成功。

一、问题描述

按照链接拉取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 -1please check the compilation log: /home/matata/.deveco-device-tool/logs/build/build.log

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

二、解决方案

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
  • 步骤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
  • 步骤4:分步执行下面的命令,配置python3环境
cd /usr/bin
sudo ln -s /usr/bin/python3.8  python
  • 步骤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

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

在这里插入图片描述

http://www.lryc.cn/news/28932.html

相关文章:

  • 指针的进阶续(笔试题强化练习)
  • 一个供参考的计算机的学习路线
  • React(五):受控组件、高阶组件、Portals、Fragment、CSS的编写方式
  • MATLAB——系统环境
  • 2 GateWay工作流程+GateWay搭建
  • 【微信小程序】富文本rich-text的图片预览效果的几种方法
  • 通信网络-Socket、Java中的网络支持、多线程服务器
  • 搞懂 JS this、call、apply、bind
  • 力扣209长度最小的子数组
  • 【mysql是怎样运行的】-InnoDB数据页结构
  • VIM实用指南(10)语法自动补全插件coc.nvim
  • 【Vue3 第二十二章】过渡动画
  • 【linux】:进程状态(僵尸进程等)以及环境变量
  • 【C语言——练习题】指针,你真的学会了吗?
  • Linux用户空间与内核空间通信(Netlink通信机制)
  • 3.3日报
  • 并发编程-进程
  • LeetCode196_196. 删除重复的电子邮箱
  • Auto.js Pro 替代品
  • 红日(vulnstack)2 内网渗透ATTCK实战
  • 一个好的工程项目管理软件所包含的主要功能
  • 【大数据监控】Grafana、Spark、HDFS、YARN、Hbase指标性能监控安装部署详细文档
  • 面试题---CSS
  • 【C++】vector
  • RocketMQ安装
  • Spring——什么是IOC?
  • 力扣(LeetCode)430. 扁平化多级双向链表(2023.03.04)
  • 条款13:优先考虑const_iterator而非iterator
  • 23考研 长安大学846计算机考研复试《数据库》
  • Android 9.0 系统去掉省电模式