examples: each one writes the rule edge and nothing else by Sunrisepeak · Pull Request #585 · mcpp-community/mcpp · GitHub
Skip to content

examples: each one writes the rule edge and nothing else - #585

Merged
Sunrisepeak merged 5 commits into
mainfrom
feat/examples-drop-repeated-payloads
Sep 7, 2026
Merged

examples: each one writes the rule edge and nothing else#585
Sunrisepeak merged 5 commits into
mainfrom
feat/examples-drop-repeated-payloads

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Follows mcpp 2026.9.6.6 and mcpp:plugins@0.2.4. Those two are why this is a
second PR on this repository rather than part of #584: the examples resolve
plugins from the index, and the version that declares its own payloads had to
be published first.

The examples now write what a user writes

Twenty-five declaration lines leave the manifests — cuda 5, hip 7, sycl 5,
multi-backend 6, cann 1, vulkan 1. Each example keeps the rule edge and nothing
else:

[build-dependencies.mcpp]
plugins = { version = "0.2.4", features = ["rules-cuda"], host-module = true }

The line count of an example is the line count a user copies, which is what
makes this the readable half of the change.

Three lines stay, and the reasons are the boundary

line why
xim:mesa-lavapipe (vulkan, multi-backend) a device, not a build tool. A rule declaring it would force a software renderer onto every consumer that has a GPU. A rule declares what it needs to compile; a project declares what it needs to run
xim:cuda-nvcc (multi-backend only) the repository's single demonstration of the override. The ecosystem needs exactly one place showing the escape hatch; more would be noise

The compat:* runtime adapters all stay too, for a structural reason worth
stating once: the plugins package is reached through a [build-dependencies]
edge, so its own [dependencies] deliberately do not reach the consumer's
target. "Plugins bring their own environment" covers the xim payload half, and
that limit is now written in the plugins manifest, its README and here.

Also here

The bootstrap pin moves to 2026.9.6.6 — CI now bootstraps from the release this
work produced, which is the first thing that exercises it.

规则包在 0.2.4 起自带它驱动的载荷,所以示例里那些 `[xlings.workspace]` 块是
在重复规则已经知道的事 —— 一份会悄悄过期的副本,因为规则会动而这些工程不会。

删掉的行就是使用者不必再写的行:cuda 五条、hip 七条、sycl 五条、cann 一条、
vulkan 一条、multi-backend 六条。

留下的两类,各有理由:

- `xim:mesa-lavapipe`(vulkan 与 multi-backend):它是**设备**不是构建工具。
  规则声明它会给每一个有 GPU 的消费者强加一个软件渲染器。规则声明它编译时
  用的,工程声明它运行时跑在上面的。
- `xim:cuda-nvcc`(仅 multi-backend 一行):整个仓库唯一一处覆盖示范。留着
  是为了让例外路径可见——离产物更近的声明赢,只装一个版本,而不满足规则所述
  下界的钉会被拒绝并点出两侧。

`compat:*` 运行期适配器全部保留:插件是一条 `[build-dependencies]` 边,它自己的
`[dependencies]` 有意不到达消费者的 target。

需要 mcpp 2026.9.6.6 与 mcpp:plugins 0.2.4。
@Sunrisepeak
Sunrisepeak merged commit 8135804 into main Sep 7, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants