Comparing main...fix/self-contained-generated-header · mcpp-community/mcpp-plugins · GitHub
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mcpp-community/mcpp-plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: mcpp-community/mcpp-plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/self-contained-generated-header
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Sep 7, 2026

  1. fix(spirv): 生成的头必须能被单独 include

    沙箱里一个把生成头放在第一行的程序:
    
        tri_vert.h:3:7: error: 'uint32_t' does not name a type
    
    glslc 那条路早就是自包含的 —— 它发的是初始化列表,所以规则本来就要在外面写声明,顺手
    写了 `#pragma once` 与 `#include <cstdint>`。glslang 那条路发的是**完整的 C 声明**,
    于是规则什么都不写,而那个文件点名 `uint32_t` 却什么都不 include。
    
    **两个编译器产出「等价的头」正是这条规则可以在它们之间选择的前提**,而「等价」必须包括
    这一条。此前每个能用的消费者都在它前面放了一个 Vulkan 头,所以一个不完整的头读起来一直
    像是好的 —— 直到有人第一个 include 它。
    
    改成两条路同一个形状:编译器写 `<base>.inc`,规则写 `<base>.h`。
    
    判据是 spirv-consumer 的 `src/main.cpp`:生成的头是**第一个** include,`<cstdint>`
    不再放在它前面 —— 放在前面就是替这个头满足了编译器,而那正好盖住要测的性质。实测:把
    `#include <cstdint>` 从生成器里拿掉,这条当场变红。
    Sunrisepeak committed Sep 7, 2026
    Configuration menu
    Copy the full SHA
    b9d550f View commit details
    Browse the repository at this point in the history
  2. ci: 给「每条规则都为本宿主编译过」这条判据补它自己的分母

    这个夹具断言的是「**每一条**规则都编译过」,而「每一条」是它自己carry的一张清单 ——
    于是给这个包加第七个成员时,一条名字说它已经被覆盖的步骤会继续绿。
    
    所以在构建之前先把那张清单与包自己的 `[features]` 比一次,两者必须相等。
    
    实测两条腿:相等时通过;从夹具里删掉 `rules-hip` 当场变红。
    Sunrisepeak committed Sep 7, 2026
    Configuration menu
    Copy the full SHA
    def1ef9 View commit details
    Browse the repository at this point in the history
  3. 0.2.6

    Sunrisepeak committed Sep 7, 2026
    Configuration menu
    Copy the full SHA
    af7c9d6 View commit details
    Browse the repository at this point in the history
Loading