zl程序教程

您现在的位置是:首页 >  .Net

当前栏目

OpenHarmony 学习笔记 01

2023-02-18 15:41:28 时间

1 下载代码

环境

  • macOS Catalina 10.15.7, brew, pip/pip3, python/python3

下载方法

cd ~/Development/Gitee
mkdir ./bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ./bin/repo
chmod a+x ./bin/repo
export PATH=$PATH:./bin # 配置到环境变量中

pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests

mkdir ./openharmony_master
cd ./openharmony_master
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'

下载成功

  • repo sync 耗时约 30 分钟,下载完成后代码文件夹总共 24.41 GB

问题记录

  1. repo init 出错
  2. 反复提示 "No module named requests" 错误,以下链接方法解决问题:

https://stackoverflow.com/questions/17309288/importerror-no-module-named-requests

python3 -m pip install requests
  1. repo sync -c 出错
git-lfs: command not found
  • 以下链接方法解决问题:

https://stackoverflow.com/questions/67395259/git-clone-git-lfs-filter-process-git-lfs-command-not-found

brew install git-lfs
git lfs install

2 构建版本

执行 prebuilts

  • 在源码根目录下执行prebuilts脚本,安装编译器及二进制工具
bash build/prebuilts_download.sh

构建

cd ./build/build_scripts/
./env_setup.sh
./build.sh
  • Mac系统貌似不支持,后续再研究下

问题记录

  1. prebuilts_download 出错
ERROR: Could not find a version that satisfies the requirement rich (from versions: none)
ERROR: No matching distribution found for rich
  • 解决
python3 -m pip install rich

3 提交代码

(待补充)