rust-lang/rust · critical · RuntimeError

src/stage0 doesn't contain a checksum for {}. Pre-built arti

Error message

src/stage0 doesn't contain a checksum for {}. Pre-built artifacts might not be available for this target at this time, see https://doc.rust-lang.org/nightly/rustc/platform-support.html for more information.

What it means

Raised by the get() function in bootstrap.py at line 58 when downloading a stage0 pre-built artifact. The function checks if the requested URL exists as a key in the checksums dict (parsed from src/stage0). If the URL is absent, Rust's bootstrap has no known checksum and therefore no pre-built binary for that artifact, so it refuses to download an unverified file. The message links to the platform-support page listing which targets have pre-built artifacts.

Source

Thrown at src/bootstrap/bootstrap.py:58

            return cpus
    try:
        return cpu_count()
    except NotImplementedError:
        return 1


def eprint(*args, **kwargs):
    kwargs["file"] = sys.stderr
    print(*args, **kwargs)


def get(base, url, path, checksums, verbose=0):
    with tempfile.NamedTemporaryFile(delete=False) as temp_file:
        temp_path = temp_file.name

    try:
        if url not in checksums:
            raise RuntimeError(
                (
                    "src/stage0 doesn't contain a checksum for {}. "
                    "Pre-built artifacts might not be available for this "
                    "target at this time, see https://doc.rust-lang.org/nightly"
                    "/rustc/platform-support.html for more information."
                ).format(url)
            )
        sha256 = checksums[url]
        if os.path.exists(path):
            if verify(path, sha256, False):
                if verbose > 0:
                    eprint("using already-download file", path)
                return
            else:
                if verbose > 0:
                    eprint(
                        "ignoring already-download file",
                        path,

View on GitHub (pinned to 7088e4b63a)

Solutions

  1. Check https://doc.rust-lang.org/nightly/rustc/platform-support.html to confirm whether pre-built artifacts exist for your target.
  2. If the target is unsupported for pre-builds, provide a stage0 compiler manually (set build.rustc and build.cargo in config.toml to local binaries).
  3. Update src/stage0 from the upstream rust-lang/rust repository to get the latest checksum entries.
  4. Build for a supported host triple first, then cross-compile to the desired target.
Defensive patterns

Strategy: validation

Validate before calling

# Before calling get(), check that the URL exists in the checksums dict.
def safe_get(base, url, path, checksums, verbose=0):
    if url not in checksums:
        print(f'WARNING: no pre-built artifact for {url}. Skipping.')
        return None
    get(base, url, path, checksums, verbose)

Try / catch

try:
    get(base, url, path, checksums, verbose)
except RuntimeError as e:
    if 'does not contain a checksum' in str(e):
        # No pre-built artifact for this target
        print(f'No stage0 artifact for {url}. Provide build.cargo/build.rustc manually.')
    raise

Prevention

When it happens

Trigger: get(base, url, path, checksums, verbose) is called during download_toolchain() for a stage0 component. At line 57, 'if url not in checksums' is true. This occurs when the build target triple (host or target) has no entry in src/stage0 for the current nightly, meaning no pre-built rustc/cargo/std component exists for that platform.

Common situations: Building Rust from source for a target triple that is Tier 2/Tier 3 without pre-built nightly artifacts (e.g. uncommon embedded or bare-metal targets); a stale or misformatted src/stage0 file; building a very new target whose artifacts haven't been published yet; or using a local fork of the repo with a modified stage0 that's missing entries.

Related errors


AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10). Data as JSON: /api/errors/d9200fb4c4c9016c. Report an issue: GitHub.