diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 90794d9..2a1dc57 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,7 +8,7 @@ - Added the supplied 80-byte CW2017 profile for the specified 520 mAh cell, including content/update-flag checks, verified writes, the required restart sequence, and bounded SOC-readiness polling. -- Expanded the environment bootstrap document: added Espressif's Git service mirror (`git.espressif.com.cn`) as the preferred mainland-China route for ESP-IDF v5.5.3 and its submodules, documented submodule long-wait/timeout handling and in-place repair, warned about stale per-repository Jihulab `insteadOf` residue, and added the official offline release archive as a last-resort fallback (learned from `esp-mosaico/esp-mosaico-vibe`). +- Expanded the environment bootstrap document: added Espressif's Git service mirror (`git.espressif.com.cn`) as the preferred mainland-China route for ESP-IDF v5.5.3 and its submodules, documented submodule long-wait/timeout handling, in-place repair, and the pinned-commit shallow fetch for large submodules such as `esp32-wifi-lib`, warned about stale per-repository Jihulab `insteadOf` residue, and added the official offline release archive as a last-resort fallback (learned from `esp-mosaico/esp-mosaico-vibe`). - Reorganized the documentation by function area with a dual entry point: the root `AGENTS.md` is now a thin router (hard constraints + task routing only) and the detailed AI workflow lives in `docs/development/ai-guide.md`; `agent-guide.md` was folded in. `docs/development/` gained a second level (`engineering/`, `ci/`, `release/`), and the `plays/` application archive and `experiences/` moved into a `docs/reference/` area with a dedicated README. Removed `docs/software-design/` (empty scaffold); folded the three `assets/{fonts,images,music}/README` leaves into the `assets/` README; flattened the six `project-completion` sub-documents into a single file; and unified each directory to a single README, eliminating every `INDEX` file and a duplicated experience index. All cross-references and bibliographic links were updated; no content was dropped. diff --git a/docs/CHANGELOG.zh_CN.md b/docs/CHANGELOG.zh_CN.md index 728d6e9..60ff6e8 100644 --- a/docs/CHANGELOG.zh_CN.md +++ b/docs/CHANGELOG.zh_CN.md @@ -8,7 +8,7 @@ - 加入厂家为优特利 520mAh 电芯生成的 80 字节 CW2017 profile,并实现内容与更新标志检查、写入后校验、规定的重启时序以及有上限的 SOC 就绪等待。 -- 扩充环境引导文档:新增乐鑫 Git 服务镜像(`git.espressif.com.cn`)作为中国大陆首选线路,覆盖 ESP-IDF v5.5.3 及其子模块;补充子模块长等待/超时处理与原地修复;提示按仓库残留的 Jihulab `insteadOf` 旧配置;并把官方离线 release 压缩包加入兜底方案(经验来自 `esp-mosaico/esp-mosaico-vibe`)。 +- 扩充环境引导文档:新增乐鑫 Git 服务镜像(`git.espressif.com.cn`)作为中国大陆首选线路,覆盖 ESP-IDF v5.5.3 及其子模块;补充子模块长等待/超时处理、原地修复,以及 `esp32-wifi-lib` 等大仓的按钉死 commit 浅取;提示按仓库残留的 Jihulab `insteadOf` 旧配置;并把官方离线 release 压缩包加入兜底方案(经验来自 `esp-mosaico/esp-mosaico-vibe`)。 - 按功能域整理文档并采用双入口:根目录 `AGENTS.md` 变为薄路由(只保留硬约束与任务路由),详细的 AI 开发工作流下沉到 `docs/development/ai-guide.md`,`agent-guide.md` 并入其中。为 `docs/development/` 增加二级分区(`engineering/`、`ci/`、`release/`),把 `plays/` 应用档案与 `experiences/` 移入带专属 README 的 `docs/reference/` 参考区;删除 `docs/software-design/`(空脚手架);把 `assets/{fonts,images,music}/README` 三个叶子 README 并入 `assets/` README;把 `project-completion` 的六个子文档压平为单文件;并把每个目录统一为单一 README,消除所有 `INDEX` 文件与一处重复经验索引。所有交叉引用与文献链接已更新;未丢弃任何内容。 diff --git a/docs/development/engineering/environment-setup.md b/docs/development/engineering/environment-setup.md index 68c0555..503f4c0 100644 --- a/docs/development/engineering/environment-setup.md +++ b/docs/development/engineering/environment-setup.md @@ -232,6 +232,46 @@ Keep the checkout clean before running `install.sh`; `idf.py` ignores uninitialized submodules differently across versions and a partially updated tree produces confusing compile errors. +### Large submodule fixes + +`components/esp_wifi/lib` resolves to `espressif/esp32-wifi-lib`, a large +prebuilt repository, and a full fetch of it commonly exceeds any reasonable +wait limit. Do not retry the full fetch repeatedly on a short wait; fetch only +the pinned commit instead: + +1. Read the exact commit `esp-idf` pins for that path: + +```bash +git -C "${AI_PASSPORT_IDF_ROOT}" ls-tree HEAD components/esp_wifi/lib +# 160000 commit components/esp_wifi/lib +``` + +2. Remove the partial directory and fetch that single commit shallowly: + +```bash +git -C "${AI_PASSPORT_IDF_ROOT}" rm -rf components/esp_wifi/lib +mkdir -p "${AI_PASSPORT_IDF_ROOT}/components/esp_wifi/lib" +cd "${AI_PASSPORT_IDF_ROOT}/components/esp_wifi/lib" +git init +git remote add origin https://github.com/espressif/esp32-wifi-lib.git +git fetch --depth 1 origin +git checkout FETCH_HEAD +``` + +3. Let `git submodule update --init` record the checkout, then verify: + +```bash +git -C "${AI_PASSPORT_IDF_ROOT}" submodule update --init components/esp_wifi/lib +git -C "${AI_PASSPORT_IDF_ROOT}" status --short +``` + +Do not use `git submodule update --depth=1 ` for these pins: it fetches +only the default-branch tip and fails with +`Unable to find current revision in submodule path` when the pinned commit is +not the tip. For any remaining path that stays dirty after the ordinary repair, +run `git submodule deinit -f ` first, then `update --init` again. Always +use the paths printed by the latest `git status`; do not copy example paths. + ### Offline archives as a last resort If every source is unreachable after repeated attempts, the official Espressif diff --git a/docs/development/engineering/environment-setup.zh_CN.md b/docs/development/engineering/environment-setup.zh_CN.md index feb2ba0..12afd39 100644 --- a/docs/development/engineering/environment-setup.zh_CN.md +++ b/docs/development/engineering/environment-setup.zh_CN.md @@ -198,6 +198,44 @@ git -C "${AI_PASSPORT_IDF_ROOT}" status --short 运行 `install.sh` 前保持 checkout 干净;各版本 `idf.py` 对未初始化子模块的 处理不同,部分更新的目录树会产生难以定位的编译错误。 +### 大仓子模块修复 + +`components/esp_wifi/lib` 对应 `espressif/esp32-wifi-lib`,是体积很大的 +预编译仓库,全量拉取通常超过任何合理等待上限。不要在短等待下反复重试全量 +拉取,改为只取钉死的那个 commit: + +1. 读取 `esp-idf` 为该路径钉死的 commit: + +```bash +git -C "${AI_PASSPORT_IDF_ROOT}" ls-tree HEAD components/esp_wifi/lib +# 160000 commit components/esp_wifi/lib +``` + +2. 删除部分目录,按该 commit 浅取: + +```bash +git -C "${AI_PASSPORT_IDF_ROOT}" rm -rf components/esp_wifi/lib +mkdir -p "${AI_PASSPORT_IDF_ROOT}/components/esp_wifi/lib" +cd "${AI_PASSPORT_IDF_ROOT}/components/esp_wifi/lib" +git init +git remote add origin https://github.com/espressif/esp32-wifi-lib.git +git fetch --depth 1 origin +git checkout FETCH_HEAD +``` + +3. 让 `git submodule update --init` 登记该 checkout,再核验: + +```bash +git -C "${AI_PASSPORT_IDF_ROOT}" submodule update --init components/esp_wifi/lib +git -C "${AI_PASSPORT_IDF_ROOT}" status --short +``` + +对这些钉死路径不要使用 `git submodule update --depth=1 `:它只浅拉 +默认分支 tip,当钉死的 commit 不是 tip 时会报 +`Unable to find current revision in submodule path`。普通修复后仍然 dirty 的 +路径,先执行 `git submodule deinit -f ` 再 `update --init`。路径一律取 +本次 `git status` 打印的实际值,不要照抄示例路径。 + ### 离线压缩包兜底 重复尝试后所有源都不可达时,乐鑫官方 release 归档是一次完整 checkout 快照