Skip to content
SkunkWerkxPublic

About

HyperForge — the shared foundry behind SkunkWerkx's Hyper* projects (HyperUuid, HyperCast, and what's next): reusable 5-platform CI pipelines that prove one Rust core against every language binding's real test suite, scaffolding conventions for new bindings, and the build archaeology — learned once, banked here, never re-learned.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

HyperForge

The shared foundry behind SkunkWerkx's Hyper* projects (HyperUuid, HyperCast, and the ingestion round's HyperTabular, which reads delimited text and XLSX, ODS and Apple Numbers workbooks): reusable CI pipelines, 5 real-hardware platforms plus the two musl RIDs and a cross-built Intel macOS, that prove one Rust core against every language binding's real test suite, scaffolding conventions for new bindings, and the build archaeology — learned once, banked here, never re-learned.

The pipeline

hyper-build-native.yml is the canonical build: the Rust core compiled fresh on 5 real-hardware legs (linux and windows on x64 and arm64, macOS on arm64), then every binding's actual test suite run against that leg's freshly-built native library — proving the real FFI load/marshalling path per OS, which cargo test alone cannot exercise. Ruby's suite runs twice per leg: once forced onto its zero-compile Fiddle fallback, once on the Magnus extension, built and staged on every leg — both Windows legs included, via the gnullvm targets. Python has no fallback: the PyO3 extension is built and tested per leg, and built and tested again for free-threaded CPython (python_freethreaded_version, 3.15t), where it must leave the GIL off. Each leg is one job, except on Windows, where Swift and Ruby run in a second job beside the rest — Windows alone held the critical path, and its runners do not count against GitHub's five-concurrent-macOS cap — and the installed Swift toolchain is cached whole, so a run skips setup-swift's two-minute copy of it into the tool cache.

