Skip to content

Commit 4395dc6

Browse files
authored
mcpp:plugins 0.3.0 —— 嵌入载荷用 import 到达,以及规则包自带语言 (#367)
一份嵌入载荷现在由 `import` 到达,而不是 include 一个规则挑名字的头文件。 模块根取自 `[package] name`,访问器取自文件的 stem 与 stage,组基准目录以下 的子目录成为命名空间段 —— 于是两个同 stem 的 shader 是两份载荷而不是一次冲突。 工程里没有任何一行写出生成物的名字。 两个新成员: rules-slang Slang 是一门语言而不是 GLSL 的第二个驱动。`.slang` **不在** 引擎的设备源扩展名表里(任何版本都不在),这个 feature 自己声明 `device_extensions` 与 `rule_module`,引擎据此路由。这就是整个 安排的判据:一门新设备语言不需要引擎发版。 tools-island 生成设备岛的 `extern "C"` 边界 —— 它的编译器读的头文件,和 C++ 侧 import 的模块,来自标在定义处的声明。把 seam 的两个半边 都交给它时,两个把同一个名字声明得不一样的定义会被拒绝:两者永不 同链且 C 链接不做名字修饰,所以那是两份文本唯一同时在场的地方。 文档化的下界移到 2026.9.7.1,也就是读这两个键的那一版。低于它的客户端不会得到 一个降级的表面,而是得到一次「规则从不路由」的构建 —— 文件掉进普通源集,mcpp 说 它对这个扩展名没有角色。 `latest` 的三行是**替换**而不是新增:Lua 表构造器对重复键取最后一次赋值,第二个 `["latest"]` 会让它退回上一版,而每个精确 pin 仍然正确,所以只有不带版本的 `mcpp add` 会拿到旧包。 发布前对着已发布的 2026.9.7.1 二进制跑过四组:模块表面工程、同一个工程但完全没有 `build.mcpp`、一个 `.slang` 工程**以及去掉规则 feature 后同一个文件被拒绝**、 object 存储(字在 `.incbin` 载荷里而不在任何头文件里)。18 条断言,0 失败。 CN 资产与 GitHub 归档逐字节相同,所以一个 sha256 同时命名两边。
1 parent a47e294 commit 4395dc6

1 file changed

Lines changed: 67 additions & 7 deletions

File tree

‎pkgs/m/mcpp.plugins.lua‎

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,47 @@
22
-- each member selected by a feature.
33
--
44
-- [dependencies.mcpp]
5-
-- plugins = { version = "0.2.6", features = ["rules-spirv"], host-module = true }
5+
-- plugins = { version = "0.3.0", features = ["rules-spirv"], host-module = true }
66
--
77
-- // build.mcpp
88
-- import mcpp;
99
-- import mcpp.rules.spirv;
1010
--
11-
-- Members of 0.2.6, with the mcpp release each relies on:
11+
-- 0.3.0 is the release in which an embedded payload is reached by IMPORTING a
12+
-- module rather than by including a header whose name the rule chose. It also
13+
-- adds two members and the two declarations that let a rule package introduce a
14+
-- device language on its own. It requires **mcpp 2026.9.7.1**, which is where
15+
-- those declarations are read.
16+
--
17+
-- mcpp.rules.slang `rules-slang` >= 2026.9.7.1. Slang is a language rather
18+
-- than a second driver for GLSL -- its own
19+
-- module system, generics, and targets
20+
-- beyond SPIR-V -- so it has its own rule
21+
-- and its own extension. `.slang` is NOT in
22+
-- the engine's built-in table: this feature
23+
-- declares `device_extensions = [".slang"]`
24+
-- and `rule_module = "mcpp.rules.slang"`,
25+
-- and the engine routes it from there. That
26+
-- is the criterion for the whole
27+
-- arrangement -- a new device language costs
28+
-- no engine release
29+
-- mcpp.tools.island `tools-island` >= 2026.9.7.1. Generates the `extern "C"`
30+
-- boundary a device island is reached
31+
-- across: the header its compiler reads and
32+
-- the module the C++ side imports, from
33+
-- declarations marked where they are
34+
-- defined. Handed both halves of a seam, it
35+
-- refuses two that declare one name
36+
-- differently -- the only check available at
37+
-- a boundary where C linkage does not mangle
38+
-- and the two halves never meet at the link
39+
--
40+
-- Every rule that generates a consumer-facing declaration now chooses a module
41+
-- interface or a header from `[language] modules`, which the engine reports; and
42+
-- a project that declares its rules needs no `build.mcpp` at all, because mcpp
43+
-- writes the program those declarations describe.
44+
--
45+
-- Members of 0.3.0, with the mcpp release each relies on:
1246
--
1347
-- mcpp.rules.cuda `rules-cuda` >= 2026.9.5.2
1448
-- mcpp.rules.spirv `rules-spirv` >= 2026.9.5.3; since 0.2.0 it drives glslc
@@ -174,8 +208,13 @@
174208
-- adds the engine's half -- a device source that reached no action is refused,
175209
-- naming the file -- but a rule package does not require it to work.
176210
--
177-
-- The floor is the HIGHEST of those, and from 0.2.4 every member shares one:
178-
-- 2026.9.6.6. It is DOCUMENTATION rather than a gate -- nothing in this
211+
-- The floor is the HIGHEST of those, and from 0.3.0 every member shares one:
212+
-- 2026.9.7.1 -- the release that reads `device_extensions` and `rule_module`,
213+
-- reports `[language] modules` and the package's own name to a build program,
214+
-- and writes the build program a declared rule set describes. A client below it
215+
-- does not see a degraded surface, it sees the rules never route: the file falls
216+
-- through to the ordinary source scan and mcpp says it has no role for the
217+
-- extension. It is DOCUMENTATION rather than a gate -- nothing in this
179218
-- descriptor or in the package's manifest records a per-package engine floor,
180219
-- and the index-level `min_mcpp` is deliberately not raised for a package
181220
-- (raising it would make the whole index unreadable to clients stopped below
@@ -209,6 +248,13 @@ package = {
209248

210249
xpm = {
211250
linux = {
251+
["0.3.0"] = {
252+
url = {
253+
GLOBAL = "https://github.com/mcpp-community/mcpp-plugins/archive/refs/tags/v0.3.0.tar.gz",
254+
CN = "https://gitcode.com/mcpp-res/mcpp-plugins/releases/download/0.3.0/mcpp-plugins-0.3.0.tar.gz",
255+
},
256+
sha256 = "c4ce00e2b79c43ee4a08a8876a8ab7113f41081895a6036dfede6aa7719d731b",
257+
},
212258
["0.2.6"] = {
213259
url = {
214260
GLOBAL = "https://github.com/mcpp-community/mcpp-plugins/archive/refs/tags/v0.2.6.tar.gz",
@@ -272,9 +318,16 @@ package = {
272318
},
273319
sha256 = "adf1f9d6691a5d05a8a4a94e83c733ea39caee1510ce2c9af4cb23bebabea9f5",
274320
},
275-
["latest"] = { ref = "0.2.6" },
321+
["latest"] = { ref = "0.3.0" },
276322
},
277323
macosx = {
324+
["0.3.0"] = {
325+
url = {
326+
GLOBAL = "https://github.com/mcpp-community/mcpp-plugins/archive/refs/tags/v0.3.0.tar.gz",
327+
CN = "https://gitcode.com/mcpp-res/mcpp-plugins/releases/download/0.3.0/mcpp-plugins-0.3.0.tar.gz",
328+
},
329+
sha256 = "c4ce00e2b79c43ee4a08a8876a8ab7113f41081895a6036dfede6aa7719d731b",
330+
},
278331
["0.2.6"] = {
279332
url = {
280333
GLOBAL = "https://github.com/mcpp-community/mcpp-plugins/archive/refs/tags/v0.2.6.tar.gz",
@@ -338,9 +391,16 @@ package = {
338391
},
339392
sha256 = "adf1f9d6691a5d05a8a4a94e83c733ea39caee1510ce2c9af4cb23bebabea9f5",
340393
},
341-
["latest"] = { ref = "0.2.6" },
394+
["latest"] = { ref = "0.3.0" },
342395
},
343396
windows = {
397+
["0.3.0"] = {
398+
url = {
399+
GLOBAL = "https://github.com/mcpp-community/mcpp-plugins/archive/refs/tags/v0.3.0.tar.gz",
400+
CN = "https://gitcode.com/mcpp-res/mcpp-plugins/releases/download/0.3.0/mcpp-plugins-0.3.0.tar.gz",
401+
},
402+
sha256 = "c4ce00e2b79c43ee4a08a8876a8ab7113f41081895a6036dfede6aa7719d731b",
403+
},
344404
["0.2.6"] = {
345405
url = {
346406
GLOBAL = "https://github.com/mcpp-community/mcpp-plugins/archive/refs/tags/v0.2.6.tar.gz",
@@ -404,7 +464,7 @@ package = {
404464
},
405465
sha256 = "adf1f9d6691a5d05a8a4a94e83c733ea39caee1510ce2c9af4cb23bebabea9f5",
406466
},
407-
["latest"] = { ref = "0.2.6" },
467+
["latest"] = { ref = "0.3.0" },
408468
},
409469
},
410470

0 commit comments

Comments
 (0)