Repository navigation
#2060: a corpus is migrated against one C model on every host - #2064
Merged
Merged
Conversation
added 7 commits
October 4, 2026 22:18
A record only a type names (glibc's struct __locale_data inside __locale_struct) has no top-level cursor, so the by-name location index had nothing for it and a Linux migration emitted the libc-internal 'type __locale_data = opaque' into the shared defs. The filter falls back to the declaration's own cursor location.
The migrator parsed C for the host triple against the host's sysroot (CImport.w ci_prepare_clang_resource_dir, ClangBridge.w cimport_build_args), so a Linux run took glibc's #if branches and macro values: zlib's ioapi.c calls fopen64, tommyds's check.c clock_gettime, pcre2test reads glibc's RLIMIT_STACK enumerator, and glibc's assert expands to __assert_fail with the absolute __FILE__. The checked-in corpora are the macOS migration, so every drift check was red off macOS. with migrate takes --c-target and --c-sysroot: the parse is for that target against that sysroot and reads nothing of the host. Every corpus migration (migrate, drift check, c-algorithms test programs) runs this tree's release compiler as a process against arm64-apple-macosx and the darwin headers of the pinned Zig source: the embedded sysroot's tree on macOS, the corpus-c-model target's on every other host. Mac: corpus-drift-check green (pcre2 35, zlib 22, c_algorithms 24, tommyds 16 modules) with the model named.
A fixture sysroot whose string.h defines the macro the unit reads and whose stdio.h names a record only through a type: the migration succeeds only against the model's headers, and the model's record is not a declaration of the output.
…lection never replaces a model Left to clang the deployment version was the migrating Mac's own OS version (26.0 here), and off macOS none: the darwin headers then leave _FORTIFY_SOURCE off, <string.h> declares memset without its macro, and zlib's zmemzero translated on Linux but not on the Mac (lib/std/zl/defs.w, the one module that still differed). The model is arm64-apple-macosx11.0.
…t / --c-sysroot docs/spec/toolchain/with-migrate-spec.md gains the two options. spec-inventory-check refuses the flags without spec words (Linux gate: 'implementation has unspec'd --c-sysroot / --c-target'); this commit is the draft of those words and is not blessed. It stays its own commit so it can be reworded or dropped.
…-c-target / --c-sysroot" This reverts commit 5a4540c.
…n the spec inventory Linux gate: 'spec inventory: cli flags: implementation has unspec'd --c-sysroot / --c-target'. They sit with the other migrate flags build/corpus.w passes (--shared-defs, --width-slice, --migrate-one, --shared-fragment) in comp_internal_flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress for #2060. The migrator parsed C for the host triple against the host's sysroot, so the pcre2/zlib/tommyds/c-algorithms drift checks could only pass on the host the corpora were promoted on. Corpus migrations now name one C model (arm64-apple-macosx, the darwin headers of the pinned Zig source) on every host. Evidence and the open design question follow once the Linux run is in.