Skip to content

2026.9.26.1: paths in UTF-8, a C standard per package, a graph link without the host, and the level that was declared - #698

Merged
Sunrisepeak merged 3 commits into
mainfrom
fix/693-696
Sep 25, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
fix/693-696

Conversation

@speak-agent

Copy link
Copy Markdown
Member

Closes #693, #694, #695, #696. Plan, measurements and the implementation record: .agents/docs/2026-09-25-issues-693-696-triage-and-repair-plan.md (§12.4 for what departs from the plan, Appendix A for the readings).

#693: one text encoding

mcpp held paths in the Windows ANSI code page while compile_commands.json holds UTF-8 only. Every build under a non-ASCII project directory or MCPP_HOME failed with internal: unhandled exception: [json.exception.type_error.316], including names the code page can spell (every Chinese name on code page 936); a Latin-1 directory name fails the same way on Linux. The report's silent 0xC0000409 is the xlings shim (openxlings/xlings#613).

  • mcpp.exe declares the UTF-8 code page through [resources] files = ["res/mcpp.rc"] (the bootstrap engine that builds a release does not know the new key). build.mcpp is linked with the same manifest; host tools default to it; [targets.<name>] windows_code_page = "utf-8" | "legacy" states it for a project's own executables.
  • A path with no UTF-8 spelling is refused (project directory, MCPP_HOME), skipped and reported (a name inside a project, the path/codepage channel of Windows 解压包含 UTF-8 路径的归档时因多字节代码页转换失败 #516), or refused by key (a build.mcpp directive). A serialiser failure in compile_commands.json is that document's write failure.
  • The response files of the msvc dialect begin with a UTF-8 byte order mark: cl.exe, link.exe and lib.exe read UTF-8 only with it (measured, Appendix A.13). When build.ninja holds a non-ASCII byte, ninja -t wincodepage must answer UTF-8.
  • On a Windows older than 1903 the diagnostics name the process code page.

#695: c_standard applies to the package that declares it

The root's value was on the file-level $cflags; a dependency's own declaration was parsed, hashed and not applied. Each package's C units (the entry main included) now compile at their own standard, an undeclared package at c11; the cl.exe dialect reports, in one line, the declarations it does not apply. The #690 record carries a correction note.

#696: a graph link searches no host directory

An ELF link over a graph-supplied C library, by clang, carries --sysroot=<build>/graph-sysroot (empty), and the hermetic check holds every -L to the store, the build directory and the graph's packages. An unanswered -l fails with a note that names openkal-musl 0.19.2, which ships musl's eight empty archives (mcpplibs/openkal-musl#43, registered in mcpplibs/mcpp-index#467).

#694: the declared optimization level

The *-linux-musl -Og workaround is removed; the compile and the Finished line read one realised level.

Tests

  • Unit: per-package C standard (7), hermetic graph link (4), optimization level over every target row, response-file BOM, Ninja encoding, UTF-8 validity and escaping, directive encoding, windows_code_page parsing, the rc scanner.
  • e2e 776 (paths with no UTF-8 spelling, four entry points), 777 (per-package C standard), 778 (graph link, two legs; run in openkal-cross.yml where llvm is installed). Each fails against 2026.9.25.1 at the criterion it names.
  • Windows: .github/tools/check_unicode_paths.sh builds and runs llvm, MSVC and MinGW rows in an ASCII, a caf + U+00E9 and a U+6D4B U+8BD5 directory, plus a path through build.mcpp.

Still to come on this branch

kXlingsVersion moves to the xlings release that carries openxlings/xlings#613.

…ithout the host, and the level that was declared

#693. mcpp held paths in the Windows ANSI code page, and the JSON it writes
holds UTF-8 only, so every build under a non-ASCII project directory or home
failed with an internal JSON exception, including names the code page can
spell; a Latin-1 directory name fails the same way on Linux. mcpp.exe now
declares the UTF-8 code page (res/mcpp.rc), build programs are linked with the
same manifest, host tools default to it, and the new target key
`windows_code_page` states it for a project's own executables. A path with no
UTF-8 spelling is refused (project directory, MCPP_HOME), skipped and reported
(a name inside a project), or refused by key (a build.mcpp directive), never an
internal exception. The response files of the msvc dialect begin with a byte
order mark, which cl.exe, link.exe and lib.exe need to read UTF-8 (measured),
and Ninja's own encoding is checked when build.ninja is not ASCII.

#695. `[build] c_standard` reached every C unit of the graph through the
file-level $cflags, and a dependency's own value was not applied. Each package's
C units now compile at that package's standard; an undeclared package at c11.

#696. A link over a graph-supplied C library searched the host's library
directories, so `-lm` linked glibc objects into a musl image. Such a link on ELF
now carries --sysroot naming an empty directory, the hermetic check holds every
-L to the store, the build directory and the graph's packages, and an
unanswered -l fails with a note naming openkal-musl 0.19.2.

#694. The musl -Og workaround is removed; the compile and the Finished line
read one realised optimization level.

Plan and measurements: .agents/docs/2026-09-25-issues-693-696-triage-and-repair-plan.md
…ink measured on four legs

- kXlingsVersion and every xlings pin in .github move to 2026.9.26.2
  (openxlings/xlings#613): xlings.exe declares the UTF-8 code page and its
  main has an exception boundary, so a working directory or an MCPP_HOME
  outside the ANSI code page no longer ends it with 0xC0000409 and no output.
- test_cache_key stated the old rule, that a package's `c_standard = "c11"`
  is keyed; a package that spells the default and one that says nothing
  compile identically and now share a key. CI run 1 failed that test on every
  platform, and nothing else in the unit suites.
- e2e 778 pins each leg to the openkal-musl and openkal-llvm-runtime pair that
  belongs together (the runtime pins openkal-musl exactly, and a root that
  pins another is refused as irreconcilable), and adds the report's aarch64
  case under qemu-aarch64 and a host `-L` refused by the hermetic check. The
  openkal job asserts each leg ran.
- docs: a macOS file name is UTF-8; `allow_host_libs` lifts the graph-link
  refusal rather than turning it into a warning.
- The plan's implementation record carries CI run 1: every Windows row of the
  regression job passes, and the two xcode-27 legs fail as on main (#669).
@speak-agent

Copy link
Copy Markdown
Member Author

CI on 15317aa: 40 checks pass. The two that fail are the xcode-27 legs (macOS ARM64 — xlings LLVM end-to-end (xcode-27) and e2e suite (macOS ARM64, self-host, xcode-27)), which fail the same way on main: ld64.lld 22.1.8 cannot parse arm64e.x1 in that image's SDK stubs (tracked in #669, upstream).

What the run measured for this change:

  • toolchains + regressions (windows x64): check_unicode_paths.sh builds and runs the llvm, MSVC and MinGW rows in an ASCII, a caf + U+00E9 and a U+6D4B U+8BD5 directory, plus a path through build.mcpp; every row passes.
  • The packaged mcpp-2026.9.26.1-windows-x86_64.zip carries RT_MANIFEST ID 1 with activeCodePage UTF-8 in bin/mcpp.exe, and the bundled registry/bin/xlings.exe (2026.9.26.2) carries the same.
  • openkal e2e: e2e 778 passes all four legs (the graph answers -lm on x86_64-linux-musl; an unanswered -lm fails with the note; aarch64-linux-musl links and runs under qemu-aarch64; a host -L is refused by the hermetic check).
  • e2e 776 and 777 pass on the Linux shards; the unit suites pass on Linux, macOS and Windows.

Run 1 failed test_cache_key on every platform (it stated the old key rule) and e2e 778 (it paired openkal-musl 0.19.2 with runtime 0.15.1, which the exact pin refuses); both are corrected in 9697b21.

@Sunrisepeak
Sunrisepeak merged commit f61b466 into main Sep 25, 2026
41 of 43 checks passed
Sunrisepeak pushed a commit that referenced this pull request Sep 25, 2026
…gs (#700)

The plan's status moves to landed, and its implementation record (§12.4 to
§12.6, Appendix A.15) states what was released and measured:

- mcpp 2026.9.26.1 (#698), xlings 2026.9.26.2 (openxlings/xlings#613),
  openkal-musl 0.19.2 and openkal-llvm-runtime 0.15.2, each mirrored to GitCode
  and checked against its GitHub sha256, and registered or indexed;
- the sandbox check of the published artefacts (12 ok) and the same script
  against 2026.9.25.1 (exactly the six criteria the release changes fail);
- mcpp-index#469's sweep (green on every platform) and its openkal
  measurement over four targets, where the one cell #696 makes visible,
  mimalloc's `-latomic` on the linux-musl rows, is filed with its owner
  (mcpplibs/openkal-llvm-runtime#31);
- the self-review, and what remains open with the reason for each.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
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.

Windows: 非 ACP 工作目录下 mcpp --version 静默退出 0xC0000409(先修进程边界,再验证构建链)

2 participants