docs(engineering): 补充 ccache 提速与工具链安装排障

- 记录 IDF_CCACHE_ENABLE / CONFIG_IDF_BUILD_USE_CCACHE 加速重复编译
- 说明 export.sh 需 source 而非 ./ 执行、自定义 IDF_TOOLS_PATH 每次重设
- 增加工具链安装失败恢复:清理 ~/.espressif/dist、macOS 证书包、
  Apple Silicon Rosetta 2、Windows 杀毒扫描排除
- 经验来自 esp-mosaico/esp-mosaico-vibe,双语同步更新
This commit is contained in:
Shinku committed 2026-09-09 10:15:12 +08:00
1 parent df3990726e
commit 3bacd66efd
6 files changed
+113

No files matched your search

@@ -173,6 +173,40 @@ printf 'IDF_PATH=%s\n' "${IDF_PATH}"
Stop if the reported version is not exactly `ESP-IDF v5.5.3`. Do not generate
project configuration with another version.
Activation is shell-scoped: run `export.sh` with a leading dot (or `source`),
never as `./export.sh`, which spawns a subshell and leaves the current shell
unconfigured (`IDF_PATH is not set` or `idf.py: command not found` afterward).
If a custom `IDF_TOOLS_PATH` was used during install, set it again before every
`export.sh` call — the script does not remember it from an earlier session.
### Toolchain install failures
`install.sh` fetches toolchains themselves from the same mirror nodes. When it
fails at a checksum mismatch or a corrupted download, clear the cache and
retry:
```bash
rm -rf ~/.espressif/dist
"${AI_PASSPORT_IDF_ROOT}/install.sh" esp32c3
```
On macOS, a certificate error (`[SSL: CERTIFICATE_VERIFY_FAILED]`) is usually a
missing Python certificate bundle; run
`Install Certificates.command` from the Python installation directory, then
retry. On Apple Silicon, `bad CPU type in executable` or
`tool xtensa-esp32-elf has no installed versions` means the toolchain binary is
x86-64 and needs Rosetta 2:
```bash
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
```
On Windows the official ESP-IDF Tools Installer already handles mirrors and
caching; if a manual install still fails at a corrupted archive, the partially
downloaded files live under `%USERPROFILE%\.espressif\dist` — delete that
folder, set `IDF_GITHUB_ASSETS` in the same session as `install.bat`, and
retry.
For mainland China, optionally accelerate Managed Component archives in the
current terminal: