{"record":{"id":"ac92e80edcf6ee63","repo":"rust-lang/rust","slug":"not-found","errorCode":null,"errorMessage":"{} not found","messagePattern":"(.+?) not found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"src/bootstrap/bootstrap.py","lineNumber":1286,"sourceCode":"                    \"       Alternatively, use the pre-vendored `rustc-src` dist component.\"\n                )\n                eprint(\n                    \"       To get a stable/beta/nightly version, download it from: \"\n                )\n                eprint(\n                    \"       \"\n                    \"https://forge.rust-lang.org/infra/other-installation-methods.html#source-code\"\n                )\n                eprint(\n                    \"       To get a specific commit version, download it using the below URL,\"\n                )\n                eprint(\"       replacing <commit> with a specific commit checksum: \")\n                eprint(\"       \", url)\n                eprint(\n                    \"       Once you have the source downloaded, place the vendor directory\"\n                )\n                eprint(\"       from the archive in the root of the rust project.\")\n                raise Exception(\"{} not found\".format(vendor_dir))\n\n            if not os.path.exists(cargo_dir):\n                eprint(\"ERROR: vendoring required, but .cargo/config does not exist.\")\n                raise Exception(\"{} not found\".format(cargo_dir))\n\n\ndef parse_args(args):\n    \"\"\"Parse the command line arguments that the python script needs.\"\"\"\n\n    # Pass allow_abbrev=False to remove support for inexact matches (e.g.,\n    # `--json` turning on `--json-output`). The argument list here is partial,\n    # most flags are matched in the Rust bootstrap code. This prevents the\n    # default ambiguity checks in argparse from functioning correctly.\n    parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)\n    parser.add_argument(\"-h\", \"--help\", action=\"store_true\")\n    parser.add_argument(\"--config\")\n    parser.add_argument(\"--build-dir\")\n    parser.add_argument(\"--build\")","sourceCodeStart":1268,"sourceCodeEnd":1304,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/bootstrap/bootstrap.py#L1268-L1304","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Before building with vendored sources, verify vendor/ exists\nimport os\ndef check_vendor_dir(rust_root):\n    vendor_dir = os.path.join(rust_root, 'vendor')\n    if not os.path.exists(vendor_dir):\n        print(f'ERROR: {vendor_dir} not found. Run: x.py vendor')\n        return False\n    return True","typeGuard":null,"tryCatchPattern":"try:\n    build.check_vendored_status()\nexcept Exception as e:\n    if 'not found' in str(e) and 'vendor' in str(e):\n        print('Vendor directory missing. Run: x.py vendor')\n        print('Or download pre-vendored sources from ci-artifacts.rust-lang.org')\n    raise","preventionTips":["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."],"tags":["bootstrap","rustc","vendoring","offline-build","python"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}