实现 arm64 HarmonyOS 上的本地构建 - #64
Merged
Merged
Conversation
…接) 后添加与clang不兼容的flag
根本原因:`threading.Event` 一旦 `set()` 永久保持。当所有初始扫描任务恰好先完成时,`_pending` 短暂归零触发了 `_event.set()`,但主线程此时还在 `for` 循环中阻塞于 `scan_slots.acquire()`,未提交完所有顶层目录。等到主线程到达 `tracker.wait()` 时 event 早已 set,立即返回,后续条目被遗漏。 修复:增加了 `_all_submitted` 标志。只有同时满足「所有顶层条目已提交」和「所有扫描任务已完成」两个条件时,才设置 event 放行 `wait()`。
调整 PATH 让系统 cat 和 cp 命令优先级更高,避免使用 brew 的 cat 和 cp 命令 brew cat 会导致 cat: -: Broken pipe 报错,详见: https://atomgit.com/org/Harmonybrew/discussions/6 brew cp 会导致 libffi.so.8 复制失败并得到损坏的文件,报错如下: cp: error deallocating '……/WineHua/entry/libs/arm64-v8a/libffi.so.8': Permission denied 并且报错后cp依然以状态码0退出,所以编译不会失败,但最终得到的hap会闪退。
可通过 https://github.com/SwimmingTiger/command-line-tools/releases 下载 ohos 版 command-line-tools
比如 scripts/build_native.sh 的以下错误信息就会被 $() 吞掉: err "python3 with PyYAML is required. Install: pip3 install pyyaml"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
构建方法:
下载并解压鸿蒙原生 command-line-tools: https://github.com/SwimmingTiger/command-line-tools/releases
下载并解压鸿蒙原生 llvm-mingw: https://github.com/SwimmingTiger/llvm-mingw/releases
安装Harmonybrew并通过
brew命令安装依赖包:备注:
mesa那个缺少mako的报错不仅要安装mako,还得安装packaging才能解决。还有一些别的不记得了,可以看报错再装 (190598 修复了缺少
pyyaml的报错不可见)build-profile.json5已经测试过可以构建出可用的hap,并且签名功能也正常(在
build-profile.json5配置正确的证书就可以)。build-on-ohos.sh 会避免使用 brew 的 cat 和 cp 命令,它们产生的具体问题见 build-on-ohos.sh 的注释:
相关issue:
构建结果: