rust-lang/rust · critical · Exception
{} not found
Error message
{} not found What it means
Raised by check_vendored_status() in bootstrap.py at line 1286 when use_vendored_sources is true but the vendor/ directory does not exist under rust_root. Vendored builds require all crate dependencies to be pre-downloaded into vendor/ (produced by 'x.py vendor'). The preceding eprint lines explain how to obtain vendored sources, including downloading a pre-vendored rustc-nightly-src tarball. The {} placeholder is the vendor_dir path.
Source
Thrown at src/bootstrap/bootstrap.py:1286
" Alternatively, use the pre-vendored `rustc-src` dist component."
)
eprint(
" To get a stable/beta/nightly version, download it from: "
)
eprint(
" "
"https://forge.rust-lang.org/infra/other-installation-methods.html#source-code"
)
eprint(
" To get a specific commit version, download it using the below URL,"
)
eprint(" replacing <commit> with a specific commit checksum: ")
eprint(" ", url)
eprint(
" Once you have the source downloaded, place the vendor directory"
)
eprint(" from the archive in the root of the rust project.")
raise Exception("{} not found".format(vendor_dir))
if not os.path.exists(cargo_dir):
eprint("ERROR: vendoring required, but .cargo/config does not exist.")
raise Exception("{} not found".format(cargo_dir))
def parse_args(args):
"""Parse the command line arguments that the python script needs."""
# Pass allow_abbrev=False to remove support for inexact matches (e.g.,
# `--json` turning on `--json-output`). The argument list here is partial,
# most flags are matched in the Rust bootstrap code. This prevents the
# default ambiguity checks in argparse from functioning correctly.
parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
parser.add_argument("-h", "--help", action="store_true")
parser.add_argument("--config")
parser.add_argument("--build-dir")
parser.add_argument("--build")View on GitHub (pinned to 7088e4b63a)
Solutions
- Run 'x.py vendor' on a machine with network access to populate the vendor/ directory, then copy it to the build machine.
- Download the pre-vendored rustc-nightly-src.tar.xz from https://ci-artifacts.rust-lang.org/rustc-builds/<commit>/ and extract its vendor/ directory into rust_root/vendor.
- If vendoring was auto-enabled because you ran as root (SUDO_USER detected), run the build as a non-root user instead.
- Disable vendored sources in config.toml (remove 'vendor = true') if network access is available.
Defensive patterns
Strategy: validation
Validate before calling
# Before building with vendored sources, verify vendor/ exists
import os
def check_vendor_dir(rust_root):
vendor_dir = os.path.join(rust_root, 'vendor')
if not os.path.exists(vendor_dir):
print(f'ERROR: {vendor_dir} not found. Run: x.py vendor')
return False
return True Try / catch
try:
build.check_vendored_status()
except Exception as e:
if 'not found' in str(e) and 'vendor' in str(e):
print('Vendor directory missing. Run: x.py vendor')
print('Or download pre-vendored sources from ci-artifacts.rust-lang.org')
raise Prevention
- Run 'x.py vendor' on a networked machine before attempting offline/vendored builds.
- Don't run x.py as root unless necessary — it auto-enables vendored sources (SUDO_USER detection).
- When distributing a source tarball, include both vendor/ and .cargo/config.
When it happens
Trigger: check_vendored_status() at line 1260-1262: self.use_vendored_sources is True (set by --vendored-sources flag, config.toml, or auto-enabled when running as root via SUDO_USER), and os.path.exists(vendor_dir) at line 1262 returns False where vendor_dir = rust_root/vendor.
Common situations: Building Rust in an air-gapped/offline environment with --vendor without first running 'x.py vendor'; running x.py as root (which auto-enables vendoring per line 1250-1255) without the vendor directory present; downloading a source tarball that didn't include vendor/; or accidentally deleting the vendor/ directory.
Related errors
- src/stage0 doesn't contain a checksum for {}. Pre-built arti
- failed verification
- failed to run: {args}
- no cargo executable found at `{}`
- Unrecognized config profile '{}'. Check src/bootstrap/defaul
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/ac92e80edcf6ee63.
Report an issue: GitHub.