Skip to content

Commit 1143154

Browse files
committed
docs: a toolchain named by path is recorded beside the build, and mcpp.lock is not claimed to hold it
The chapter, its mirror, SPEC-006 and the release notes said a build records such a toolchain in mcpp.lock as `local`. It does not: the lock holds the result of dependency resolution, a toolchain is not a resolved dependency, and nothing in this branch writes one there. What is true is that the driver and each stated tool enter the fingerprint and are recorded beside the build, so the fast paths decline once one of them changed, and a machine without the tree is refused where the declaration is read. The design record states the correction.
1 parent 6193d62 commit 1143154

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

‎.agents/docs/2026-10-01-tool-and-toolchain-sources-design.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ cfg 文件是否存在。
105105
`local-toolchain.stamp` 供三条快速路径比较。不读字节:一个驱动几百 MB,而每次 prepare 都要
106106
读它。
107107

108+
**`mcpp.lock` 不记工具链**,本次也没有加。lock 的内容是依赖解析的结果,而工具链不是被解析
109+
的依赖;一台没有这棵树的机器在读到声明处就被拒绝,这已经是「不可移植」要的那句话。设计稿
110+
曾写成「lock 中记为 `local`」,那是没有实现的断言,文档与规范按实际行为更正。
111+
108112
### 2.6 工具链阶段:两遍 prepare,第一遍不说话
109113

110114
构建程序需要它的宿主模块,宿主模块来自依赖图;而依赖图的解析需要工具链

‎CHANGELOG.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ unchanged.
3333
sysroot, family, launcher, tools }`, or `MCPP_TOOLCHAIN=path:<dir>`. mcpp
3434
probes the drivers in the tree, identifies them, drives them with its own
3535
link model, and writes nothing into the tree. The driver and each stated tool
36-
enter the fingerprint by content, the fast paths decline when one changed,
37-
and `mcpp.lock` records the toolchain as `local`.
36+
enter the fingerprint by content, and a build records them beside its output,
37+
so the fast paths decline once one of them changed.
3838
- **`[toolchain] bootstrap`** names the toolchain that compiles and runs build
3939
programs when it should not be the one building the project.
4040
- **`[toolchain] <key> = { configure = "build.mcpp" }`** hands the build

‎docs/20-toolchains.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,10 @@ mcpp's own file, and a tree mcpp does not own does not get one.
409409

410410
**Identity.** The driver and each tool named by `tools` enter the build's
411411
fingerprint by path, size and modification time, so rebuilding the toolchain in
412-
place rebuilds what it produced. A build that used one records it in
413-
`mcpp.lock` as `local`: a machine without that toolchain is told so by name
414-
rather than building with another one.
412+
place rebuilds what it produced, and a build records them beside its output so
413+
the fast paths decline once one of them changed. A machine that does not have
414+
the tree is told so by name — the declaration is refused where it is read —
415+
rather than building with another toolchain.
415416

416417
This is not the `system` compiler of the section above. `system` is whatever
417418
`PATH` happens to hold; this is a tree the project names, that mcpp identifies

‎docs/specs/toolchain-management.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- **禁止**写入该目录树(它不是 mcpp 管理的);
5757
- 把驱动与 `tools` 所列每个程序的身份(路径、大小、修改时间)纳入指纹与快速路径的判定,
5858
因为这样的工具链可以原地改变;
59-
- 在 `mcpp.lock` 中记为 `local`,即不可移植;
59+
- 把它们记在该次构建的产物旁,使快速路径在其中之一改变后让行;
6060
- 在构建输出、`resolution.json` 与 `mcpp why toolchain` 中陈述其来源(§3.3)。
6161

6262
`[toolchain] bootstrap = "<族>@<版本>"` 命名编译并运行构建程序的工具链;未写时按 §3 的

‎docs/zh/20-toolchains.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ MCPP_TOOLCHAIN=path:/opt/llvm-trunk mcpp build
383383
mcpp 自己的文件,而一棵不属于 mcpp 的树不会得到一份。
384384

385385
**身份。** 驱动与 `tools` 点名的每个程序以路径、大小与修改时间进入构建指纹,因此原地重建
386-
工具链会重建它产出的东西。用过它的构建在 `mcpp.lock` 中记为 `local`:没有这个工具链的
387-
机器会被点名告知,而不是改用另一个构建。
386+
工具链会重建它产出的东西;构建还把它们记在产物旁边,于是其中之一改变后快速路径会让行。
387+
没有这棵树的机器会被点名告知——声明在被读取的地方就被拒绝——而不是改用另一个工具链。
388388

389389
这不是上一节的 `system` 编译器。`system` 是「`PATH` 上碰巧有什么」,而这里是工程点名的
390390
一棵树,由 mcpp 识别并记录,与 `msvc@system` 一直以来的形状相同。

0 commit comments

Comments
 (0)