Skip to content

ci: enforce the name equality rules/mcpp.toml calls load-bearing - #7

Merged
Sunrisepeak merged 1 commit into
mainfrom
ci/enforce-name-module-equality
Aug 29, 2026
Merged

ci: enforce the name equality rules/mcpp.toml calls load-bearing#7
Sunrisepeak merged 1 commit into
mainfrom
ci/enforce-name-module-equality

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

rules/mcpp.toml states that the package name and the module name are kept
EQUAL, and that this is what makes the package work on every engine rather
than on the newest one. Nothing enforced it — the check beside this one
compares the three versions, which is a different invariant.

mcpp before 2026.8.29.1 registers a host module under the dependency's
package.name; from that release it uses the name the interface declares.
Only equality satisfies both.

The break is asymmetric, so a single compiler cannot reveal it: renaming
either name alone still builds under GCC, which locates a BMI by its declared
name through gcm.cache, and fails under Clang and MSVC, which are handed an
explicit <name>=<bmi> mapping built from the registered name.

What the check avoids

  • No sed | head -1: under pipefail the writer can take SIGPIPE and report
    141 for a successful match. Both names are read in one awk.
  • An empty extraction fails rather than passing.
  • Comment lines begin with # and match neither pattern, so the prose in this
    file that explains the rule cannot answer the assertion.

Measurement

case expected result
current tree pass pass
package.name changed fail fail
restored pass pass

The same guard is proposed for mcpplibs/clangtidy in its PR #1.

rules/mcpp.toml states that the package name and the module name are kept
EQUAL, and that this is what makes the package work on every engine rather
than on the newest one. Nothing enforced it. The check next to this one
compares the three versions, which is a different invariant.

mcpp before 2026.8.29.1 registers a host module under the dependency's
`package.name`; from that release it uses the name the interface declares.
Only equality satisfies both.

The break is asymmetric, so one compiler cannot reveal it: renaming either
alone still builds under GCC, which locates a BMI by its declared name through
gcm.cache, and fails under Clang and MSVC, which are handed an explicit
`<name>=<bmi>` mapping built from the registered name. A consumer on an older
engine would see this package work on one compiler and not on the others.

Both names are read in a single awk rather than a `sed | head -1` pipeline, so
a successful match cannot be reported as 141 through SIGPIPE under `pipefail`,
and an empty result fails instead of passing -- an extractor that matched
nothing would otherwise report success on a file it never parsed. Comment
lines begin with `#` and match neither pattern, so the prose in this very file
that explains the rule cannot answer the assertion.

Measured: passes on the current tree, red when the package name is changed,
green again once restored.
@Sunrisepeak
Sunrisepeak merged commit 3fa45bb into main Aug 29, 2026
5 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.

1 participant