Skip to content

Epic: with get c.<lib> just works — every popular Conan C library ships a complete, reviewed facade #3115

Open

Description

@ehartford

The promise

A user who wants a C library from Conan types with get c.<lib> and uses the whole library from safe With: no unsafe, no project facade, no copying files out of the compiler repo, no compiler bugs in the first hour. Mission: "C interop is first-class ... without making the programmer become the build system."

What happened instead (2026-11-10 secret-shopper transcript, postal-mcp)

A user building an MCP server wanted libcurl and yyjson. with get c.libcurl presented 15 of 152 functions; the easy, header-list and multipart APIs stayed raw (#3111). Writing the facade by hand hit four grammar walls, three compiler bugs (#3112, #3113, #3114), a reserved word (error) as a field name, a representation trick to get a str's bytes, and refusals that did not say what to write instead. The user finished only by keeping raw calls behind a hand-written safe function.

Root cause

Facades come from inference at fetch time, and Law 4 rightly stops inference short of ownership and retention. The backstop that should carry a library the rest of the way, a reviewed registry facts file (§16.2b.15), exists for 2 packages (zlib, libxml2). And no test plays the user: "fetch a popular library, use it fully, safely".

Plan

  1. Measure: draft every library on the list and publish coverage and refusal reasons (child issue).
  2. Fix the grammar from the clustered refusals, before writing facades (child issues, one per gap).
  3. Fix the proof engine's misreads (child issues).
  4. One reviewed, complete facade per library in registry/c/<lib>/, each with a UAT doing the library's canonical tasks in a fresh project with zero unsafe (one child issue per library).
  5. UX: with get reports what it delivered; refusals name the fix; idiomatic surfaces; secret-shopper UATs as a routine (child issues).

Children

Measure and report

Facade grammar

Facade proof

Compiler bugs met in the first hour

Experience

Registry facades, one per library

Umbrella for the libcurl case: #3111 (its grammar gaps and proof observations are split out above).

Activity

  1. ehartford commented on Nov 9, 2026

    @ehartford
    ContributorAuthor

    Measurement done (#3116)

    tools/facade_coverage.w drafted the whole list; the table is docs/spec/toolchain/facade-coverage.md (regenerate with with build :facade-coverage). 20 of 29 libraries produced a facade: 7279 functions, 1768 presented safely (24%). raylib 66%, zlib 30%, libxml2 22%, sdl 22%; libcurl 9%, sqlite3 11%, libuv 8%, pcre2 7%, freetype 5%, libyaml 1%; cjson, libpng and harfbuzz near 0 for infrastructure reasons.

    Issues from the survey, to add to the checklist:

    Fetch and read infrastructure

    Clusters of raw verdicts (function counts across the 20 drafted libraries)

    Not drafted on this host, by D171 (not a bug): zstd, lz4 (non-CMake), libarchive→libiconv (autotools), openssl and libgit2→openssl (Perl).

  2. added a commit that references this issue on Nov 9, 2026
  3. ehartford commented on Nov 9, 2026

    @ehartford
    ContributorAuthor

    Survey rerun on main 6d478f1 (docs/spec/toolchain/facade-coverage.md, #3201): 22 of 29 libraries drafted, 7607 functions, 1798 presented (23%). Since the first table: cjson 1 → 79 functions read (#3167), xz_utils 16 → 26 presented, libxml2 316 → 320, libarchive 111 → 112, libcurl 15 → 16, expat and libjpeg-turbo drafted for the first time, yyjson 9 → 4 (its allocator field no longer taken for malloc by name: Law 4, see #3150/#3151 for the registry convention both need). Fixed on the way: #3165 #3166 #3167 #3170 #3171 #3172 #3179 (2 of 3) #3187 #3195; #3175 is in PR #3200. Still no facade for zstd and lz4 (non-CMake), openssl and libgit2 (Perl), libsodium and protobuf-c/abseil (recipe index has no folder for the version), nghttp2 (the name is libnghttp2).

  4. ehartford commented on Nov 9, 2026

    @ehartford
    ContributorAuthor

    Survey on main 4cf358b (table refreshed): 22 of 29 libraries, 7863 functions, 1748 presented (22%). Gains: libpng reads (0 → 256, #3168), libxml2 320 → 330, libarchive 112 → 118, libcurl 16 → 18, libevent 57 → 59. Losses that are corrections: pcre2 6 → 0, libssh2 10 → 3, sdl 549 → 493, yyjson 4 → 1 — those rested on a struct field named free/malloc or a dispatch field named like a function (Law 4). The two largest gaps now: #3206 calls through function-pointer fields (1648 functions, 14 libraries; needs a ruling) and #3173 caller-allocated structs by pointer (1538, 21 libraries; grammar). Fixed since the last note: #3168, #3174 (wording), #3175 (2 shapes), #3176 (wording), #3205 (attributes from the AST, malloc-annotated allocators).

  5. ehartford commented on Nov 18, 2026

    @ehartford
    ContributorAuthor

    Measured 2026-11-18 on darwin-aarch64 (main plus the survey fix): what a program gets from with get c.<lib>.

    By default every library that fetched arrives as a Conan Center binary. Under §31.8.5 ('the build that was proved') the proofs over its separately configured source are evidence and grant nothing. Across 22 libraries a program is presented 13 functions: zlib 3 and libxml2 10 (registry lines), 0 for every other library. The source evidence for the same 22 says about 1,816 would be presentable.

    With with get --from-source c.<lib> (the build the proofs count for), 25 libraries tried:

    result libraries
    builds, contract drawn (16) zlib 30 of 88 presented, bzip2 5/24, xz_utils 18/114, sqlite3 35/285, expat 3/83, libyaml 1/48, yyjson 1/48, cjson 3/78, pcre2 0/83, libpng 1/256, libjpeg-turbo 24/80, freetype 15/218, sdl 577/2461, glfw 30/126, raylib 459/763, libuv 37/319
    a requirement cannot be built from source (6) libarchive and libxml2 (libiconv), libcurl, libssh2 and libevent (openssl), harfbuzz (glib)
    not a CMake project (2) zstd, lz4
    wrong name in my list (1) nghttp2 is libnghttp2

    Total presented from source: 1,239 functions in 16 libraries, against 13 by default.

    So proof-engine work (#3173, #3174, #3175, #3176, #3178) reaches a program only for a library built from source or one with registry lines. The published coverage document (2026-11-10) predates the prebuilt-binary rule and shows the from-source numbers.

  6. added
    blocked
    on Nov 24, 2026
  7. ehartford commented on Nov 24, 2026

    @ehartford
    ContributorAuthor

    Labelled blocked: the epic moves through its children, and the open ones each wait on a ruling stated on the child: the libcurl set under #3111 (#3119, #3120, #3121, #3122, #3124), the proof rules (#3174 with #3176 and #3206, #3175), and #3132 (the reserved-word list). #3173 (caller-allocated structs) and #3128 (the call shape facades present) are the two children still being worked without a ruling outstanding.

  8. removed
    blocked
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions