docs(mcp): 非生产环境默认推荐启用 ASan,ASan/非 ASan 切换需 --rebuild-includes
- protocol.md 新增 5.8 ASan 推荐:非生产环境 --asan 捕获内存错误,生产环境不启用 - 明确 ASan 与非 ASan 共享 includes.binary 缓存会互相污染(undefined symbol: __asan_*),切换必须重建缓存 - README/tools.json 同步更新 asan 字段描述
This commit is contained in:
1 parent
004121de40
commit
4640211e3c
3 files changed
+15
-4
No files matched your search
+2
-1
@@ -64,4 +64,5 @@ MCP 服务器(`transpyc-tools`)以 stdio 方式运行于项目根目录:
|
||||
- 编译输出仅返回**末尾 N 行**(默认 50),避免长日志污染上下文
|
||||
- 同一工程目录禁止并行编译(temp/output 冲突)
|
||||
- TPC 编译错误 **fail-fast**:立即返回错误,不静默兜底
|
||||
- 修改 TPV `.vp` 源码后必须清缓存 + Phase A 全量重建才生效(SHA1 缓存复用旧 .ll)
|
||||
- 修改 TPV `.vp` 源码后必须清缓存 + Phase A 全量重建才生效(SHA1 缓存复用旧 .ll)
|
||||
- 非生产环境默认推荐 `--asan`;ASan/非 ASan 切换必须 `--rebuild-includes` 重建 includes.binary 缓存
|
||||
+9
-1
@@ -101,6 +101,14 @@ TPC 编译错误必须立即终止并原样返回错误(traceback 风格),
|
||||
- `llc`(LLVM 静态编译器)、`clang++`(mingw-w64 链接器)须在 PATH
|
||||
- TPV 运行时需 **≥ 1 GiB 空闲内存**(启动时 `malloc(1<<30)` 内存池)
|
||||
- ASan 模式(`--asan`)需 clang64 环境
|
||||
|
||||
### 5.8 ASan 推荐(非生产环境默认启用)
|
||||
|
||||
默认**非生产环境**(开发/测试/回归)推荐启用 ASan:`--asan`(opt -passes=asan 插桩 + 链接 -fsanitize=address),
|
||||
可捕获越界读写、use-after-free 等运行时内存错误;**生产环境不启用**(性能与体积开销)。
|
||||
|
||||
注意:ASan 与非 ASan 构建共享 includes.binary 缓存时会互相污染(ASan 插桩 obj 在普通链接下报 `undefined symbol: __asan_*`),
|
||||
**切换模式必须 `--rebuild-includes` 重建缓存**。
|
||||
---
|
||||
|
||||
## 6. 工具详细定义
|
||||
@@ -123,7 +131,7 @@ TPC 编译错误必须立即终止并原样返回错误(traceback 风格),
|
||||
"phase": {"type": "string", "enum": ["1", "2", "all"], "default": "all", "description": "阶段:1=声明生成,2=翻译+编译,all=全部"},
|
||||
"rebuild_includes": {"type": "boolean", "default": false, "description": "删除 includes.binary 并重编译 includes"},
|
||||
"clear_cache": {"type": "boolean", "default": false, "description": "清除全局 .transpyc_cache"},
|
||||
"asan": {"type": "boolean", "default": false, "description": "ASan 插桩模式"},
|
||||
"asan": {"type": "boolean", "default": false, "description": "ASan 插桩(非生产环境推荐启用)"},
|
||||
"nowarn_register": {"type": "boolean", "default": false, "description": "抑制外部函数返回类型未登记 WARN"},
|
||||
"src": {"type": "string", "description": "覆盖 source_dir"},
|
||||
"temp": {"type": "string", "description": "覆盖 temp_dir"},
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
},
|
||||
"asan": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
"default": false,
|
||||
"description": "ASan 插桩(非生产环境推荐启用)"
|
||||
},
|
||||
"nowarn_register": {
|
||||
"type": "boolean",
|
||||
@@ -119,7 +120,8 @@
|
||||
},
|
||||
"asan": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
"default": false,
|
||||
"description": "ASan 插桩(非生产环境推荐启用)"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
Reference in new issue
Block a user