A second job in the same workflow, build-native-musl, covers linux-musl-x64 and linux-musl-arm64. It builds the core inside a real Alpine container through the musl-native action (whose build-musl.sh runs unchanged on a developer's machine with Docker), runs the crate's own suite there, uploads and attests the library as native-{rid} like the matrix legs, and runs the bindings that have a musl story against it on Alpine — Ruby's Magnus extension included, built once per Ruby ABI inside that Ruby's own ruby:*-alpine image through the ruby-magnus-musl action and uploaded as ruby-native-{rid}-{abi} for the caller's musl platform gems. It is a separate job rather than two more matrix rows because the five-leg job installs every toolchain with setup-* actions, and most of those do not target Alpine. With java_jni on (and jdk_floor_version naming the floor JDK), the Java legs, the osx-x64 job and this Alpine job build the Java binding's JNI shim (java/jni) beside the core, run test, testFloor and checkSuiteParity on the primary and the floor JDK, and upload and attest each shim as jni-{rid}; hyper-pack-maven.yml and hyper-publish-maven.yml take java_jni too, staging those shims into the jar and checking it lists both libraries per RID and is multi-release, and hyper-check-core.yml's lint_java_jni lints the shim. All three inputs are off by default.

A third job, build-native-osx-x64, is what is left of the Intel macOS leg. It cross-compiles the core for x86_64-apple-darwin on the Apple silicon runner, runs the crate's own suite on it under Rosetta 2, and uploads and attests the library as native-osx-x64, so every package still carries it. No Magnus extension is built for it: Ruby there installs the universal gem and runs on Fiddle over this library.

A fourth, build-php-extension, calls hyper-build-php-extension.yml: the PHP binding is a Zend extension (the crate's php feature, ext-php-rs) that PIE installs from a pre-packaged zip per platform, PHP minor and thread safety on the GitHub Release, so it is built against every PHP it ships for, one job per (platform, minor, NTS or ZTS): six platforms (every RID but win-arm64, where PHP runs as an x64 process, and osx-x64, for which no PHP is packaged) by each minor in php_versions, both ways (ZTS from setup-php's phpts, the tap's -zts formulae and the official php:<minor>-zts-alpine image). Each job checks its PHP is the thread safety it is named for, load-checks the extension into it, runs the binding's suite through it, packs the zip and checks its name against PIE's own code (php_ext_package.py), and uploads it as php-ext-{rid}-{minor}, or php-ext-{rid}-{minor}-zts for ZTS, attested in release mode. win-x64 builds with RUSTC_BOOTSTRAP=1 on its build step alone, for ext-php-rs's unstable abi_vectorcall; a TS Windows PHP is php8ts.dll, and a crate whose own extern blocks name the engine's library has its build.rs ask the same PHP which to link. A crate whose extension needs another's loaded beside it names that crate in php_companions (HyperTabular passes hypercast): php_ext_companions.py builds each, on every leg, from the registry source of the one version the crate's Cargo.lock pins (never a path or git source), and the suite gets it as {COMPANION}_PHP_EXTENSION (with a companions block in .github/hyper.json the block names them, and outside a release the extension comes from the pinned run instead, below); a companion is neither load-checked as the crate, packed nor attested, and on win-x64 it builds inside that same build step. At the tag, the publication gate takes every php-ext-* artifact of the release-mode run into the inventory's php/ group (exactly the names release_inventory.py's php_asset_names gives, each with the Forge's build provenance), and the finalizer attaches them to the GitHub Release, where PIE looks. hyper-pie-acceptance.yml, the last job of a consumer's release.yml, then has PIE itself install the extension from Packagist and that Release on every platform, minor and thread safety, on a runner or container holding PHP and the pinned PIE only, and checks it from a fresh php, the installed file included: it must be the entry of that leg's zip on the Release, whose release attestation the leg verifies first; it is also dispatchable against a scratch repository's Release, the rehearsal before a first release.

Two more reusable workflows, hyper-build-static.yml and hyper-test-swift-static.yml, which a caller runs as top-level jobs of its own so that whatever needs their output starts as soon as it exists rather than when the native matrix finishes, cover the two bindings that link the core instead of loading it: Swift on every RID and WebAssembly, and a C# Native AOT publish on every RID. (Go neither loads nor links it: its binding carries the core as committed Go source, translated by wasm2go from the crate's wasm32-wasip1 build, which hyper-check-core.yml's lint-go regenerates and diffs and hyper-prepare-release.yml regenerates at the version.) The first builds nine no_std static libraries through the static-libs action — every target, macOS and Windows included, cross-compiled on one runner, since a static library is never linked — and uploads and attests them as static-libs, laid out by repository path. A caller's stage-native-binaries.yml commits the Swift ones (swift/{Project}Core.artifactbundle), and hyper-pack-nuget.yml packs the C# ones. A caller whose .github/hyper.json sets swift_remote commits none: the job zips the Swift bundle and XCFramework it built, uploads and attests them as swift-release-assets, staging writes the release's version and the two zips' SHA-256 into the root Package.swift (which names them by URL and checksum), and the release attaches the same bytes to the GitHub Release. A caller that sets c_assets also attaches one C archive per platform (header, shared and static libraries, CMake and pkg-config files from its c/): c_package.py packs them from the run's native-* and static-libs artifacts, deriving Windows' import library from the DLL's own exports; hyper-test-c.yml packs them in CI and builds the caller's c/smoke/ consumer against each desktop archive on its own runner (in pr mode without osx-x64, whose library only a release-mode build makes), and the pack-c action packs, verifies and attests them at the tag. The second downloads that artifact on each architecture and runs the Swift binding against it through the swift-static-suite action, in Swift's own containers: a glibc consumer, the static Linux SDK and the WebAssembly SDK on the current Swift — the WebAssembly smoke executable also in headless Chrome through a pinned WASI shim — then glibc, musl and WebAssembly again on the declared floor. On macOS and Windows the matrix legs' own archives go straight into the Swift bundle, so swift test there links this commit's core too. C# is tested where its toolchain already is: every leg of the matrix job and of the musl job builds its own target's archive first and links it in its own suite. All three scripts run unchanged on a developer's machine. A caller that sets apple_mobile on hyper-build-static.yml gets four more archives from the same job (iOS, the iOS simulator on Apple silicon, and Mac Catalyst on both architectures): the C# ones under csharp/{Project}/staticlibs/ by .NET RID, and Swift's three arm64 ones as swift/{Project}CoreApple.xcframework, written whole, Info.plist and headers included, because xcodebuild -create-xcframework only exists on a Mac. Linking and running them takes Xcode, a simulator and the .NET workloads, which no leg here carries, so that is the caller's own job. Android, arm64 and x86_64, takes two calls: hyper-build-android.yml, likewise a caller's own job, cross-builds the shared library a C# app on CoreCLR loads out of its APK with the runner's NDK, checks each is the right architecture, 16 KB-aligned (Android 15's page size, which Google Play requires) and exporting the core, and uploads and attests them as native-android-{rid} for hyper-pack-nuget.yml's android input to pack under runtimes/{rid}/native/; and hyper-build-static.yml with android set adds the two archives for everything that links the core in — C#'s Native AOT under csharp/{Project}/staticlibs/, and Swift's bundle as *-unknown-linux-android variants for the Swift SDK for Android. Running them takes an emulator, the .NET android workload and the Swift SDK for Android, so that too is the caller's job.

A second family splits the same work one reusable workflow per concern, for a consumer whose pull-request board runs only what the pull request touched (every consumer's ci.yml is a working example; the workflows above have no caller left): hyper-core.yml builds the core on the seven RIDs, runs the crate's suite and the glibc floor, checks the cdylib's exports and smokes the C archive on the leg that built it, and uploads native-{rid}; hyper-core-checks.yml runs hyper-check-core.yml's source-level checks in one job on three hosts; and eight hyper-test-{binding}.yml run, on request, one binding's linters on one leg ahead of its suite, and that suite on the five desktop hosts and the two musl RIDs, downloading only what the binding loads. hyper-test-c.yml's smokes and lint inputs switch off the two things that family does elsewhere, musl-native's core input builds the Java shim without a second core, and hyper-build-php-extension.yml's pr_legs: two-paths trims a PR's PHP to one glibc leg and two Windows legs, NTS on the floor and ZTS on the newest minor. Every runner label in the family is explicit (ubuntu-26.04, ubuntu-26.04-arm, xcode-27, windows-2025-vs2026, windows-11-vs2026-arm), and the images' own toolchains are used wherever they are the current release. The Forge's CLAUDE.md lists each workflow's inputs and artifacts.

A consumer built on another Hyper* crate (HyperTabular on HyperCast) tests its board against a pinned commit of that companion, never its registries: .github/hyper.json's companions block names the companion's repository, a commit, and the green full-board run of its ci.yml that proved it (companion_pin.py checks a run and moves the pin). The consumer's ci.yml calls hyper-companions.yml once, as companions, and every job that calls a Forge board workflow needs it. In companion mode (every event but a purpose=release dispatch, read from the event by hyper_mode.py, since a reusable workflow never sees its caller's inputs) that job mints a token from the companion GitHub App, read-only on Actions and scoped to the companion's repository, re-checks the pin, downloads every artifact any leg takes from the pinned run and re-uploads them into the consumer's run as companion-<name>, sealed with SHA256SUMS (companion_mirror.py); it is the one job that holds the App's key. In release mode it mints nothing: it refuses any committed companion override, and companion_gate.py requires the version the consumer's manifests require to be live on every registry but CRAN, and on the companion's GitHub Release. Every leg of a board workflow runs the fetch-companions action once, before anything resolves the companion (companion_fetch.py): it takes its share of the mirror with the run's own token (companion_map.py is the one place that knows which artifacts a leg needs, held by a test against the Forge's upload names), checks the pinned source out into .companions/<name>/, rewrites the requirement in the job's tree only (companion_wire.py), and proves where the bytes came from, by path and, where the package manager records one, by hash (companion_origin.py, with the probes companion_ruby.rb, companion_php.php and companion_r.R, and Gradle's companion_java.init.gradle and companion_java_publish.gradle). A container that builds afresh gets the same override and proof from companion_container.sh, npm's through companion_npm.mjs. In release mode the action only guards. Every cache that could hold the companion is keyed with the pin's commit, job-local or off; Go's and npm's are content-addressed. The release runbook has moving a pin, the App's setup and the release order.

An excerpt of a Hyper* repo's CI file: HyperCast's .github/workflows/ci.yml, minus its comments, with one job of each kind (the file has 44; the elided ones follow the same pattern). Every Forge uses: is @master: a Forge merge reaches every Hyper* repo's next run at once, and a release run records the one Forge commit it resolved in its package inventory (see the release runbook):

name: CI — build native, build wasm, test every binding
run-name: ${{ github.event_name == 'workflow_dispatch' && format('CI purpose={0}', inputs.purpose) || '' }}
on:
  pull_request:
  workflow_dispatch:
    inputs:
      purpose:
        description: "board: the board alone; release: the board, then the release tail"
        required: true
        type: choice
        options:
          - board
          - release
  schedule:
    - cron: "0 6 * * 1"     # the whole release-mode board, weekly
permissions:
  contents: read
concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
  changes:                  # what the pull request touched, one output per class (pr_changes.py)
    # ...
  core:
    needs: [changes]
    if: needs.changes.outputs.docs_only != 'true'
    uses: SkunkWerkx/.github/.github/workflows/hyper-core.yml@master
    permissions:            # attestation signs with OIDC; a reusable workflow
      contents: read        # can never escalate beyond its caller's grant
      id-token: write
      attestations: write
    with:
      mode: ${{ github.event_name == 'pull_request' && 'pr' || 'release' }}
      crate: hypercast
      project: HyperCast
  core-checks:
    needs: [changes]
    if: needs.changes.outputs.core == 'true' || needs.changes.outputs.ci == 'true'
    uses: SkunkWerkx/.github/.github/workflows/hyper-core-checks.yml@master
    permissions:
      contents: read
    with:
      no_panic_command: cargo no-panic
      no_panic_runners: '["ubuntu-26.04"]'
      corpus_oracle: ""
      big_endian: s390x-unknown-linux-gnu
  test-csharp:
    needs: [changes, core, build-static]
    if: needs.changes.outputs.csharp == 'true' || needs.changes.outputs.core == 'true' || needs.changes.outputs.ci == 'true'
    uses: SkunkWerkx/.github/.github/workflows/hyper-test-csharp.yml@master
    permissions:
      contents: read
    with:
      mode: ${{ github.event_name == 'pull_request' && 'pr' || 'release' }}
      crate: hypercast
      project: HyperCast
      lint: ${{ github.event_name == 'pull_request' && needs.changes.outputs.lint_csharp == 'true' }}
      csharp_aot_project: csharp/HyperCast.AotSmokeTest/HyperCast.AotSmokeTest.csproj
      csharp_aot_frameworks: "net10.0 net11.0"
      csharp_test_project: csharp/HyperCast.Tests/HyperCast.Tests.csproj
      csharp_extra_runtime: "10.0"
      csharp_runtimes_dir: csharp/HyperCast/runtimes
  # ... build-static, build-android, the other suites, pack-c, build-wasm,
  # build-wheels, and the repo's own Apple-mobile, Android, NuGet and npm consumer tests
  nuget-org-pack:           # the release tail: only a purpose=release dispatch on master
    needs: [changes, forge]
    if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' && inputs.purpose == 'release'
    uses: SkunkWerkx/.github/.github/workflows/hyper-pack-nuget.yml@master
    permissions:
      contents: read
      actions: read
      id-token: write
      attestations: write
    with:
      crate: hypercast
      csproj_path: csharp/HyperCast/HyperCast.csproj
      runtimes_dir: csharp/HyperCast/runtimes
      android: true
      source_run_id: ${{ github.run_id }}
  # ... forge, the other pack jobs, release-prepare, codeql, stage-release
  pr-board:                 # the one status to read
    needs: [changes, core, core-checks, test-csharp, nuget-org-pack]  # ...and every other job
    if: always()
    runs-on: ubuntu-26.04
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Every needed job green, or skipped with its gate off
        env:
          NEEDS: ${{ toJSON(needs) }}
          CHANGES: ${{ toJSON(needs.changes.outputs) }}
          PURPOSE: ${{ inputs.purpose }}
        run: python3 .github/scripts/pr_board.py

HyperCast has no companions. A consumer whose .github/hyper.json has a companions block (above) adds one job, and every job that calls a Forge board workflow needs it:

  companions:
    uses: SkunkWerkx/.github/.github/workflows/hyper-companions.yml@master
    permissions:
      contents: read
    secrets:
      HYPER_COMPANION_APP_KEY: ${{ secrets.HYPER_COMPANION_APP_KEY }}
  core:
    needs: [changes, companions]
    # ...

A pull request runs the forge in pr mode: every leg, every binding's suite and every floor still run, so the corpus is proven in every binding the consumer enables on every platform, but nothing a release alone needs is built or signed — no attestations, no second Ruby ABI, no osx-x64 cross-build, none of the sixteen native wheels (the Pyodide wheel, and the sdist where hyper.json asks for one, still build and run their suites), no PHP extension but linux-x64 ZTS on the newest minor, no ruby.wasm (an interpreter build per Ruby minor, 7–10 minutes each), and no Apple-mobile job in the caller. Those ran on the PR critical path for packaging nobody would ship until the next release; on HyperCast run 37559419462 the Apple-mobile job alone held a board whose slowest leg finished at minute 16 open until minute 44. Every other event — the release's dispatched run and the weekly schedule — runs release mode, so the whole board is still exercised between releases rather than first on release day.

No push trigger, deliberately: the stage-native-binaries and prepare-release workflows direct-push mechanical commits, and a matrix run on each of those is wasted compute. The one push that does need a run is a release's version bump, and prepare-release.yml dispatches it explicitly (see "A library that reports its version" in the ledger). Beside the build, hyper-check-core.yml is every static check the repos used to carry inline, under one roof with one set of tool pins: the no_std and no-panic proofs, the C ABI held against every binding's declarations and against the built shared library on seven RIDs (every native RID but osx-x64), the corpus oracle, the crate's whole test suite on wasm32-wasip1 under a pinned wasmtime, an opt-in big-endian leg (big_endian, the same suite and corpus on s390x under QEMU), rustfmt and clippy, the MSRV, cargo-semver-checks against the last crates.io release, each binding's doc linter and formatter, and actionlint over the caller's own workflows. Every job has a toggle, so a repo states in its ci.yml why a check does not apply to it rather than silently lacking it.

Two more reusable workflows run in CI beside it: hyper-build-wasm.yml builds the wasm32 staticlib once for the NuGet package's browser-wasm asset, attesting it in release mode (it is built with -Zbuild-std, on stable with RUSTC_BOOTSTRAP=1 for that one step, and wasm_archive_guard.py then refuses any exception-handling instruction, and any feature but Binaryen's defaults, sign-ext and mutable-globals, which every .NET 10 wasm-opt run accepts with no flag), and, given blazor_check, rust_browser_test and go_tinygo_smoke, runs the C# binding's Blazor smoke app, the crate's own wasm-bindgen tests and the Go binding's smoke program — compiled by TinyGo for the browser from the committed Go core — in headless Chrome, given node_wasi, builds the TypeScript binding's napi-rs module for threadless wasm32-wasip1, runs the binding's whole suite against it with the native addon refused, packs the WASI npm package through npm_package.py and runs it bundled into a page in headless Chrome, attesting the module and its loaders in release mode; and with go_wasm_suite the Go binding's whole suite on its three WebAssembly runtimes (TinyGo on wasip1 under wasmtime with the repository mounted, and stock Go's js/wasm under Node and wasip1/wasm under wasmtime); given ruby_wasm_smoke and in release mode, it also builds the Ruby binding's Magnus extension for wasm32-wasip1 once per Ruby minor, attests and uploads each archive for the {crate}-wasm gem, and runs that gem linked into a ruby.wasm interpreter under Node and in headless Chrome, all through the ruby-wasm-suite action, whose script also runs on a developer's machine; and hyper-build-wheels.yml builds the 17 PyPI wheels — two on each of eight native platforms (abi3 for every CPython with the GIL, and PEP 803's abi3t for 3.15 and up, free-threaded or not), plus the Pyodide one (pyemscripten, for Python in the browser), whose whole pytest suite runs inside Pyodide under Node and in headless Chrome through the pyodide-suite action — installs each on its own platform and every interpreter it is for, calls into it, checks the GIL stays off on the free-threaded ones, and attests and uploads it for the release to publish unchanged (see "Build the package where a failure is cheap" in the ledger). A consumer whose .github/hyper.json sets "sdist": true gets an 18th file, the source distribution, built and installed at the crate's declared Rust floor on manylinux2014 and Alpine (one minor lower must fail), attested and uploaded the same way, and its fall-through to free-threaded 3.14 and PyPy is reported without blocking the run (free-threaded 3.13 is not tried: PyO3 refuses it); verify-wheels checks it with the wheels. The rest are the release side, called from each repo's release.yml at tag time: hyper-pack-nuget.yml verifies every native's build provenance, packs and attests the .nupkg, but never pushes it (nuget.org's Trusted Publishing validates the OIDC token against wherever the executing workflow file lives, so the push must stay in the caller); hyper-pack-crate.yml and hyper-pack-maven.yml package and attest the crate and the signed Maven bundle, with no registry credentials; hyper-publish-crate.yml and hyper-publish-maven.yml download and verify those exact bytes and upload them through crates.io's publish API and the Central Portal API — no cargo publish and no Gradle upload at publish time — packaging first through the prepare-crate-package and prepare-maven-package actions only when no prepared_run_id is given. The rest of a release is composite actions, run by the consumer's release.yml in its own identity so the gems, the inventory and the release attestation verify with --repo <owner>/<repo> alone and the Trusted Publishers accept the token: release-guard (the tag at B, B's trailers, the CI run, the CHANGELOG section, Swift dependencies on released versions only, and every committed native compared with the run's artifacts), pack-gems and verify-wheels, pack-npm (the ten npm tarballs, through the same npm_package.py the consumers' CI packs with; the root's dependencies and optionalDependencies injected at pack time on a copy, never committed) and pack-r (the CRAN source tarball, vendored and checked for the corpus files r_corpus in .github/hyper.json names, HyperUuid's five by default), release-gate (the inventory, its build provenance, and the release attestation: one actions/attest statement whose subjects are every registry file and every committed native and whose predicate is the inventory, release/v1), publish-nuget, publish-rubygems, publish-npm (the platform and WASI packages, then the root) and publish-pypi (which verifies and plans; the upload itself is pypa/gh-action-pypi-publish as a step of the consumer's own pypi-publish job, see "A container action nested in a composite" in the ledger), and finalize-release (the Go tag and the GitHub Release, its notes written from the CHANGELOG, with the CRAN tarball attached beside the Swift zips, C archives and PIE zips). The two mechanical workflows around a release are reusable here too: hyper-prepare-release.yml bumps every version file .github/hyper.json names and dispatches the release-mode CI, whose last job (request-staging, in the caller's ci.yml) dispatches the caller's stage-native-binaries.yml with its own run id once every other job is green, and hyper-stage-natives.yml waits for that run to complete, verifies its natives and commits them as B; a second request for an A master already carries as B is skipped with a notice. A release is two deliberate acts: the tag push packs, attests, preserves and proves every Trusted Publisher exchange without uploading; a dispatch at the tag with prepared_run_id publishes the preserved bytes. HyperUuid and HyperCast run the release train instead, the same release with the packing moved into the preparation run: ci.yml's tail packs, release-prepare builds, attests and preserves the inventory at A, CodeQL runs on A, and stage-release commits B from the run's own zips; the tag push then runs tag-guard and tag-gate, which re-verify the preserved bytes, hold B's Package.swift to the zips, require the packing Forge to be an ancestor of the running one and make the release attestation, and the publishers upload on that push, a dispatch with publication_run_id being the no-op replay. Each project's release.yml is the working example, and the release runbook has the release and recovery steps of both flows.

Every consumer describes itself once, in .github/hyper.json (hyper_config.py is the schema): the crate and project names, how to read the C export list from the Rust source, the ABI probe, the companions it is built on (companions: a pinned commit and run each), and any departure from the layout defaults (the Swift target and XCFramework slice sets, whether the Swift bundle ships as release assets (swift_remote), whether C archives ship (c_assets), the Swift target set, the Ruby ABIs and platform gems, the version-bearing files, the npm platform packages and the WASI fallback package (node.platforms, node.wasi; the latter defaults to wasm32-wasip1, so a consumer that gains a TypeScript binding either passes node_wasi: true to hyper-build-wasm.yml or sets "node": {"wasi": ""}, or pack-npm fails on the missing artifact)). Every action, reusable workflow and script reads names from it.

Every input, with defaults, is documented in the workflow file itself. The load-bearing ones: project/crate (PascalCase and lowercase names everything derives from), pure_env (the force-the-fallback env var), csharp_aot_project (turns the AOT claim into a per-platform receipt) with csharp_aot_frameworks (one publish and run per target framework, for a multi-targeted AOT project) and csharp_extra_runtime (the older runtime a multi-targeted test project needs), and the per-binding toggles. Every binding has one (csharp, java, swift, php, ruby, go, pyo3, magnus, node, r), on by default except node and r, which a consumer with a TypeScript or an R binding turns on; a new core joins the pipeline with the bindings it has and turns each of the rest on in the PR that adds it, so its native libraries are built, attested and staged on every platform from the first binding rather than from the last.

The conventions

The pipeline works across repos because the repos agree on layout — this agreement is the actual shared asset, and new Hyper* repos should adopt it wholesale:

  • One Rust core at rust/ (an rlib in the manifest, the shared library built from it by the crate's own cargo cdylib alias, without Rust's standard library — The Rust core has the whole recipe and why; zero runtime deps), C-ABI exports, caller-owned out-buffers, no allocator exports. A counting-#[global_allocator] test proves any allocation-free claim; a shared conformance corpus (corpus/*.json) is replayed by the core and every binding.
  • Native library staging: native/{rid}/{lib} (or the platform's own convention: NuGet runtimes/{rid}/native/, Swift {Project}Core.artifactbundle/{triple}/ for the static libraries it links on every platform, {crate}.lib for the Windows triples), with a dev-loop fallback probing rust/target/release/ so local tests need no packaging step.
  • RIDs: linux-x64, linux-arm64, linux-musl-x64, linux-musl-arm64, osx-x64, osx-arm64, win-x64, win-arm64 — .NET's names, used by every binding. A binding that loads the core and cannot ask its runtime which libc it is on (Java, PHP) decides musl by whether the running process has a musl loader mapped (/proc/self/maps names ld-musl- or libc.musl-), not by what happens to be installed on the box.
  • Floors track upstream support. A language runtime that has reached end of life is not a supported floor, in any Hyper* repo, and the floors match across repos: raise them together when a version ages out.
  • A load probe in every binding: the core exports {crate}_version() (packed major << 16 | minor << 8 | patch), and each binding fronts it with an availability check that never throws plus the loaded core's version as text, so a consumer with a fallback gates on the probe instead of catching a load failure around its first real call.
  • Native extensions for the interpreted tier, where the FFI mechanism itself is the cost. Python is PyO3 only: the extension lives in the core crate behind a python feature, maturin builds an abi3 wheel per platform (Pyodide's included, so Python in the browser runs the same extension) and an abi3t wheel for free-threaded CPython beside it (PEP 803, from 3.15, from PyO3's abi3t-py315 feature in the same crate; the extension declares it needs no GIL, so the bindings are written once, for free-threading, and a GIL build runs the same code; free-threaded 3.13 and 3.14 have no stable ABI and get no wheel), and no project has a ctypes fallback. Ruby is dual-backend: the Magnus extension ({crate}_native, behind a ruby feature) on load replaces the Fiddle fallback's low-level functions in place — everything above them stays shared byte-for-byte — and ships as precompiled platform gems on seven of the eight RIDs (osx-x64 installs the universal gem and runs on Fiddle), fat across supported Ruby minors and carrying no Fiddle library, with Fiddle as the last resort in the universal gem: an unsupported Ruby, or a platform with no platform gem. {PURE_ENV}=1 forces the fallback; a BACKEND constant reports which is live; a cross-backend agreement test compares deterministic outputs across a subprocess boundary.
  • The core crate carries a rust/.cargo/config.toml declaring -undefined dynamic_lookup for the extension builds on Darwin (see the ledger below), and the build aliases the forge and every dev loop run — cargo cdylib above all, which the forge calls rather than spelling out a build of its own.
  • Verdicts over exceptions (parsing repos): every parse returns a discriminated union — the platform's native one (Rust Result + closed enum, C# [Union] with CS8509-as-error, Swift enum, Java sealed interface, Python match, Ruby Data + case/in, PHP Success|Fault) — never a thrown exception for bad data. Exceptions are reserved for caller bugs.

The Rust core

How a Hyper* core is built, and why each piece is the way it is (the ledger has what each piece cost to learn). A new core should start with all of it, because every item is cheaper on day one than after the first release. It is written for someone who knows the languages the bindings are in better than Rust, so the Rust terms are explained where they first matter.

The hypothesis

A Hyper* core is a small amount of parsing or generation code behind a C ABI, called from every language its consumer binds. Almost none of what makes a Rust shared library large is that code. The rest is Rust's standard library (std): the panic runtime that prints a message and a backtrace when a Rust program crashes, the unwinder that walks the stack to do it, a DWARF debug-info parser and symbol demangler to make the backtrace readable, and a heap allocator. A core exports plain functions over caller-owned buffers, never allocates, and is proved unable to panic, so none of that is reachable from anything a host can call — and yet it is most of a core built with std.

So: build the shipped library without std, against core alone (the part of Rust's library that needs no operating system), and keep everything else about the code the same. Measured in bytes, each row on its own date: the linux-x64 rows on 2026-10-25 in Docker rust:latest linux/amd64 (rustc 1.99.1), HyperCast at 0ee2caa and HyperUuid at 0b57513, with the repo's own cargo cdylib alias for the build without std and cargo rustc --release --crate-type cdylib with default features for the one with it; the osx-arm64 and win-x64 rows on 2026-10-02, on the libraries the forge staged then, and not re-measured since:

Library Platform Measured With std Without
HyperCast linux-x64 2026-10-25 425,048 160,488 −62%
HyperCast osx-arm64 2026-10-02 455,952 136,624 −70%
HyperCast win-x64 2026-10-02 197,632 105,472 −47%
HyperUuid linux-x64 2026-10-25 291,432 25,944 −91%
HyperUuid win-x64 2026-10-02 18,944 17,920 −5%

The library CI ships on linux-x64 differs from the local build by a few bytes: HyperCast's is 160,512 (24 bytes of GCC .comment), HyperUuid's 25,968 (the runner's GCC 15.2 C runtime objects against the image's 14.2). Rows of different dates do not compare: both cores grew in between.

Same exports, same code — nothing on a call path differs, only code no call could reach is gone. The libraries depend on the C library alone (libc.so.6, musl's libc, or KERNEL32, VCRUNTIME140 and the universal CRT on Windows), which also retires the musl libgcc_s problem in the ledger for the shared library.

Why the savings differ so much by platform and crate. On most linkers, link-time optimization already discards std's panic runtime when nothing can reach it — which is why HyperUuid, whose exports cannot panic, measured 18–74 KB with std everywhere but linux-x64 (2026-10-02). Two things defeated that:

  • Code that really can panic. core's own float parser keeps bounds checks the optimizer cannot remove, and reachable means kept: in the 2026-10-02 rows HyperCast's float doors parsed through it, so HyperCast carried the whole runtime on every platform. Its float doors have their own conversion and are in the proof (the ledger has "A float parser the proof accepts").
  • rust-lld on linux-x64. Since Rust 1.90, x86_64-unknown-linux-gnu links with rust-lld by default (every other Linux target still uses the system linker). lld treats the unwind tables' reference to std's personality routine (the function the unwinder calls in each frame) as live, and that routine can itself panic, which pulls in the panic hook and the backtrace symbolizer behind it: about 315 KB. The same HyperUuid code was 30,080 bytes with GNU ld and 346,840 with lld (2026-10-02); -Wl,--why-live= prints the chain. Without std there is no such personality routine to keep.

What would not work. Making HyperCast's two float doors panic-free, so the runtime could be optimized away: with float parsing stubbed out entirely, the std library is still 414 KB on linux-x64, for the lld reason above. Dropping std is what does it.

The recipe

Items 1–8 are in all three cores, item 9 is the Forge's own hyper-check-core.yml, item 10 is in HyperCast only (neither HyperUuid nor HyperTabular has a rustfmt.toml), and item 11 is in HyperUuid and HyperCast; copy them from there rather than from this description.

  1. Declare only the rlib. [lib] crate-type = ["rlib"] in rust/Cargo.toml. A shared library listed there is built for every crates.io consumer too, and breaks the no_std ones (ledger: "A cdylib in the manifest breaks no_std consumers"). The shared library is built by naming its crate type on the command line instead.

  2. The cargo cdylib alias in rust/.cargo/config.toml, which the forge calls for the native core on every leg and which is the dev loop's build command:

    cdylib = ["rustc", "--release", "--crate-type", "cdylib", "--no-default-features", "--features", "cdylib", "--config", 'profile.release.panic="abort"']

    The output stays in target/release/, where every binding's dev-loop fallback probes. The forge requires this alias in any crate that calls hyper-build-native.yml; a crate without it fails at the build step with no such command: cdylib.

  3. Features. default = ["std"], so a crates.io consumer, the test harness and the benchmarks get std as normal; #![cfg_attr(not(feature = "std"), no_std)] in lib.rs; staticlib = [], the panic handler for the no_std artifacts; and cdylib = ["staticlib"], which adds what a no_std shared library needs on top (items 5 and 6). The extension features (python, ruby, php) name std themselves.

  4. Panics abort, for that one build only. A no_std artifact cannot unwind; rustc refuses to build it otherwise. The alias sets panic = "abort" with --config instead of in [profile.release], because a profile setting would reach the Python and Ruby extensions too, where PyO3 and Magnus can turn a Rust panic into a host exception only if it unwinds. At a C ABI boundary a panic is a process abort anyway; under no_std it is the same abort, without the message printed first.

  5. A hidden rust_eh_personality. core ships precompiled with unwind tables, and one that survives into the library can name the personality routine (in HyperCast, the 128-bit division helper's does). A static library leaves that reference for the final link; a shared library is the final link, so without a definition every dlopen fails with undefined symbol: rust_eh_personality. Nothing calls it under panic = "abort", so a bare ret is enough. It is written in global_asm! with .hidden (ELF) / .private_extern (Mach-O) visibility rather than as a #[no_mangle] function, because a #[no_mangle] item is exported from a shared library whatever its Rust visibility. It is compiled only under the cdylib feature: two Hyper* static libraries that each defined it could not be linked into one program — the same collision that keeps std out of the static libraries (ledger: "Linking the core, where a binding can"). Windows needs none (its unwind tables name the C runtime's handler) and neither does wasm32. Include it even if nothing references it yet — HyperUuid's is dropped by the linker today — so the first change that does pull a reference in still produces a library that loads.

  6. An explicit C runtime link. With std, the C library comes in through std's own link directives. Without it nothing names it: on Linux the library links with no NEEDED entry at all, its imports unversioned and resolved only because the host process happens to have libc loaded (and the forge's musl check rejects it), and on Windows nothing names where memcpy, __CxxFrameHandler3 and the DLL entry point come from. #[link(name = "c")] on Unix, and on MSVC msvcrt (or libcmt under crt-static) — the same choice std makes through the libc crate, so the library depends on exactly what the std build did.

  7. Prove the exports cannot panic with dtolnay's no-panic behind a no-panic feature, every PR. Its build must keep std and unwinding: no-panic detects a panic path by the unwind edge it leaves, and under panic = "abort" there is none, so the check would pass whatever the code did. (Plant a panic in an export once to see it fail.)

  8. Profile: [profile.release] with lto = true, codegen-units = 1 and strip = true (ledger: "A cdylib in the manifest breaks no_std consumers" has why LTO only reaches a cdylib built on its own), [profile.bench] with strip = false so a profiler keeps its symbols, and [profile.staticlib] inheriting release with panic = "abort" for the static libraries. Stripping drops only the symbol table — the machine code is byte-identical, measured on HyperUuid's linux-x64 library (19,448 → 16,632 bytes, the same .text hash), and the 13 exports keep their names in the export table — while the archives keep their symbols, since a static library is not linked and its consumer's linker resolves the core through them. It costs internal function names in a native crash dump, which with fat LTO inlining nearly everything into the exports is little; the tagged source rebuilds unstripped if one is ever needed.

  9. CI from the Forge: each crate's ci.yml calls hyper-check-core.yml, whose jobs each have a toggle the caller turns off with its reason:

    • check-cdylib — builds cargo cdylib on all seven native RIDs, asserts the export list is the C ABI symbols the source declares (.github/hyper.json's exports rule) and nothing else (Linux glibc and macOS, where nm can list it), asserts the musl builds depend on musl's libc alone, and, when hyper.json names a cdylib_smoke script (HyperCast and HyperUuid do), loads that exact library through Python's ctypes and calls every export, so it is dlopened and called the way a host does. The per-platform pieces in items 5 and 6 are only ever proven by loading the result.
    • check-no-std — cargo check --no-default-features for a bare-metal target, plus a real default-features = false consumer on the host and wasm32-unknown-unknown, and no extern crate alloc in the core.
    • check-no-panic — item 7.
    • test-wasi — cargo test --target wasm32-wasip1, default features, with wasmtime (a pinned release, checked against its SHA-256) as the runner and the checkout and target directory mounted at their own paths, since a suite reads what CARGO_MANIFEST_DIR and CARGO_TARGET_TMPDIR named at compile time. Every dev-dependency must build for that target (criterion with default-features = false: rayon refuses wasi), and a test that spawns threads is gated on target_os = "wasi", which has none.
    • check-core — a core's own check script, when it has one (core_script: HyperTabular's rust/check-core.sh, which runs the no-panic proof itself, so its check-no-panic is off).
    • lint-rust — cargo fmt --check and cargo clippy -- -D warnings, over each configuration that compiles different code (default with tests, extra_features, no_std bare metal, no_std cdylib, the Python extension, which builds without its interpreter's headers, any clippy_targets, and the fuzz and browser-test crates where present).
    • check-msrv — cargo check of the library and the no_std cdylib on exactly the rust-version the manifest declares, read from the manifest. Declare the lowest that builds (1.85 is edition 2024's own floor); the tests may use newer APIs.
    • check-semver — cargo-semver-checks against the latest crates.io release, default features only. The manifest version is the claim, and prepare-release makes it: while the manifest still carries the published version, a breaking change is a warning naming what the bump must pass; once the version differs (the bump commit, the tag), a version that does not cover the change fails.
  10. rust/rustfmt.toml with use_small_heuristics = "Max", committed before the first line of code. rustfmt's defaults break struct literals and short if/else expressions onto several lines well short of the 100-column limit; this keeps anything that fits on one line on one line.

  11. Round-trip tests for every text form the core parses: each value formats to the canonical form and parses back to itself, and every one-character edit of a valid string (replace, remove, insert, multi-byte UTF-8 included) parses exactly when a deliberately naive reference parser in the test says so, to the same bytes. no-panic proves a parser cannot crash; only this proves it reads the right bytes. HyperUuid's tests/round_trip.rs.

Levers deliberately not pulled

What is left after the recipe trades something away. Revisit when the trade changes.

Lever Would gain Why not yet
panic_immediate_abort (an immediate-abort panic strategy that rebuilds core without its panic formatting) The last of core's panic formatting; small, unmeasured Nightly Rust only. Adopt when it reaches stable.
Miri over the unit tests, every PR Undefined behaviour in the unsafe pointer handling at the C ABI (out-of-bounds, misalignment, aliasing), the one class of bug no-panic and the suites cannot see A nightly-only tool, and not headed for stable, so this waits on a decision, not on Rust: adopting it means one CI job on a pinned nightly date, bumped deliberately, with its tests trimmed for an interpreter roughly 50–100× slower than native.
Java: link the static archive into a GraalVM Native Image, as C# Native AOT does No library extracted and loaded at startup: one executable, like the C# and Go builds Proven feasible on linux-x64 (GraalVM CE 25.4, October 2026), parked because the only way in is GraalVM's internal API. Native Image's public Feature API cannot add linker options, so the jar would carry a Feature that casts to the builder's FeatureImpl.BeforeImageWriteAccessImpl and registers a linker-invocation transformer (the hook GraalVM's own JNILibraryLoadFeature uses), needing --add-exports for com.oracle.svm.hosted and com.oracle.svm.core. The image also hides every symbol but its own behind an anonymous version script, so the exports need the experimental -H:ExportedSymbolsVersion=SVM plus a second version script naming them, and --whole-archive so --gc-sections keeps them; the binding then finds them with SymbolLookup.loaderLookup() under Native Image (defaultLookup() searches only libc). native-image.properties alone cannot do it: ${.} is not a file path inside a jar, and the properties cannot vary by OS or architecture. macOS (-force_load and exported-symbol lists) and Windows (/WHOLEARCHIVE and /EXPORT, with loaderLookup over an .exe unconfirmed) would each need their own linker handling, and a fully static musl image likely cannot look symbols up at all. So it is fragile — any GraalVM release can break the internal API, which every repo would then need a native-image CI job to notice — it is three per-OS code paths against a goal of fewer, and it buys little: Native Image already works from the same jar by extracting the shared library at startup. Adopt when GraalVM offers a public way to add linker options and export symbols from a Feature.
Java in the browser, as C# (Blazor), Rust, Python (Pyodide), Go (TinyGo) and Ruby (ruby.wasm) have it The JVM binding running inside a web page Parked until GraalVM's Web Image (--tool:svm-wasm) is mature and can call or link native code. Every other browser route works because that language's wasm toolchain links a native archive into its output (Emscripten, LLVM's wasm-ld, a static interpreter build); no Java-to-wasm compiler can. Web Image is experimental and has no FFM, TeaVM has no native code at all, and CheerpJ runs a JVM whose native methods can only be JavaScript. The one workable route — load the core as a wasm module of its own and call it through Web Image's @JS interop, copying 16 bytes a call — is a second binding with its own glue, not the existing one running in a browser, and nothing has asked for it (October 2026).
PHP in the browser through WordPress Playground's @php-wasm, as C#, Rust, Python, Go and Ruby have it The PHP binding running inside a web page Proven (October 2026), not shipped: waiting on demand, because of its size. Unlike Ruby it needs no custom interpreter on the route that matters: the binding's ext-php-rs extension, built as a static library for wasm32-unknown-emscripten and wrapped as a side module by Playground's @php-wasm/compile-extension, loads into the stock @php-wasm/node and @php-wasm/web runtimes (PHP 8.5, JSPI) and runs in node and headless Chrome. What it costs: a 128 KB module per supported PHP minor, each matched to its PHP exactly, built per minor in CI from a ~4 GB Playground image, plus a distribution channel to choose for a binding whose Composer package is FFI only. Two upstream issues it found, neither blocking with the flags the recipe passes: ext-php-rs does not compile against a 32-bit zend_long (extphprs/ext-php-rs#800; Playground's PHP is 64-bit), and compile-extension drops four flags for cc-rs's C code, so the module fails to load with bad export type for '__THREW__' (WordPress/wordpress-playground#4377). The full recipe is in HyperUuid's php/README.md (WebAssembly). A ~90-line C extension over the no_std emscripten archive also worked, at 12 KB a module and on 32-bit PHP, but is a second native implementation in C.
opt-level = "s" or "z" Likely tens of KB Likely slower calls, and speed is what the libraries are for. Unmeasured; benchmark before considering.
HyperCast: one shared integer engine instead of eight monomorphized copies Perhaps 20–30 KB (the eight integer doors are about 4.5 KB each) Housekeeping worth doing, but each door is its own hot path; needs A/B benchmarks first. Unmeasured.
PGO, -C target-cpu Some speed Build complexity, or binaries that will not run on older CPUs of a RID.

The ledger

Build archaeology, each item paid for once in a real red run (also commented at the workflow step that pays it):

Lesson Detail
Darwin extension linking A Ruby/Python extension must not link the host runtime — rb_*/Py_* symbols resolve from the host process at load, which needs -Wl,-undefined,dynamic_lookup. maturin/rake-compiler arrange this; a plain cargo invocation does not. Linux allows undefined symbols in shared libs by default, so this only ever fails on macOS.
Temurin × win-arm64 Adoptium ships Windows ARM64 JDKs for 21 and 23 only (no 25 or 27 assets, re-checked 2026-09). The pipeline pinned 23 for that reason until 23 itself reached end of life; it now runs JDK 25, on Temurin for five legs and Microsoft's build of OpenJDK on win-arm64, which does ship that platform.
musl: no cdylib by default Every *-linux-musl Rust target defaults to a statically linked C runtime, and under that default rustc cannot emit a cdylib. Asked for one on the command line (cargo rustc --crate-type cdylib) cargo stops with "cannot produce cdylib ... the target does not support these crate types"; a manifest that lists the crate type only gets a "dropping unsupported crate type" warning, the rlib, and exit 0. -C target-feature=-crt-static is what produces the .so. Check for the file, not the exit code.
musl: libgcc_s A dynamically linked musl build keeps a NEEDED entry for libgcc_s.so.1 (Rust's unwinder), which the bare alpine, python:*-alpine and golang:*-alpine images do not ship; the library fails to load there. -static-libgcc does not help, because rustc names gcc_s explicitly. A directory on the link path in which libgcc_s is a linker script naming libgcc_eh.a and libgcc.a does, and leaves musl's libc as the only dependency. Both archives: on aarch64 the unwinder calls libgcc's outline-atomics helpers, and naming only libgcc_eh.a linked on x86_64 and failed on aarch64 with undefined reference to `__aarch64_swp8_acq_rel'.
musl platform gems vs *-linux With both x86_64-linux and x86_64-linux-musl published, Bundler (2.5, 2.6, 4.0) and RubyGems 4's gem install pick the musl gem on Alpine, but gem install on RubyGems 3.5/3.6 (what Ruby 3.3 and 3.4 ship) picks the glibc x86_64-linux one — even with --platform x86_64-linux-musl — because a version-less linux platform matches a musl Ruby. Measured on ruby:3.3/3.4/4.0-alpine in October 2026. Naming the glibc gems x86_64-linux-gnu/aarch64-linux-gnu instead (nokogiri's scheme) made every combination resolve correctly in the same test, glibc images included, so that is what the platform gems are called.
A cdylib in the manifest breaks no_std consumers Cargo builds every crate type a dependency's [lib] lists, not just the one the consumer links. With crate-type = ["cdylib", "rlib"], a default-features = false consumer therefore also built a no_std cdylib, which is a linked artifact with no panic handler: "#[panic_handler] function required, but not found", on the developer's own machine and on wasm32-unknown-unknown, for both crates, through 0.4.0. The bare-metal cargo check in CI stayed green the whole time because a target that cannot produce a cdylib drops the crate type. The manifest now declares only the rlib and every shared-library build names its crate type (cargo rustc --release --crate-type cdylib, cargo cdylib in each crate), the way the static libraries already did; each repo's check-no-std job builds a real consumer on the host and for the browser. Side effect, measured: cargo only passes -C lto for a cdylib built on its own, so the libraries came out 15–18% smaller at the same speed.
Build the package where a failure is cheap The wheels were built in each release.yml, at the tag, because a wheel carries its version in its file name. Once the libraries embedded the version, the release already had to reuse a CI run built at the bump commit, so that reason was gone — and what remained was a packaging matrix whose first ever run happened after other registries had published. 0.4.0's osx-x64 wheel failed its first install (setup-python's "x64" macOS build is universal and ran its arm64 slice) with crates.io, NuGet, Maven Central and RubyGems already out. hyper-build-wheels.yml now builds, installs and attests the wheels on every CI run, and the release downloads, verifies and publishes them.
A library that reports its version Once the core exports its own version, a native library is no longer version-agnostic, and "reuse the last green CI run's artifacts at tag time" quietly ships the previous version's number: HyperCast 0.3.0's NuGet package, jar, gems and committed Go/Swift/PHP libraries all report 0.2.0, with every run green, because they were built a minute before the bump. The bump commit needs its own CI run, staging has to follow it, and the tag goes on the staging commit; release.yml refuses a run or a committed library built at any other version.
A no_std shared library Dropping std from the cdylib (see The Rust core) failed three ways before it worked. dlopen: undefined symbol: rust_eh_personality, named by an unwind table core precompiles in — a static library never sees it, because its reference is left to the final link. Exports: a #[no_mangle] stub fixed loading but became a 23rd export, since #[no_mangle] exports whatever the Rust visibility says; global_asm! with .hidden/.private_extern does not. Linkage: with no std nothing names the C library, so the Linux .so had no NEEDED entry at all and the forge's musl check would have rejected it. And -C panic=abort belongs on that one build, not in [profile.release], or the Python and Ruby extensions abort where they used to raise.
rust-lld keeps std alive on linux-x64 Since Rust 1.90 x86_64-unknown-linux-gnu links with rust-lld. lld keeps std's personality routine live from .eh_frame, and through it the panic hook and backtrace symbolizer: HyperUuid's linux-x64 library was 346,840 bytes with lld and 30,080 with GNU ld, same code, while its arm64 build (system linker) was 74 KB. -C link-arg=-Wl,--why-live=<symbol> prints the chain; a no_std build has no such routine to keep. If a size moves on one platform only, compare linkers before code.
Rust 1.100 × ruby.wasm Rust 1.100 moved every wasi target's thread-locals onto pthread keys (std/src/sys/thread_local/mod.rs: 1.99 kept wasm32-wasip1 on the single-threaded statics and gave keys to p3 alone). A thread-local with a destructor anywhere in an extension's std then calls pthread_key_create, pthread_setspecific and pthread_key_delete, which the wasi-libc ruby_wasm 2.10.1 links doesn't define, so rbwasm's link fails on those three undefined symbols; a plain Rust wasip1 program, linked by rustc, still builds. Seen 2026-11-13, when stable became 1.100.0 between two HyperCast boards with no Rust change between them. build-ruby-wasm pins Rust 1.99.1 until ruby.wasm's libc provides them.
no-panic needs unwinding dtolnay's no-panic turns a panic path into an undefined symbol by way of the unwind edge it leaves. Under panic = "abort" there is no edge, so the check passes no matter what the code does. Build the proof with std and unwinding, even though the shipped library aborts — and plant a panic once to see it fail.
A float parser the proof accepts HyperCast's cast_f32 and cast_f64 were the only exports outside the no-panic proof: they handed their normalized text to core's float parser, whose slice-index checks the optimizer cannot remove, and nothing short of not calling it changes that. The conversion is the crate's own now (rust/src/float.rs): Clinger's fast path and Eisel-Lemire, the two algorithms core itself runs, over a 128-bit powers-of-five table whose generator is recorded in the table's file, and, for the rare input those cannot settle, an exact integer division on fixed stack arrays in place of core's digit-shifting slow path — slower, and simple enough to write without an index in it. Every path is held to core's bits over about a million and a half generated strings, exact halfway points and 1,100-digit expansions among them, with the exact step also run alone. Measured against the 0.6.1 door on linux-x64: within 4% either way on five workloads, and 1.7 KB more library. Two things it taught. The first version was up to 43% slower for one reason, reading the digits twice; one pass, eight digits at a time, is what core does and what closed the gap. And the panic planted to prove the proof was live has to be one the optimizer cannot discharge: indexing the table with an exponent that was already range-checked compiled to no check at all, and the proof passed with the plant in place, where an assert! on the parsed value failed it and named both doors.
PHP × win-arm64 PHP has never shipped a native Windows ARM64 build — it runs under x64 emulation, which can never load an ARM64 native library. Skip the leg; win-x64 covers PHP-as-x64 for real.
Windows extension staging A CPython extension module is a renamed DLL: .pyd. Ruby's DLEXT: .so on Linux, .bundle on macOS.
PyO3 on Windows Needs no extra toolchain: the MSVC linker the core already builds with, plus CPython's import library inside the setup-python installation. Magnus on Windows is different — RubyInstaller rubies are MinGW-built, so a compatible extension is a windows-gnu-target exercise.
Composer proxies on Windows vendor/bin/phpunit is a shebang script pwsh can't execute — invoke through php.
macOS runner Xcode Ruby native-extension builds (mkmf) can fail if xcode-select isn't pointed at full Xcode — the pipeline sets it defensively.
Runner labels windows-11-arm is GA, free for public repos. The Ubuntu legs name ubuntu-26.04 and ubuntu-26.04-arm outright instead of ubuntu-latest, so both architectures build on one release and moving to the next is a commit rather than a label rollout that lands over several weeks.
Retiring a slow leg without retiring the platform macos-26-intel took 37 minutes on HyperCast run 36894631512 against 8 for Apple silicon and 15 for the slowest Windows leg, every step 4–8x slower, on hardware Apple stopped selling in 2023 and a runner class GitHub retires by Fall 2027. The RID stayed and the leg went: Rust cross-compiles x86_64-apple-darwin on an arm64 Mac with only the target added, and cargo test --target x86_64-apple-darwin there runs the x86_64 test binary through Rosetta 2, so the core is still built, attested and genuinely tested. What a cross-build cannot give is anything compiled against a host runtime: a Magnus extension needs an x86_64 Ruby to build against, and Rosetta on the arm64 image would need an x86_64 Ruby that setup-ruby does not install there, so no Magnus extension is built for osx-x64: Ruby there installs the universal gem and runs on Fiddle. PHP shows the cost: a PHP extension has no universal fallback, no PHP is packaged for Intel macOS, and no leg builds one ("No leg builds a language runtime", below), so there is no osx-x64 PHP extension. An abi3 wheel needs no target interpreter to build, and setup-python with architecture: x64 supplies one to smoke-test it.
A new Ubuntu image Moving 24.04 to 26.04 changed four things, none of them in the Rust. Swift: no toolchain before 6.4 is published for 26.04. SwiftLint: its dynamically linked Linux binary needs libxml2.so.2, which 26.04 replaced with libxml2.so.16; the swiftlint-static binary in the same download needs nothing, and no Swift toolchain either. glibc: the image's is 2.43, but the libraries built on it still reference nothing past GLIBC_2.34, same as on 24.04, and hyper-build-native.yml fails the leg if that ever moves. bindgen: setup-swift puts Swift's own clang first on PATH, and bindgen asks that clang for the compiler headers while loading the newest system libclang, so 26.04's libclang 22 was parsing Swift 6.4's clang 21 headers and the ext-php-rs build failed on x64 in xmmintrin.h (arm64 has no such header and passed). The Linux legs now set CLANG_PATH and LIBCLANG_PATH to one system LLVM.
Swift 6.4's build system Swift Build, SwiftPM's default from 6.4, stages a target's resources in {Package}_{Target}.bundle on every platform where the build system before it wrote .resources off macOS — which broke a binding that opened its native library out of that directory by name, and was one reason Swift stopped loading anything. It also links a binary target's archive by path where the old one copies it beside the products and passes -l, so the win-x64 leg runs the suite a second time with --build-system native. On 6.3, where Swift Build is opt-in, it dropped a binary target's module map when the package was reached through a product (swift-build#1295, fixed in 6.4): the package's own swift test passes, only a consumer fails, which is why test-swift-static builds the smoke executable on glibc on the current Swift too.
A toolchain setup action outlives its step Whatever setup-swift puts in the job environment is still there for every later binding. Two failures, same cause, on the first Swift 6.4 run: on Linux its clang came first on PATH and bindgen mixed its headers with the system libclang (see the row above); on macOS, where the image's Xcode had no Swift 6.4, it installed swift.org's toolchain, exported TOOLCHAINS, and put that toolchain's bin directory ahead of /usr/bin, so a bare clang was swift.org's binary run directly rather than Apple's shim, with nothing to tell it where the SDK is. Ruby is configured with CC=clang, and its mkmf refused to build fiddle ("The compiler failed to generate an executable file"). Resetting TOOLCHAINS alone did not fix it, and a probe that linked with cc passed while mkmf kept failing: probe with the name the tool uses. A step cannot remove a PATH entry, so once the Swift steps are done the job prepends a directory holding only clang and clang++ links to Apple's shims.
Linking the core, where a binding can Two bindings link a static library instead of loading a shared one, and a third carries the core as source. Swift: SwiftPM links a per-triple archive declared as a binary target (SE-0482, Swift 6.2) on every platform — the only way to reach its static Linux SDK (musl) and its WebAssembly SDK, neither of which has a dynamic loader, and everywhere else it removes the resource directory a consumer had to deploy; the WebAssembly build is a plain wasip1 command, so it runs in a browser through a WASI shim too. Go: the crate's wasm32-wasip1 build is translated to Go source by wasm2go and committed (HyperUuid first; the siblings follow when they thaw), so go get is the whole install on every GOOS/GOARCH, with no cgo, no archive and nothing extracted at run time; the committed translation is regenerated and diffed in CI. C#: DirectPInvoke plus NativeLibrary in the package's targets file hands the archive to the Native AOT linker, so a publish is one executable. What made it practical: (1) the archive rustc writes is 3–5 MB of core and compiler_builtins, but with fat LTO the crate's own object already holds everything it uses, so that one object re-archived is 10–210 KB; (2) it must be no_std with panic = "abort", or two Hyper* archives collide on rust_eh_personality exactly as they did in Blazor; (3) MSVC has no 128-bit helpers, so the Windows archives keep the members a linker would pull, but that closure must not be used elsewhere — off Windows those helper objects carry unwind tables naming rust_eh_personality, which reintroduces (2); (4) the translated Go core is checked by regeneration, not by provenance, since a consumer's go build is what links it; (5) SwiftPM and Swift Build match a variant's triple on vendor too, so the bundle spells Windows x86_64-unknown-windows-msvc (Rust's pc matches nothing) with MSVC's {crate}.lib name, macOS arm64-apple-macosx, and its info.json lists only the archives present, so a leg that builds one triple never names a missing one; (6) the static Linux SDK ships no XCTest, so musl is proven by a smoke executable, and 6.2's XCTest traps under WASI before any test runs, so the floor's WebAssembly check is the smoke executable too; (7) every one of the nine targets cross-compiles from one Linux runner, because nothing is linked.
Two Rust extensions in one ruby.wasm ruby.wasm links every gem's extension into one interpreter, so the Magnus extension ships as a wasm32-wasip1 static archive (the {crate}-wasm gem) and meets other Rust code at link time. The release-LTO object exports, besides Init_* and the C ABI, three symbols every std-carrying Rust extension defines identically: rust_eh_personality (which ruby.wasm's own wasi-vfs, a Rust staticlib, also defines), rb-sys's ruby_abi_version, and std's EMPTY_PANIC. HyperUuid alone stops on the first; HyperUuid with HyperCast stops on the other two. wasm llvm-objcopy can neither localize nor rename a symbol, so each gem's extconf.rb rewrites the three names in place to crate-owned ones of the same length (keeping every offset, and EMPTY_PANIC's v0 mangling, valid) and then fails, by name, if the object still exports any other Rust-runtime symbol. The other ~575 shared names are identical compiler_builtins archive members, which wasm-ld pulls lazily and never duplicates. The first 32-bit build also caught HyperCast caching raw VALUEs as u64, which no 64-bit leg could. Two rbwasm traps: it runs make clean before make static, so the extconf leaves its archive under a name that is not *.a; and without --remake it returns the interpreter in rubies/ whenever one exists under a name that hashes only the gem names, so a second build with the same gems (CI's prebuilt pass after its source pass, or any cache hit) links nothing new. CI passes --remake to every build, which rebuilds every extension and relinks Ruby. Magnus itself needed #186 and #187, fixed in 0.8.3 and 0.9.2.
A Magnus extension's statics must be pinned A Ruby object an extension caches in a Rust static (a class, a module, a constant's value, kept in OnceLock<…Opaque<…>>) is out of the garbage collector's sight. Its constant keeps it from being collected but not from being moved: a compacting collection relocates it and rewrites every reference it can see, and the static keeps the old address. HyperTabular's macOS leg then called Book.stingy on an Array (run 37718484155), and a forced compaction segfaults all three cores' extensions. ruby.gc_register_mark_object(value) at init pins each one; Opaque alone does not, and marker.mark in a TypedData's mark already pins what a wrapped object holds. Each core's native_backend_spec.rb runs GC.verify_compaction_references(expand_heap: true, toward: :empty) in a subprocess and then calls in, since ordinary specs only trip it when a random order and the heap happen to line up.
No leg builds a language runtime The PHP extension's osx-x64 leg compiled an x86_64 PHP from php.net's source on the Apple silicon runner (Homebrew bottles nothing for Intel macOS) and tested the cross-built extension on it under Rosetta: about 25 minutes on every uncached run, and on HyperUuid run 41188206120 (2026-10-31) 15 minutes stalled at link before the run was cancelled. The leg went, and the rule with it: a leg takes the runtime its platform packages (setup-php, a Homebrew tap, an Alpine package, a container image), or there is no leg. Cross-building the library and running it under Rosetta is a different thing and stays (build-native-osx-x64); building the interpreter is not. test_forge_producers.py pins it.
setup-php on macOS On macOS setup-php installs PHP from its own Homebrew tap and discards brew's output, so a failure there is one line — Could not setup PHP 8.5 — with nothing behind it (HyperUuid run 37710502986, both attempts, while setup-php's own CI was green). The PHP extension's osx-arm64 legs install from that tap with brew directly (shivammathur/php/php@X.Y, or php for its newest minor), so a failure shows brew's own output, and Composer from its signed installer. Neither the tap nor Homebrew core bottles Intel macOS any more, so there is no osx-x64 leg ("No leg builds a language runtime", above).
FFM under GraalVM Native Image A static final MethodHandle is only a constant to Native Image if its class is initialized when the image is built. Both Java bindings bound each downcall handle to its symbol's address, which exists only once the library is loaded, so the class initialized at run time and every call went through the image's method-handle interpreter: 6.4 µs for a call the JVM makes in 36 ns, slower than the GraalWasm backend the jars then carried, in the same binary. The smoke test passed throughout — it proves the calls work, not what they cost. The shape that works: one address-less handle per C signature (Linker.downcallHandle(descriptor, options)), in a holder class that touches nothing but the linker, initialized at build time by a native-image.properties the jar ships; the address, looked up at run time, is the first argument. The same goes for any derived ValueLayout (it is read through a VarHandle). After: ~80 ns. JMH cannot run in an image, so the receipt is a hand loop built with the jar's own metadata, checked against JMH on the JVM first.
Swift on Darwin Presenting Swift's Duration requires a platforms: [.macOS(.v13)] floor in Package.swift — Linux has no availability gates, so this only surfaces on macOS legs.
Benchmarking XDEBUG_MODE=off for PHP (a loaded Xdebug inflates uniformly ~14x and looks plausible). Never run benchmarks concurrently with builds or each other. Time-based benchmarks carry explicit-timestamp variants — a wall-clock read is priced by the OS (~1µs on an arm64 WSL2 box whose clock defeats the vDSO; tens of ns elsewhere), not by the binding — and for the same reason every table names its machine and runtime: moving the published tables from that box to an x64 one took HyperUuid's lead over the uuid crate from 13–16x to 2x and over UUID.randomUUID() from 11–17x to 2.4–4.5x, with no code changed. One unwarmed call per fresh process times the library load, not the call (phpbench with Revs(1): 0.8 ms reported for a 76 µs batch). pyperf's workers drop the environment unless --inherit-environ names the variable, so a backend switch silently measures the default backend. An interpreter built without its optimization flags (a default pyenv install) is 10–35% slower on both sides of a comparison — measure on the build people actually run.
Trusted Publishing bootstrap A crates.io Trusted Publisher configuration can only be created after the crate already exists — RFC 3691: "A Trusted Publisher Configuration can only be created after an initial manual publishing of a crate." There is no equivalent of PyPI's pending publishers, which do let you pre-register a project that has never been published. So a brand-new crate is a two-step bootstrap: publish an empty placeholder once by hand with an API token (crate-placeholder/reserve-crate.sh publishes and yanks it as 0.0.1 under the crate's name), register the trusted publisher on the crate's settings page against the consumer's release.yml (crates.io matches the token's workflow_ref, the top-level calling workflow, never the reusable hyper-publish-crate.yml), then every release, the first real one included, is tokenless. PyPI and RubyGems have pending publishers and a nuget.org policy belongs to the account, not to a package, so crates.io is the one registry whose first version is published by hand. Budget for it when standing up a new Hyper* repo — it is the one publishing step that cannot be automated from an empty registry.
Attest before the irreversible step Order attestation before whatever cannot be undone. A crates.io publish is permanent — yank hides a version, never deletes it, and the number can never be reused — so cargo package → attest → upload of that same .crate through crates.io's publish API means an attestation failure costs a re-run instead of stranding a published, unsigned artifact. Nothing is repacked at publish time: the publisher sends the attested request bytes and holds the .crate crates.io then serves to the attested digest. NuGet is the deliberate exception: nuget.org injects a repository signature into the .nupkg during validation, so the published bytes genuinely differ from the packed ones and it needs two attestations, one either side.
Doc gates need a CI invocation A compiler-enforced doc gate only enforces where CI actually runs it. C# (CS1591 + TreatWarningsAsErrors) and Rust (#![deny(missing_docs)]) fire on every PR because dotnet test and the core's cargo build compile there. Java's javadoc -Xwerror fires only when the javadoc task runs — which for a long time was the Maven publish and nothing else, so undocumented members sailed through every PR and failed the release. Run javadoc alongside the Java suite, not as a separate lint job: like C#, it is enforced by compilation, so it belongs on the leg that already compiles.
Allocation-proof tests One #[test] fn per counting-allocator binary — cargo test spawns a thread per test fn, and thread creation itself allocates. Entropy sources can take a rare re-init slow path; treat a single one-off allocation flake as suspect-the-environment before suspect-the-code.
Provenance only where a build made it The release gate held every committed payload to Forge build provenance at A, but CI attests only the libraries; the metadata staged beside them (the Swift bundle's info.json, the XCFramework's Info.plist, headers and module maps) has none, so the first real tag runs (HyperUuid 40236081141, HyperCast 40236113802, v1.0.0) stopped at the gate on info.json with a 404 from the attestations API, nothing uploaded. The unit fixture held libraries only. The inventory now records provenance for files with a library suffix, the same rule staging verifies by, and the release attestation remains the binding for the rest.
A container action nested in a composite pypa/gh-action-pypi-publish runs its own container image and finds it through github.action_repository/action_ref, which are empty when it is a step of another composite action (actions/runner#2473); it then falls back to the calling repository and ref and looked for ghcr.io/SkunkWerkx/HyperUuid:v1.0.0, which Docker refused (repository name must be lowercase) before any upload (HyperUuid run 40239859235). The tag run skips that step, so only the first publish found it. Both v1.0.0 wheel sets went up from a one-off workflow, and PyPI shows each as a change of provenance, since PEP 740 publish attestations name the workflow file. The upload is now a step of the consumer's release.yml job, after publish-pypi verifies and plans; through 0.9.0 it was one there too.
A GITHUB_TOKEN run raises no workflow_run prepare-release dispatches the release's ci.yml run with the job's GITHUB_TOKEN, and GitHub raises no further event for anything that token did except workflow_dispatch and repository_dispatch, so the run's completion never reached stage-native-binaries.yml's workflow_run trigger. On the flow test a human had dispatched CI and staging followed; on the v1.0.0 preparations (HyperUuid CI 40232318316, HyperCast 40232760003, both github-actions[bot]) nothing staged until the owner dispatched staging by hand. The run now asks for itself: request-staging, last in ci.yml, dispatches staging with its run id, staging waits for the run to complete before the same checks as ever, and a second request for one A (workflow_run on a human-dispatched run, a second CI run on A) finds B and skips with a notice instead of failing on "master advanced".

License

MIT

About

HyperForge — the shared foundry behind SkunkWerkx's Hyper* projects (HyperUuid, HyperCast, and what's next): reusable 5-platform CI pipelines that prove one Rust core against every language binding's real test suite, scaffolding conventions for new bindings, and the build archaeology — learned once, banked here, never re-learned.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages