Repository navigation
with get builds a Conan package from source when there is no binary; with cc - #1208
Merged
Merged
Conversation
ehartford
marked this pull request as ready for review
September 19, 2026 09:11
added 13 commits
September 19, 2026 02:34
with get has to build a C library when no binary exists for the platform (ConanCenter publishes no Linux armv8 binaries at all), and the toolchain does not trust a system compiler. LLVM's backends are already in the binary; the four objects of clang's driver tool (lib/libclangMain.a in the SDK) add clang_main, called through one extern. The builtin headers come from the embedded resource dir. A multi-job compile re-executes `with cc -cc1` through llvm::ToolContext. darwin-arm64 stage1: 107 MB -> 125 MB. Compiles and runs a C program, cross-compiles an aarch64 ELF object, and a two-file compile exercises the re-exec path.
The SDK build archives the objects of clang's driver tool (driver, cc1_main, cc1as_main, cc1gen_reproducer_main) from the LLVM build tree into lib/libclangMain.a (clangMain.lib on Windows), where the compiler link already takes every clang archive, and the SDK package check requires it. clang_main is a C++ symbol, so its spelling differs between the Itanium and Microsoft manglings. The source declares one plain extern, with_clang_main; the per-OS section of the compiler link aliases it (ld64 -alias, ELF --defsym, COFF /alternatename) and forces the archive member in. The MSVC name was checked with llvm-undname: int __cdecl clang_main(int, char **, struct llvm::ToolContext const &). Verified by linking and running on darwin-arm64; Linux and Windows need their SDKs rebuilt first.
A port tells `with get` how to build a C library from source: where the tarball is and its sha256, which files to compile, the include dirs and defines, per-OS additions, and the library it produces. It is data; nothing fetched is executed. Unknown keys, a missing field, or a malformed sha256 are reported, not skipped.
`with get c.X` fell back to compiling every .c file in the recipe's tarball with the system `cc`, and gave up on any recipe with patches, a configure step or requirements — zlib already. It also could not be locked (the lock wants conan_package.tgz), so it never completed for anything. Now: no linkable binary -> the library's port (ports/<name>/port.toml, or WITH_PORTS_DIR for a local registry). The tarball is checked against the port's sha256, overlay files are written, the selected sources are compiled by `with cc`, archived, and described by the same metadata.json a binary package gets. The lock records source "port" and the tarball digest; a restore rebuilds the same version or says what moved. A missing port is one error naming the platform and the package. `with get --from-source` takes this path on a platform that does have binaries. First port: zlib 1.3.2. On darwin-arm64 `with get --from-source c.zlib` builds 15 files into libz.a and the release UAT's zlib program links it statically and prints "zlib UAT passed".
Both build with `with get --from-source` on darwin-arm64 and the release UAT programs for them link the result and pass. bzip2 compiles the seven library files (not the bzip2/bzip2recover programs); sqlite3 compiles the amalgamation with the features Conan Center's build enables.
A packaged SDK from `with build :deps` predates `with cc`, and rebuilding LLVM to add four objects is hours per platform. The driver needs only the SDK's installed headers. `sdk-clang-main` (a dependency of stage1) fetches driver.cpp, cc1_main.cpp, cc1as_main.cpp and cc1gen_reproducer_main.cpp from the llvmorg-<version> tag, checks them against pinned sha256 digests (they match the release tarball's), compiles them with the SDK's clang++ and archives them as lib/libclangMain.a. It does nothing when the archive is there, which is the case for an SDK built from source. Run under the pinned seed on darwin-arm64: 89 s, and the compiler links against the result. The same four compiles were done by hand against the packaged linux-aarch64 SDK and define clang_main.
raylib builds as its own Makefile does for PLATFORM_DESKTOP_GLFW with the bundled GLFW. macOS needs frameworks, which are link arguments rather than -l names, so [link] gains link_args; GLFW's Cocoa sources are Objective-C, which a [build.macos] cflags entry selects.
The embedded clang headers were chosen for parsing a header for c_import and left every intrinsics header out. `with cc` compiles real C: raylib's stb_image_resize2.h includes <arm_neon.h> and rtextures.c did not compile. A port builds for the host, so the host architecture's intrinsic headers are embedded (arm64 5.7 MB, x86_64 4.2 MB); other architectures' and Arm's M-profile ones are not. The pinned seed generates the 5.9 MB module in 1.2 s and the include-closure check passes. With it, `with get --from-source c.raylib` builds libraylib.a on darwin-arm64 and the release UAT's spiral program links it, opens its GL window and prints "raylib spiral UAT passed".
Eric: no special-case files per Conan package. The port format, its parser and the four port files are gone. What decides how a package builds is the package's own build system; what a source build needs to know generically is in the recipe Conan Center already publishes, read as data and never run: - conandata.yml: the version's tarball URL (first of a mirror list), sha256 and patch files. - conanfile.py: `self.requires(...)`, `default_options`, and the `tc.variables[...] = <expr>` assignments, evaluated when the expression is a literal, the version or one of its components, the source folder, or a boolean option's default; anything else is listed as unknown. Against the live recipes: zlib, bzip2, sqlite3, libcurl and raylib all yield a source URL and digest and 3/4/29/31/16 known CMake variables, with 0/0/7/8/2 unknown — every unknown is an expression over option defaults or platform settings, the next thing to evaluate. openssl has no CMake build. `with cc`, --from-source, the header fixes and the sdk-clang-main target stay. The source build itself is a stub that says so; the lock's "port" source is kept for the entry it will write.
A recipe decides its requirements and CMake variables with Python expressions over options and platform settings. With every option at its declared default and the host as the platform, the subset recipes use has a value without running anything: literals, ==, !=, in / not in, and / or / not, the conditional expression, str(), bool(), .replace(), get_safe(), is_apple_os(), Version(self.version).major, self.settings.os/arch/build_type. `shared` is always False. if / elif / else chains around `self.requires` are followed; a requirement under a condition that cannot be evaluated is reported as undecided, and a variable whose value cannot be known is named. Against Conan Center's live recipes on Linux and macOS: zlib, bzip2, sqlite3, libcurl and raylib resolve every CMake variable (3/4/33/39/18) with none unknown, and their requirements (libcurl: openssl, zlib; raylib: glfw, opengl/system) with none undecided.
A unified-diff applier for source builds: -p1 paths, several hunks per file, hunks located at the stated line or the nearest exact match, CRLF sources, new files. A hunk whose context is not there, a target that is not in the source, and a deletion are errors that name the file.
`with get c.X` on a platform with no linkable binary (every package on linux-aarch64), or with --from-source: 1. conandata.yml gives the archive, its sha256 and the patches; the archive is downloaded and checked, extracted (tar; unzip for a zip under GNU tar), and the patches applied by ConanPatch. 2. conanfile.py gives the requirements, which are installed first (a version range asks for the newest release), and the CMake variables; both only under the `if`s that hold for the default options on this platform. An assignment under `if self.settings.os == "Android"` set raylib's PLATFORM to Android before the conditions were honoured. 3. The project's own CMakeLists.txt, or the one the recipe exports for it, is configured and built by cmake and ninja with `with cc` as the C compiler and `with ar` / `with ranlib` as the archiver, static, Release, installed into the dependency directory. The build keeps going past a test program that does not link; the install step is what must succeed. 4. The installed tree is scanned by the code that scans a Conan binary, and the lock records source "built" with the archive's digest; a restore rebuilds the same version or says the recipe's digest moved. What the machine lacks is named before anything is downloaded: cmake and ninja (PATH, or WITH_CMAKE / WITH_NINJA), an unreadable archive format. A package whose build is not CMake says which build system it is (OpenSSL: "its own Configure script, which needs Perl"). `with cc` passes the macOS SDK c_import resolves when none is named. darwin-arm64, no package-specific line anywhere: zlib 1.3.2 (one patch), bzip2 1.0.8 (the recipe's CMakeLists, 4 variables), sqlite3 3.53.4 (a zip, 33 variables), glfw 3.4 and raylib 6.0 (raylib requires glfw and opengl/system) build; the release UAT programs for bzip2, sqlite3 and the raylib spiral link them and pass.
CI on #1208: - linux-x86_64, windows-x86_64: "embedded clang header set is not closed: intrin.h includes intrin0.h". The x86 intrinsics were chosen by a name rule. The set is now closed by construction: starting from the rule's headers, every builtin header an embedded one includes is added until nothing new turns up. - linux-x86_64: sdk-clang-main looked in .deps while CI's SDK is LLVM_PREFIX. It reads the prefix the compiler link reads. - windows-x86_64: "'clang/Driver/Driver.h' file not found". A packaged SDK has no headers, so the driver cannot be compiled against it. That case is now one error saying the SDK predates `with cc` and must be republished.
added 2 commits
September 19, 2026 02:56
The published SDK assets have libraries and tools but no LLVM or clang headers, so the driver archive cannot be built against them, and every CI leg failed at sdk-clang-main. Rebuilding LLVM for five platforms happens on machines this branch cannot reach, so the compiler has to link against the SDKs that exist. sdk-clang-main records what the SDK has (linked / absent). From that one marker: the link aliases with_clang_main to clang_main, or to a stand-in (with_alloc) that is never called; and the generated clang resource module says embedded_clang_driver_linked(). `with cc` and a source build check it and report "this build of `with` has no C compiler: the LLVM SDK it was linked against predates `with cc`". A platform gains the feature when its SDK is republished with the archive (build/sdk.w makes it when an SDK is built from source). Telling the two apart by address does not work: LLVM folds a comparison of two distinct function symbols to "not equal", the stand-in was called, and `with cc` exited 224 with no message. Verified on darwin by hiding the archive and the headers: the compiler links, `with cc --version` reports the missing compiler with exit 127; with them back, it is clang 22.1.6 again.
CI, linux-aarch64: that leg's SDK does have headers, so sdk-clang-main went
on to fetch the driver sources, and its HTTPS helper — a With program built
by the pinned seed — does not link there ("undefined symbol:
with_vec_append_bytes"). `with get` already downloads with curl; the four
files are checked against pinned sha256 digests either way. The archive's
existence is tested by host path, since the SDK prefix is now the absolute
one the link uses.
ehartford
added a commit
that referenced
this pull request
Sep 19, 2026
…ort speed, Conan selection, no OpenSSL UAT (#1209) * Link the user's libraries as one group on ELF targets GNU ld and lld resolve static archives left to right, once. A package's libraries arrive in scan order (conan_scan_libraries sorts them, so crypto precedes ssl), and both ELF link paths emitted -l<lib> in that order with no grouping: libcurl's UAT failed on linux-x86_64 with libssl.a's references into libcrypto.a undefined (OCSP_SINGLERESP_get1_ext_d2i, CT_POLICY_EVAL_CTX_*; Release run 35388740596). ld64 is order-insensitive, so darwin linked. The user's libraries are now wrapped in --start-group / --end-group on the compiler-driver path (-Wl, spelling) and on the direct lld plan. Ordering by the package graph would fix OpenSSL but not a package whose own archives depend on each other. Fixes #1193 * Embed clang 22's __float_*.h and refuse an unclosed header subset clang 22 split its builtin float.h into __float_float.h, __float_header_macro.h and __float_infinity_nan.h. cr_should_embed knew the __stddef_ and __stdarg_ prefixes but not __float_, so float.h shipped without its parts and any c_import that reached <float.h> failed with "'__float_header_macro.h' file not found" (CoreFoundation.h does). The embed action now scans each embedded header's #include lines and fails when one names a builtin sibling the subset leaves out. With the prefix removed it reports "float.h includes __float_header_macro.h" under the pinned seed; with it, the scan is clean. Fixes #1198 * Probe a header's macros in one parse and index declaration names once c_import cost (macros + pointer uses) x header size: - Every object macro of a non-system header that was not a plain literal got a libclang parse of the whole header to itself (ci_try_translate_object_macro_probe). On the Windows release legs each of those parses re-reads windows.h; `with run` of the bzip2 and libcurl UAT projects hit the 180 s limit. The minidumps CI kept show the main thread waiting on libclang's parse thread, or inside the scans below. All candidate macros are now probed by one parse, opened on first use. The parse no longer stops at the first error: errors are attributed to the probe line they sit on, and an error anywhere else voids every probe, as it did before. A macro that leaves a delimiter open is kept out of the batch and parsed alone, so it cannot swallow its siblings. - ci_type_decl_name_exists, ci_record_definition_exists and ci_prepopulate_names scanned every declaration, allocating its spelling, per query. One pass per session now records which kinds of declaration carry each name (the pattern of ci_fn_decl_index_ensure). Synthetic header, N typedef'd structs + functions + macros, check wall time: N=1000/2000/4000 was 8/29/120 s, is 7/8/16 s (7 s is stage1's fixed cost). The translated text of curl/curl.h, sqlite3.h, OpenGL/gl3.h, zlib.h, bzlib.h, stdio.h and the synthetic header is byte-identical to the previous compiler's. * Key the materialized clang header cache by its contents The embedded builtin headers are written once to <cache>/with/clang-resource/<clang major>/ and a stamp file short-circuits every later run. The directory name did not depend on what was embedded, so a compiler with a different header set kept using the old directory: the fresh release binary still failed behav_c_import_float_h.w with "'__float_header_macro.h' file not found" against a cache written by an earlier compiler, and every existing user would have after upgrading. The directory is now <major>-<hash of the listing and every header's bytes>, the identity ensure_clang_resource_identity_file already wrote. Refs #1198 * Pick a Conan binary the toolchain can link conan_find_matching_package took the first static package whose os and arch matched. For openssl/4.0.2 on Windows x86_64 ConanCenter lists an msys2 clang 21 build before the msvc ones; it ships libcrypto.a, whose library name is `crypto`, and the windows-msvc link failed with "lld-link: could not open 'crypto.lib'" (release validation 35420376179). armv8 lists only msvc builds, which is why that leg linked. A package now also has to be a Release build when it has build types (an msvc Debug build wants the debug CRT) and, on Windows, an msvc build. The choice is a pure function over the search listing, tested against that listing's order. Fixes #1204 * Read float.h through C constants; show what a failed expectation saw behav_c_import_float_h.w asserted FLT_RADIX and DBL_DIG directly. float.h defines them as aliases of compiler builtins, and c_import does not probe a system header's macros, so they are not With names; the test now reads them through two C constants. With the content-keyed header cache it passes on the release binary. bs_assert_contains printed the needle and nothing else. Release validation 35423258758 failed on linux-x86_64 with "missing expected output for build_w_workspace_bad_cwd: bad cwd prelink missing"; the same commit passes that target on linux-aarch64 and windows, and the log holds no evidence of what the command printed. The message now ends with the last 2000 bytes of the actual text. * Remove the OpenSSL release UAT Eric, 2026-09-19: OpenSSL cannot be a UAT. Where Conan Center has no binary it has to be built from source, and its build needs Perl; a release UAT must not require installing Perl. `with get c.openssl` still works wherever a binary exists, and a source build that lacks a prerequisite will name it. libcurl's UAT stays: it validates `with get` resolving a requirement (openssl, zlib) on the legs that have binaries. * Parse an #include line without str.trim CI, linux-aarch64: "action target 'embedded-clang-resource-source' failed during comptime evaluation: str method 'trim' is not comptime-evaluable yet". That leg's pinned seed evaluates this action at comptime. The line parser now uses indexing, slice and starts_with only, like the rest of the build layer. * with get builds a Conan package from source when there is no binary; with cc (#1208) * Add `with cc`: clang's driver linked into the compiler with get has to build a C library when no binary exists for the platform (ConanCenter publishes no Linux armv8 binaries at all), and the toolchain does not trust a system compiler. LLVM's backends are already in the binary; the four objects of clang's driver tool (lib/libclangMain.a in the SDK) add clang_main, called through one extern. The builtin headers come from the embedded resource dir. A multi-job compile re-executes `with cc -cc1` through llvm::ToolContext. darwin-arm64 stage1: 107 MB -> 125 MB. Compiles and runs a C program, cross-compiles an aarch64 ELF object, and a two-file compile exercises the re-exec path. * Build libclangMain into the SDK and alias clang_main per linker The SDK build archives the objects of clang's driver tool (driver, cc1_main, cc1as_main, cc1gen_reproducer_main) from the LLVM build tree into lib/libclangMain.a (clangMain.lib on Windows), where the compiler link already takes every clang archive, and the SDK package check requires it. clang_main is a C++ symbol, so its spelling differs between the Itanium and Microsoft manglings. The source declares one plain extern, with_clang_main; the per-OS section of the compiler link aliases it (ld64 -alias, ELF --defsym, COFF /alternatename) and forces the archive member in. The MSVC name was checked with llvm-undname: int __cdecl clang_main(int, char **, struct llvm::ToolContext const &). Verified by linking and running on darwin-arm64; Linux and Windows need their SDKs rebuilt first. * Parse a C port description A port tells `with get` how to build a C library from source: where the tarball is and its sha256, which files to compile, the include dirs and defines, per-OS additions, and the library it produces. It is data; nothing fetched is executed. Unknown keys, a missing field, or a malformed sha256 are reported, not skipped. * Build a C package from its port when Conan Center has no binary `with get c.X` fell back to compiling every .c file in the recipe's tarball with the system `cc`, and gave up on any recipe with patches, a configure step or requirements — zlib already. It also could not be locked (the lock wants conan_package.tgz), so it never completed for anything. Now: no linkable binary -> the library's port (ports/<name>/port.toml, or WITH_PORTS_DIR for a local registry). The tarball is checked against the port's sha256, overlay files are written, the selected sources are compiled by `with cc`, archived, and described by the same metadata.json a binary package gets. The lock records source "port" and the tarball digest; a restore rebuilds the same version or says what moved. A missing port is one error naming the platform and the package. `with get --from-source` takes this path on a platform that does have binaries. First port: zlib 1.3.2. On darwin-arm64 `with get --from-source c.zlib` builds 15 files into libz.a and the release UAT's zlib program links it statically and prints "zlib UAT passed". * Port bzip2 1.0.8 and sqlite3 3.53.4 Both build with `with get --from-source` on darwin-arm64 and the release UAT programs for them link the result and pass. bzip2 compiles the seven library files (not the bzip2/bzip2recover programs); sqlite3 compiles the amalgamation with the features Conan Center's build enables. * Add the clang driver archive to an SDK that was fetched without it A packaged SDK from `with build :deps` predates `with cc`, and rebuilding LLVM to add four objects is hours per platform. The driver needs only the SDK's installed headers. `sdk-clang-main` (a dependency of stage1) fetches driver.cpp, cc1_main.cpp, cc1as_main.cpp and cc1gen_reproducer_main.cpp from the llvmorg-<version> tag, checks them against pinned sha256 digests (they match the release tarball's), compiles them with the SDK's clang++ and archives them as lib/libclangMain.a. It does nothing when the archive is there, which is the case for an SDK built from source. Run under the pinned seed on darwin-arm64: 89 s, and the compiler links against the result. The same four compiles were done by hand against the packaged linux-aarch64 SDK and define clang_main. * Port raylib 6.0; a port can pass link arguments through raylib builds as its own Makefile does for PLATFORM_DESKTOP_GLFW with the bundled GLFW. macOS needs frameworks, which are link arguments rather than -l names, so [link] gains link_args; GLFW's Cocoa sources are Objective-C, which a [build.macos] cflags entry selects. * Embed the host architecture's SIMD intrinsic headers The embedded clang headers were chosen for parsing a header for c_import and left every intrinsics header out. `with cc` compiles real C: raylib's stb_image_resize2.h includes <arm_neon.h> and rtextures.c did not compile. A port builds for the host, so the host architecture's intrinsic headers are embedded (arm64 5.7 MB, x86_64 4.2 MB); other architectures' and Arm's M-profile ones are not. The pinned seed generates the 5.9 MB module in 1.2 s and the include-closure check passes. With it, `with get --from-source c.raylib` builds libraylib.a on darwin-arm64 and the release UAT's spiral program links it, opens its GL window and prints "raylib spiral UAT passed". * Replace per-package ports with a reader for Conan recipes as data Eric: no special-case files per Conan package. The port format, its parser and the four port files are gone. What decides how a package builds is the package's own build system; what a source build needs to know generically is in the recipe Conan Center already publishes, read as data and never run: - conandata.yml: the version's tarball URL (first of a mirror list), sha256 and patch files. - conanfile.py: `self.requires(...)`, `default_options`, and the `tc.variables[...] = <expr>` assignments, evaluated when the expression is a literal, the version or one of its components, the source folder, or a boolean option's default; anything else is listed as unknown. Against the live recipes: zlib, bzip2, sqlite3, libcurl and raylib all yield a source URL and digest and 3/4/29/31/16 known CMake variables, with 0/0/7/8/2 unknown — every unknown is an expression over option defaults or platform settings, the next thing to evaluate. openssl has no CMake build. `with cc`, --from-source, the header fixes and the sdk-clang-main target stay. The source build itself is a stub that says so; the lock's "port" source is kept for the entry it will write. * Evaluate a recipe's expressions against its option defaults and the host A recipe decides its requirements and CMake variables with Python expressions over options and platform settings. With every option at its declared default and the host as the platform, the subset recipes use has a value without running anything: literals, ==, !=, in / not in, and / or / not, the conditional expression, str(), bool(), .replace(), get_safe(), is_apple_os(), Version(self.version).major, self.settings.os/arch/build_type. `shared` is always False. if / elif / else chains around `self.requires` are followed; a requirement under a condition that cannot be evaluated is reported as undecided, and a variable whose value cannot be known is named. Against Conan Center's live recipes on Linux and macOS: zlib, bzip2, sqlite3, libcurl and raylib resolve every CMake variable (3/4/33/39/18) with none unknown, and their requirements (libcurl: openssl, zlib; raylib: glfw, opengl/system) with none undecided. * Apply a recipe's patches without a patch program A unified-diff applier for source builds: -p1 paths, several hunks per file, hunks located at the stated line or the nearest exact match, CRLF sources, new files. A hunk whose context is not there, a target that is not in the source, and a deletion are errors that name the file. * Build a Conan package from source when Conan Center has no binary `with get c.X` on a platform with no linkable binary (every package on linux-aarch64), or with --from-source: 1. conandata.yml gives the archive, its sha256 and the patches; the archive is downloaded and checked, extracted (tar; unzip for a zip under GNU tar), and the patches applied by ConanPatch. 2. conanfile.py gives the requirements, which are installed first (a version range asks for the newest release), and the CMake variables; both only under the `if`s that hold for the default options on this platform. An assignment under `if self.settings.os == "Android"` set raylib's PLATFORM to Android before the conditions were honoured. 3. The project's own CMakeLists.txt, or the one the recipe exports for it, is configured and built by cmake and ninja with `with cc` as the C compiler and `with ar` / `with ranlib` as the archiver, static, Release, installed into the dependency directory. The build keeps going past a test program that does not link; the install step is what must succeed. 4. The installed tree is scanned by the code that scans a Conan binary, and the lock records source "built" with the archive's digest; a restore rebuilds the same version or says the recipe's digest moved. What the machine lacks is named before anything is downloaded: cmake and ninja (PATH, or WITH_CMAKE / WITH_NINJA), an unreadable archive format. A package whose build is not CMake says which build system it is (OpenSSL: "its own Configure script, which needs Perl"). `with cc` passes the macOS SDK c_import resolves when none is named. darwin-arm64, no package-specific line anywhere: zlib 1.3.2 (one patch), bzip2 1.0.8 (the recipe's CMakeLists, 4 variables), sqlite3 3.53.4 (a zip, 33 variables), glfw 3.4 and raylib 6.0 (raylib requires glfw and opengl/system) build; the release UAT programs for bzip2, sqlite3 and the raylib spiral link them and pass. * Close the embedded header set by inclusion; read the SDK the link reads CI on #1208: - linux-x86_64, windows-x86_64: "embedded clang header set is not closed: intrin.h includes intrin0.h". The x86 intrinsics were chosen by a name rule. The set is now closed by construction: starting from the rule's headers, every builtin header an embedded one includes is added until nothing new turns up. - linux-x86_64: sdk-clang-main looked in .deps while CI's SDK is LLVM_PREFIX. It reads the prefix the compiler link reads. - windows-x86_64: "'clang/Driver/Driver.h' file not found". A packaged SDK has no headers, so the driver cannot be compiled against it. That case is now one error saying the SDK predates `with cc` and must be republished. * Link without clang's driver when the SDK predates `with cc` The published SDK assets have libraries and tools but no LLVM or clang headers, so the driver archive cannot be built against them, and every CI leg failed at sdk-clang-main. Rebuilding LLVM for five platforms happens on machines this branch cannot reach, so the compiler has to link against the SDKs that exist. sdk-clang-main records what the SDK has (linked / absent). From that one marker: the link aliases with_clang_main to clang_main, or to a stand-in (with_alloc) that is never called; and the generated clang resource module says embedded_clang_driver_linked(). `with cc` and a source build check it and report "this build of `with` has no C compiler: the LLVM SDK it was linked against predates `with cc`". A platform gains the feature when its SDK is republished with the archive (build/sdk.w makes it when an SDK is built from source). Telling the two apart by address does not work: LLVM folds a comparison of two distinct function symbols to "not equal", the stand-in was called, and `with cc` exited 224 with no message. Verified on darwin by hiding the archive and the headers: the compiler links, `with cc --version` reports the missing compiler with exit 127; with them back, it is clang 22.1.6 again. * Fetch the clang driver sources with curl CI, linux-aarch64: that leg's SDK does have headers, so sdk-clang-main went on to fetch the driver sources, and its HTTPS helper — a With program built by the pinned seed — does not link there ("undefined symbol: with_vec_append_bytes"). `with get` already downloads with curl; the four files are checked against pinned sha256 digests either way. The archive's existence is tested by host path, since the SDK prefix is now the absolute one the link uses. --------- Co-authored-by: Eric Hartford <[email protected]> --------- Co-authored-by: Eric Hartford <[email protected]>
ehartford
added a commit
that referenced
this pull request
Sep 19, 2026
… D45, D46 (#1212) * Main is red after #1205 and #1207: two behavior tests Both merged before their batteries ran. A battery on main (f5cba02) fails behav_tls_module_compiles.w and behav_error_handling.w. #1205: the "return type of 'X' was not known here" report fired on `i31_reduce_once(x, m, mlen)` in std/crypto/bigint.w. That call is a statement: its value is discarded, so the placeholder type cost it nothing. A block now marks the statement it is checking, and a call in that position is not recorded. A call that is a block's tail still is — under D43 the tail is the function's type. #1207: `for s in inputs` over an array of str now binds `&str` (traversal observes), and the test passed `s` to `parse_positive(s: str)`, which only reads it. The function takes `&str`, as an observer should (§3.8). * Hoist only the callee; traverse sequences the same way in comprehensions The battery on the first fix found two more tests red on main. err_thread_spawn_closure_captures_ref.w (#1205): checking every unannotated function first put `bad` ahead of std.thread.spawn_os, whose body gives its closure parameter the escape effect `bad`'s call is judged by, so a weaker diagnostic fired. Bodies are checked in declaration order again; a function that takes its type from its body is checked before the first declaration that calls it, and nothing else moves. The calls come from the AST: nodes are appended children first, so a declaration's subtree is the ids between it and the nearest declaration node below it. A chain of unannotated functions now types (it was reported before); a cycle gets D43's "cannot infer return type ... add `-> T`". spec_ss13_6_comprehensions.w (#1207): lower_comprehension_slice was a copy of lower_for_slice's setup with the same defects — it moved the iterable, took RK_LEN through projections and copied Drop-class elements — while Sema now binds views. The receiver, length and element binding are shared helpers, used by both. A map comprehension stores what it builds: a `&T` key or value with T: Copy materializes a T (D22); a view of a Drop-class value is an error that says to clone it, where it said "`&str` must implement Hash". The test's str keys are cloned; on the pinned seed the same comprehension over a Vec[(str, i32)] already failed, and the array form only passed by making the map a second owner of the array's strings. * The archiver is the compiler invoking itself; record D45 spec-inventory-check on main: "implementation has unspec'd ar / cc / ranlib / --from-source" (from #1208, which merged without a battery). `ar` and `ranlib` are what a CMake build asks of an archiver, not commands a user types: they are `with __ar` and `with __ranlib`, the prefix the inventory already treats as the compiler invoking itself. `with cc` and `with get --from-source` are user surface and wait for spec words. D45 (Eric, 2026-09-19): a copy is never implicit unless it is O(1). The comprehension fix in this branch follows it; #1211 tracks the measurement that could reopen it. * Spec: `with cc`, source builds, and cloned comprehension elements (blessed) Eric blessed this wording on 2026-09-19. §18.5 lists `with cc`. §18.8 lists `with get --from-source c.X` and says how `with get` builds a package from source when Conan Center has no linkable binary: the recipe read as data, the package's own CMake build under `with cc`, installed and locked like a binary package, and a missing tool named rather than worked around. §13.6's examples that build owning collections of `str` from views clone their elements, and the section says why (D22, D45). The inventory checker lists `--from-source` beside `--force-reinstall`: a `with get` flag, documented in §18.8. D46 records the source-build decisions and what was rejected. --------- Co-authored-by: Eric Hartford <[email protected]>
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.
with getbuilds a C package from source when Conan Center has no binary the toolchain can link — every package on linux-aarch64 (Conan Center publishes no Linux armv8 binaries) — or with--from-source. Nothing in it knows any package, and nothing from a recipe is executed.Based on #1209 (the follow-ups that missed #1191); retarget to main when that merges.
with cc— clang 22's driver linked intowith(darwin stage1 107 → 125 MB). One plain extern, aliased to the mangledclang_mainper linker (ld64-alias, ELF--defsym, COFF/alternatename; MSVC spelling checked withllvm-undname). Builtin headers from the embedded resource dir, the macOS SDK c_import resolves, host SIMD intrinsic headers embedded (raylib needsarm_neon.h).with ar/with ranlibso a build needs no binutils.build :sdk-clang-main(dependency of stage1) — a packaged SDK has no clang driver archive; this fetches clang's four driver sources from the llvmorg tag (sha256-pinned, equal to the release tarball's), compiles them with the SDK's clang++, archiveslib/libclangMain.a. No LLVM rebuild on any platform.A recipe read as data (
ConanRecipe.w):conandata.ymlarchive/sha256/patches;conanfile.pyrequirements,default_optionsandtc.variables[...], evaluated against the option defaults and the host, only under theif/elif/elsethat hold.ConanPatch.w: a unified-diff applier.The build (
conan_install_from_source): download + verify, extract, patch, install requirements first, configure the project's own CMakeLists (or the one the recipe exports) withcmake+ninja+with cc, static/Release, install into the dependency dir, scan it like a Conan binary, lock as"source": "built"with the archive's digest. Prerequisites the machine lacks (cmake,ninja; an unreadable archive format) are named before anything is downloaded; a non-CMake package says what its build needs (OpenSSL: Perl).Verified on darwin-arm64, no package-specific line anywhere: zlib 1.3.2 (one patch), bzip2 1.0.8 (recipe CMakeLists, 4 variables), sqlite3 3.53.4 (zip, 33 variables), glfw 3.4 + raylib 6.0 (requirement chain,
opengl/system); the release UAT programs for bzip2, sqlite3 and the raylib spiral link them and pass.The history keeps an earlier per-package
port.tomlattempt and its removal (Eric: no special-case files per package).Open, stated rather than hidden
cmakeandninjacome from PATH (orWITH_CMAKE/WITH_NINJA). Fetching them on first use from our own release assets is not done.:testexercises the source build (it needs the network); the linux-aarch64 release UAT legs will exercise it naturally once this lands. A--from-sourceUAT for the other legs is not added: it would make the UAT depend on cmake/ninja being installed.with cchas no libc++ headers embedded; a C++ project fails at configure with CMake's message.Battery: darwin battery queued behind #1209's; linux-aarch64 container run (the natural no-binary path for zlib, bzip2, sqlite3) in progress. I will update this section with both results.