Skip to content

the target is named by mcpp, and a sixth patch site was found by enumerating - #27

Merged
Sunrisepeak merged 3 commits into
mainfrom
the-target-is-named-by-mcpp-not-borrowed
Sep 20, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
the-target-is-named-by-mcpp-not-borrowed

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

What changes

__libunwind_config.h sizes unw_context_t by whether the target is Windows. It read __CYGWIN__ deliberately — this header is INSTALLED, an application own compile reads it, and this package private define never reaches that compile.

mcpp 2026.9.21.1 states the fact under its own name, so the header reads __mcpp_target_windows__ first and still accepts the old one: correct on an engine from either side of that release, no flag day.

A sixth patch site, found by enumerating rather than fixing the known two

compiler-rt/lib/builtins/int_lib.h selects how COMPILER_RT_ALIAS is spelt:

#if defined(__ELF__) || defined(__MINGW32__) || ... || defined(__CYGWIN__)
#elif defined(__APPLE__)
#elif defined(_WIN32) || defined(__UEFI__)
#else
#error Unsupported target

It works today by accident. _WIN32 and __MINGW32__ are suppressed by [c-abi] presents = "posix", __ELF__ is false — __CYGWIN__ is the only operand holding that branch up. Withdraw it and every branch goes false: #error Unsupported target, one release from now.

This file is not installed — compiled only by this package own build — so it takes the private define OPENKAL_TARGET_WINDOWS, which is the rule the other five patches in this tree follow, and the reason __libunwind_config.h does the opposite.

PATCHES.md records the site and adds __CYGWIN__ to the grep list the next person changing this tree is told to run.

Why enumeration mattered here

The first shape of this ecosystem change was stopped by cross-verification precisely because a set had been compared by sampling — the measurement counted third-party readers of __CYGWIN__ and not this repository own. Fixing only the two known headers would have moved the failure from a static_assert to an #error, one release later.

Sequence

  1. mcpp 2026.9.21.1 defines __mcpp_target_<os>__ (additive)
  2. this change — read it, keep accepting the old name
  3. a later mcpp release stops defining __CYGWIN__

…erating

`__libunwind_config.h` sizes `unw_context_t` by whether the target is
Windows. It read `__CYGWIN__`, deliberately, because it is INSTALLED --- an
application's own compile reads it, and this package's private define never
reaches that compile. mcpp 2026.9.21.1 states the fact under its own name, so
the header reads `__mcpp_target_windows__` first and still accepts the old one:
correct on an engine from either side of that release, no flag day.

THE SIXTH SITE WAS NOT ON ANY LIST. `compiler-rt/lib/builtins/int_lib.h`
selects how `COMPILER_RT_ALIAS` is spelt:

    #if defined(__ELF__) || defined(__MINGW32__) || ... || defined(__CYGWIN__)
    #elif defined(__APPLE__)
    #elif defined(_WIN32) || defined(__UEFI__)
    #else
    #error Unsupported target

It works today BY ACCIDENT. `_WIN32` and `__MINGW32__` are suppressed by
`[c-abi] presents = "posix"` and `__ELF__` is false, so `__CYGWIN__` is the
only operand holding that branch up. Withdraw it and every branch goes false:
`#error Unsupported target`, one release from now.

This file is NOT installed --- it is compiled only by this package's own build
--- so it takes the private define, which is the rule the other five patches
in this tree follow and the reason `__libunwind_config.h` does the opposite.

Found by enumerating the readers rather than fixing the two that were known.
The first shape of this ecosystem change was stopped by cross-verification
precisely because a set was compared by sampling; doing it again here would
have moved the failure from a `static_assert` to an `#error`, one release
later. PATCHES.md records the site and adds `__CYGWIN__` to the grep list that
the next person changing this tree is told to run.
Both packages move onto mcpp's own name for the target in the same step,
because both reasons are the same reason: an INSTALLED header is read by an
application's own compile, and a package-private define never reaches it.

THE PIN MOVES WITH IT, AND THE ORDER IS THE ONE THIS ECOSYSTEM LEARNED THE
HARD WAY TODAY. openkal-musl 0.19.0 is registered in the index before this
pin is merged; a consumer merged ahead of its dependency's registration made
mcpp's own `openkal-cross` job fail earlier in this wave, and the consumer's
own CI could not see it --- that CI substitutes working trees for the whole
graph, so it cannot observe a missing registration by construction.
Project-owned macros are upper case --- `NDEBUG` and every other one are ---
while lower case belongs to the compiler's own predefines (`__linux__`), which
mcpp supplies but does not own. 2026.9.21.1 spelt it lower; the release that
withdraws `__CYGWIN__` renames it in the same change, so these headers are
written against the spelling they will keep.

The lower-case name is not read here and does not need to be: it existed for
one release and nothing consumed it. Two operands cover every engine --- one
up to and including 2026.9.21.1 defines `__CYGWIN__`, the one that withdraws
it defines `__MCPP_TARGET_WINDOWS__` --- so these headers have no flag day and
the releases may land in either order.

`int_lib.h` is unaffected by the spelling: it is not installed, so it takes
the package-private `OPENKAL_TARGET_WINDOWS`, which is the rule this tree
already follows and the reason `__libunwind_config.h` does the opposite.
@Sunrisepeak
Sunrisepeak merged commit 1eabd62 into main Sep 20, 2026
10 checks passed
@Sunrisepeak
Sunrisepeak deleted the the-target-is-named-by-mcpp-not-borrowed branch September 20, 2026 20:32
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