Skip to content

Commit 0ea631f

Browse files
speak-agentSunrisepeak
authored andcommitted
docs: distinguish dependency default opt-out from root CLI features
1 parent 9a25a3a commit 0ea631f

3 files changed

Lines changed: 28 additions & 10 deletions

File tree

‎.agents/skills/mcpp-usage/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ mcpp new --list-templates mcpplibs.mwrap.opencv@5.0.0.1
8989
包模板中的 `{{self.name}}` 是完整包选择器,应用 `"{{self.name}}"` 作为单个依赖 key,
9090
不要放到另一层 namespace 表下。模板必须实际创建、构建、运行,而不只做字符串检查。
9191

92-
feature 是加法并集;消费者当前不能关闭依赖包的默认 features。`--features` 增加能力,不代表排除其他能力。
93-
因此可选大依赖应由包作者显式门控。模块可导入不等于实际后端已启用,窗口/推理/设备能力需分别验证。
92+
feature 是加法并集;消费者可在依赖声明中使用 `default-features = false` 关闭该边的默认集合,
93+
显式 features 仍会启用,其他依赖边的请求不会被取消。根项目没有 `--no-default-features` 命令行选项。
94+
可选大依赖由包作者显式门控。模块可导入不等于实际后端已启用,窗口/推理/设备能力需分别验证。
9495
宏不能经 import 传递;`.macros` 只提供可保持语义的常量/函数映射,原始宏仍需兼容头。
9596

9697
维护规范与包装流程见 [mcpp-index mwrap 规范](https://github.com/mcpplibs/mcpp-index/blob/main/docs/mwrap.md)。

‎docs/06-features-and-capabilities.md‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,19 @@ statement: private keeps the headers off a consumer's search path, and
556556

557557
## Current limitations
558558

559-
**A default feature is turned off in the manifest, not on the command line.**
560-
There is no `--no-default-features`. `mcpp build --features metrics` activates
561-
`default ∪ {metrics}`; building without a member of `default` means editing
562-
`[features] default`. Measured on 2026.9.8.1.
559+
**The root's default features are changed in its manifest.** There is no
560+
`--no-default-features` command-line option. `mcpp build --features metrics`
561+
activates the root's `default ∪ {metrics}`.
562+
563+
A consumer can suppress a dependency's own default set:
564+
565+
```toml
566+
[dependencies]
567+
widget = { version = "1.2.3", default-features = false, features = ["metrics"] }
568+
```
569+
570+
Explicit features still activate. Requests unify across dependency edges: an
571+
edge opting out does not cancel defaults or features another edge requests.
563572

564573
**A dependency cannot be conditioned on the accelerator.** `accelerator` is
565574
resolved from the dependency graph, so a dependency chosen by it would decide

‎docs/zh/06-features-and-capabilities.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,18 @@ provides = ["platform-sdk"]
503503

504504
## 当前边界
505505

506-
**默认 feature 在 manifest 里关掉,不在命令行上关掉。** 没有
507-
`--no-default-features`。`mcpp build --features metrics` 激活的是
508-
`default ∪ {metrics}`;要在不带 `default` 中某个成员的情况下构建,得改
509-
`[features] default`。实测于 2026.9.8.1。
506+
**根项目的默认 feature 在 manifest 中修改。** 没有 `--no-default-features`
507+
命令行选项。`mcpp build --features metrics` 激活根项目的 `default ∪ {metrics}`。
508+
509+
消费者可以关闭依赖包自身的默认集合:
510+
511+
```toml
512+
[dependencies]
513+
widget = { version = "1.2.3", default-features = false, features = ["metrics"] }
514+
```
515+
516+
显式指定的 feature 仍会激活。不同依赖边的请求取并集:某条边关闭默认项,不会取消
517+
另一条边要求的默认项或 feature。
510518

511519
**依赖不能以加速器为条件。** `accelerator` 是从依赖图中解析出来的,因此由它
512520
选择的依赖会决定它自己所问的那个答案。mcpp 会报告该谓词并忽略它。包要么无

0 commit comments

Comments
 (0)