Skip to content

Add libuv and expat registry facts and fix c_import/link blockers they surfaced (closes #3173) - #3647

Merged
ehartford merged 1 commit into
mainfrom
registry-libuv-expat-facts
Nov 27, 2026
Merged

ehartford merged 1 commit into
mainfrom
registry-libuv-expat-facts

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Completes the remaining stated pairs and survey for #3173, plus fixes four compiler/linker bugs surfaced when compiling and running safe With programs against the pinned libuv and expat packages:

  • Registry facts (registry/c/libuv/facts.with, registry/c/expat/facts.with):
    • libuv 1.53.0: states in-place pairs Loop (uv_loop_init/uv_loop_close), Mutex (uv_mutex_init/uv_mutex_init_recursive/uv_mutex_destroy), RwLock (uv_rwlock_init/uv_rwlock_destroy), Cond (uv_cond_init/uv_cond_destroy), and Barrier (uv_barrier_init/uv_barrier_destroy), cited to include/uv.h.
    • expat 2.11.0: states define XML_GE=1 (matching expat_config.h line 105 / expat.h line 1125) and Parser (XML_ParserCreate, XML_ParserCreateNS with nullable param 0, drop XML_ParserFree), cited to include/expat.h.
    • Verified both end-to-end by compiling, linking, and running safe With programs (zero unsafe) against the pinned c.libuv and c.expat packages (libuv ok, expat ok line=1 err=0 col=0).
  • Compiler & linker fixes surfaced by end-to-end verification:
    • src/compiler/ClangBridge.with & src/CImport.with: add panic, unreachable, and todo to ci_escape_reserved and ci_is_prelude_surface_name so C headers declaring panic (macOS <mach/mach.h> pulled in by uv.h) do not shadow With's prelude panic across user code, <c_import>, and std.string (regression test test/behavior/behav_c_import_prelude_panic_collision.with).
    • src/CiMigrate.with: reset c_import emitted names before probing installed headers and demote build-only #ifdef-guarded prototypes that c_import does not emit under the package's import defines so generated contract.with files never name undeclared functions.
    • src/compiler/ConanClient.with & src/compiler/Link.with: normalize GNU ld -l:libfoo.a pkg-config entries (libuv-static.pc's -l:libuv.a) to foo so ld64.lld (macOS) and lld-link (Windows) link cleanly.
    • src/compiler/FacadeRender.with: allow text param N to compose with nullable param N as Option[&str].

Refreshed #3173 six-library survey (darwin-aarch64, WITH_REGISTRY=file://$PWD)

library version baseline (2026-11-10) now
zlib 1.4 27 / 88 (30%) 34 / 88 (38%)
bzip2 1.0.8 1 / 24 (4%) 9 / 24 (37%)
xz_utils 5.8.4 17 / 114 (14%) 21 / 114 (18%)
libyaml 0.2.5 0 / 48 (0%) 5 / 48 (10%)
libuv 1.53.0 31 / 319 (9%) 49 / 319 (15%)
expat 2.11.0 1 / 83 (1%) 33 / 86 (38%)
Total 77 / 676 (11%) 151 / 679 (22%)

Closes #3173.

@ehartford

Copy link
Copy Markdown
Contributor Author

Battery and :release-checks green on 18a869ed3 (darwin-aarch64):

  • with run tools/verdict.with out/battery/battery.log: rc=0 green (wall=732s)
  • UATs: 12/12 macOS scenarios pass (raylib_spiral_windows skipped on darwin-aarch64)
  • WITH=$PWD/src/main src/main build :release-checks: all targets green (wall=577.7s, stage2 == stage3 over all 16 units of the compiler, EMIT-C OK, EMIT-C FIXPOINT, rt-bundle-fixpoint)

@ehartford
ehartford marked this pull request as ready for review November 27, 2026 06:09
@ehartford
ehartford merged commit 673ca26 into main Nov 27, 2026
1 check passed
@ehartford
ehartford deleted the registry-libuv-expat-facts branch November 27, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant