Skip to content

Provider requirements

A capsule states which runtime provider it needs to run: a provider kind, an ABI and a minimum version. It names a requirement rather than a specific provider build, so the provider can be updated without rebuilding any capsule.

"provider_requirement": {"kind": "cpython", "abi": "cp311", "min_version": "3.11.12"}

Where the requirement comes from

Bake takes it from the Python that ran the bake. Bake imports each block's entry point to confirm it loads, so the interpreter it ran under is one the capsule is known to load on. A runtime.xratu in the block folder may restate or raise it: each field it declares replaces the derived one, one field at a time.

document:
  build:
    provider:
      min_version: "3.11.14"

How it is matched

When a project resolves a closure for the capsule, a provider is admitted against the requirement:

  1. Kind must match exactly. cpython is the one provider kind.
  2. ABI must match exactly. A capsule built for cp311 cannot load extensions under cp312, whatever its version number.
  3. Version must be at least min_version.

The resolved provider's digest is recorded in the closure and in the materialization evidence. See Resolved runtime closures.

Why a requirement, and never a binary digest

The capsule is the block's code and the provider is the runtime, and they change on separate schedules. Pinning a provider binary in the capsule would mean every provider security update invalidated every capsule already built. A manifest that names a provider binary digest is refused:

a manifest declares the provider it requires, never the binary digest that will satisfy it; the resolved digest is materialization evidence

A cell's identity keeps the capsule digest and the provider digest as two separate parts. See Cell reuse keys.