Repository navigation
Commit 4e2b476
committed
build.mcpp: a build program is told which package it is building
Found by self-review of the module surface. Every name a rule package
generates is derived from the package's name -- the module a consumer
imports, the namespace the accessors sit in, the symbols in a generated
header -- and nothing in the build-program contract answered that
question. The closest available answer was the leaf of MCPP_MANIFEST_DIR,
which is a directory name.
The two differ whenever a project lays a package out under a generic
folder, and `mcpp.rules.spirv` was measurably wrong there:
`examples/09-heterogeneous/vulkan/app/` declares `name = "vulkan-saxpy"`
and generated `app.shaders`, so every `<something>/app/` in a workspace
claimed one module. A user-facing name derived from a folder is also a
name that changes when a folder is renamed.
MCPP_PKG_NAME and MCPP_PKG_NAMESPACE, with `mcpp::package_name()` and
`mcpp::package_namespace()` reading them. Set at both sites that build a
BuildProgramEnv -- the dependency loop and the root; those two are the
whole enumeration.
The e2e distinguishes the two derivations by construction: the fixture's
directory is `app` and its package is `vulkan-saxpy`, so an implementation
that still read the directory writes `app` where the assertion expects
`vulkan-saxpy`. A fixture whose name matched its folder would pass either
way, which is what every existing one did.1 parent 77d4918 commit 4e2b476
6 files changed
Lines changed: 113 additions & 0 deletions
File tree
- docs
- zh
- src/build
- tests/e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
| 662 | + | |
| 663 | + | |
662 | 664 | | |
663 | 665 | | |
664 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| 566 | + | |
| 567 | + | |
566 | 568 | | |
567 | 569 | | |
568 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
522 | 528 | | |
523 | 529 | | |
524 | 530 | | |
| 531 | + | |
| 532 | + | |
525 | 533 | | |
526 | 534 | | |
527 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
378 | 393 | | |
379 | 394 | | |
380 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8133 | 8133 | | |
8134 | 8134 | | |
8135 | 8135 | | |
| 8136 | + | |
| 8137 | + | |
8136 | 8138 | | |
8137 | 8139 | | |
8138 | 8140 | | |
| |||
9059 | 9061 | | |
9060 | 9062 | | |
9061 | 9063 | | |
| 9064 | + | |
| 9065 | + | |
9062 | 9066 | | |
9063 | 9067 | | |
9064 | 9068 | | |
| |||
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
0 commit comments