Repository navigation
[enhancement] manifest [features] 支持条件依赖与依赖 feature 转发(dep/feat;挡住 opencv 模块包的 opencv.dnn 接口) #243
Description
Activity
- added 6 commits that reference this issue
on Jul 18, 2026 Status (0.0.98): design finalized — see
.agents/docs/2026-07-19-issue-243-feature-forwarding-design.md. Scoping clarified: feature-conditional deps ALREADY exist ([feature-deps]/ xpkgfeatures.x.deps); the real gap isdep/featforwarding. Implementation is a follow-up PR (0.0.99+) — the #242 work already converged the per-package feature request ontoDependencyEdge/aggregatedRequest, which the forwarding builds on. Keeping open for the impl.- added a commit that references this issue
on Jul 19, 2026 Resolved in mcpp 0.0.99 (released + indexed).
Feature
dep/featforwarding is implemented (Cargo parity). A[features]implied token containing/— or the dedicated table-formforward = ["dep/feat"]key — forwards a feature to a dependency:[features] dnn = { sources = ["src/dnn.cppm"], implies = ["compat.opencv/dnn"] } [dependencies] compat.opencv = { version = "0.0.3", default-features = false }
- One data model
Manifest::featureForwards, two grammars (TOML + xpkg descriptor) sharing a single split pointsplit_feature_forward_token. - Injected into the 0.0.98
aggregatedRequest/DependencyEdgefunnel: the forwarded feature is added to a child's request before it is pushed onto the resolution worklist, so both resolution (mergeActiveFeatureDepspulls the forwarded feature's conditional deps) and activation (recordDependencyEdge→aggregatedRequest→applyemits its defines/sources) observe it. Transitive via the BFS forward edge (root→mid→leaf). - Additive with [enhancement] 消费端 default-features 关闭语法(default = [...] 已有,但退不掉;挡住 compat.ffmpeg 裁剪档形态) #242
default-features = false; consistent onmcpp buildandmcpp test. Forward to an undeclared dep → strict error / warning; undefined dep feature reuses the existing does-not-declare gate.
Verification: 3 unit tests + e2e
128_feature_forwarding.sh(transitive tree, both build/test paths); the released 0.0.99 binary installed via xlings passes the forwarding e2e end-to-end. PR #246, design.agents/docs/2026-07-19-v0.0.99-feature-forwarding-238-230-design.md.- One data model
- added a commit that references this issue
on Jul 19, 2026
诉求
mcpp.toml(manifest)侧的
[features]目前支持 sources/implies/defines,但不支持:
features.x.deps,manifest 侧没有对应物);
dep/feat语法对应物):features.dnn = { deps-features = { "compat.opencv" = ["dnn"] } }之类。场景(opencv-m 的 opencv.dnn 模块接口,mcpp-index PR #79 后续)
compat.opencv 已带
dnnfeature(+309 TU)。opencv 模块包想提供import opencv.dnn;,理想形态:消费端
opencv = { version = "0.0.3", features = ["dnn"] }→ 模块包启用dnn.cppm 源 + 依赖的 compat.opencv 以 features=["dnn"] 解析。没有 (2),
模块包只能永远全量拉 dnn(所有消费者多 300 TU)或不提供 dnn 模块接口。
环境
mcpp 0.0.97