Repository navigation
#2972, #2980: a package's units are read under its own defines; a unity include is one definition - #3025
Merged
Conversation
…ty include is one definition A bare `-DNAME` is `NAME=1` to a C compiler; the migrator defined it empty, so sqlite3.c's `#if HAVE_LOCALTIME_R` preprocessed as `#if` with nothing to test, clang refused the amalgamation, and the facade saw 18 of 319 functions (3 presented). Now `#define NAME 1`; sqlite3 reads whole: 303 functions, 34 presented safely, 0 unreadable units. With it, what the hunt needed and the reports asked for: - the bridge's parse error names the file, line and column clang gives (cimport_record_parse_error kept the spelling alone; the failing `#if` could not be found in 250k lines); - `WITH_KEEP_BUILD` keeps the fetched and configured source tree under dep_dir/.build after the facade, so an unread unit can be migrated by hand under the same compile_commands.json; - #2980: a global defined in a unit a unity unit `#include`s is seen from two units at one site — one definition, the first owner publishing it, as the function path already read it (libcurl's unity_0_c.c marked 183 units unreadable); - `main` is an entry point per unit, never a project symbol (a package's examples each carry one: libcurl's docs/examples). Migrator basic checks: bare_define_is_one (the defined branch is taken; a failing `#if` is located as `empty.c:2:10: expected value in expression`), unity_include_is_one_definition (two units including one .c and two `main`s migrate; the included unit's producer and destroyer make the resource).
Contributor
Author
|
Gate green on 9178b99 (465 s, seed-driven; the first run was red on sema-order-check because the bridge's located parse error leaked the per-run synthetic temp path into two c_import header-error fixtures — now the synthetic main is skipped, as collect_inclusion skips it). The migrator basic checks |
ehartford
force-pushed
the
sqlite-proofs
branch
from
November 3, 2026 17:15
a932982 to
9178b99
Compare
ehartford
marked this pull request as ready for review
November 3, 2026 17:26
Contributor
Author
|
Battery green on 9178b99 (seed-driven gate, uat, battery-checks; |
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.
Closes #2972. Closes #2980.
Root cause of #2972 (exact line):
migrate_add_defineturned a bare-DNAMEinto#define NAME(empty) where a C compiler meansNAME=1. sqlite3.c line 26374#if HAVE_LOCALTIME_Rthen preprocessed as#ifwith nothing to test, clang refused the amalgamation ("invalid token at start of a preprocessor expression"), and the facade saw 18 of 319 functions (3 presented). The macOS report's "could not read the Conan Center recipe" was a transient network failure; locally the Arch shape reproduces. Now#define NAME 1.With the fixed stage1,
with get c.sqlite3: 303 functions, 34 presented safely, 269 raw, 0 unreadable units (was 18 / 3 / 1 unreadable). The 269 raw are proof limits, not reading failures.What the hunt needed and the reports asked for, in the same change:
cimport_record_parse_errorkept the spelling alone; the failing#ifcould not be found among 250k lines);WITH_KEEP_BUILDkeeps the fetched and configured source tree underdep_dir/.buildafter the facade, so an unread unit can be migrated by hand under the samecompile_commands.json;#includes is seen from two units at one definition site: one definition, the first owner publishing it, as the function path already read it (libcurl'sunity_0_c.cmarked 183 units unreadable);mainis an entry point per unit, never a project symbol: a package's examples each carry one beside the library's (libcurl's docs/examples).Migrator basic checks (run in the gate):
bare_define_is_one(the defined branch is taken; a failing#ifis located asempty.c:2:10: expected value in expression),unity_include_is_one_definition(two units including one .c and twomains migrate with every unit read; the included unit's producer and destroyer make the resource). The unity fixture fails on the installed compiler with "duplicate function definition for main".With the fixed stage1,
with get c.libcurl8.23.0: 152 functions, 15 presented safely, 137 raw, every source unit read (the unity include no longer marks 183 units unreadable, and the examples'mains are no duplicate). The six units the build generates (tool_hugehelp.c, the test servers) are absent in a configured-only tree and are now reported apart: "6 unit(s) the build generates were not there (the package was configured, not built)", never as unreadable source. The summary's "N functions" already counts the functions the installed headers declare, which is the public-surface coverage the Arch report asked for.Also filed today: #3024 (a failed early target reported as "a dependency cycle").