Ai-Thinker-Open_RTL8710BX_A.../docs/BUILD_VERIFICATION.md
2026-08-07 15:15:33 +08:00

79 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# RTL8710BX SDK 构建验证
验证日期2026-08-07Asia/Shanghai
- GitHub 基线提交:`27b3e2883d5801551c6919bf405583919d2f3f08`
- 提交分支源码提交:`224b2615371adc1a8b6714fafcc8f821089e5e35`
- WSL 验证提交:`bba690e6a8c6e6c4c6ccd9bd14b320a68957b006`
- WSL 验证 Tree`0dfc8affd74fe38afd189b20528d7aa9e3bb7140`
- 验证目标:`example/smart_outlet@mk3080`
提交分支源码提交与 WSL 验证提交拥有相同 Git tree。它们仅在基线基础上修改 `gen_auto_code.py` 的两处文本读取方式,使混合编码的遗留源码可以由 Python 2/3 安全扫描;产品 C 源码和固件逻辑未改动。
## 环境
| 项目 | 版本 |
| --- | --- |
| WSL | 2.7.11 |
| Linux 内核 | `6.18.33.2-microsoft-standard-WSL2` |
| 发行版 | Ubuntu 22.04.5 LTS |
| aos-cube | 0.5.11(独立 Python 3 虚拟环境) |
| Python 2 | 2.7.18(遗留 Make/Python 脚本) |
| Python 3 | 3.10.12 |
| ARM GCC | 10.3.1Ubuntu `gcc-arm-none-eabi` |
| Newlib | 3.3.0Ubuntu `libnewlib-arm-none-eabi` |
| Git | 2.34.1 |
Python 2.7 已停止安全维护,只用于本地遗留构建脚本,不应作为联网服务环境。
## 构建命令
```bash
cd Ai-Thinker-Open_RTL8710BX_ALIOS_SDK
unset NAME
ulimit -s unlimited
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.venvs/aos-cube-0.5.11-system/bin
./build.sh clean smart_outlet
./build.sh example smart_outlet mk3080 MAINLAND ONLINE 0
```
`/usr/bin` 位于 aos-cube venv 之前,使旧 Makefile 的 `which python` 选择 Python 2`aos` 命令仍从 venv 中找到并由其 Python 3 shebang 启动。`unset NAME` 避免 WSL 主机名环境变量覆盖旧 Makefile 的组件名。
## 验证方法与结果
1. 将编码兼容修复提交到独立 WSL 验证分支。
2. 执行仓库提供的 `./build.sh clean smart_outlet`
3. 执行完整构建命令。
4. 检查外层退出码、AliOS 内层 Make 错误、编译错误和 `build failed`
5. 重复上述干净构建流程两次。
6. 检查产物大小、SHA-256、ELF 符号和 MAP 来源。
两次提交绑定后的干净构建均满足:
- 外层退出码 `0`
- compiler error `0`
- Make error `0`
- `SyntaxError``build failed` 均为 `0`
- 每次日志包含 4 条 warning均为 GNU Make jobserver/并行参数提示。
- 构建前后 Git 工作区保持干净。
最终证据日志:`docs/build-logs/RTL8710BX-smart_outlet-clean3.log`
## 第二次干净构建产物
| 产物 | 字节数 | SHA-256 |
| --- | ---: | --- |
| `out/smart_outlet@mk3080/smart_outlet@mk3080.elf` | 6,313,968 | `1410c192074950a2fb927285cbcf3ce04ee4f02a7246ff1f8dd5d57af21e8e7f` |
| `out/smart_outlet@mk3080/smart_outlet@mk3080.map` | 3,290,249 | `7f5ded68cdf6b67ef430ed44570dcae62dbfc736e53f3e0a4231935057e976af` |
| `out/smart_outlet@mk3080/smart_outlet@mk3080.bin` | 606,392 | `3339d025144990817a93b79b85966e62db4049c033c876a310d658085c600aba` |
| `out/smart_outlet@mk3080/smart_outlet@mk3080.ota.bin` | 606,364 | `c2d6af49997331bbab238e753fa801b1a904a5a002663277661ac09cf95020b7` |
| `out/smart_outlet@mk3080/smart_outlet@mk3080.all.bin` | 1,077,968 | `ad0de1edfe309b989207c9a7f15a3d9b0639d062c988f55665a77b7b7cc4eac4` |
固件包含编译时间与 Git 信息,不同构建的哈希不要求一致;可重复构建在此表示同一提交和环境能够连续完成干净构建并生成完整产物。
## 告警与限制
4 条 warning 均为子 Make 的 jobserver 并行模式提示,没有 C/C++ 编译器 warning。后续可以调整父子 Make 的 `+``-j` 传递方式消除,但不影响本次固件生成。
本验证没有连接真实 RTL8710BX/MK3080 硬件不包含烧录、启动、Wi-Fi、云端、OTA、串口或外设功能验证。