{"record":{"id":"c7811d49cc418715","repo":"rust-lang/rust","slug":"unrecognized-config-profile-check-src-bootst","errorCode":null,"errorMessage":"Unrecognized config profile '{}'. Check src/bootstrap/defaults for available options.","messagePattern":"Unrecognized config profile '(.+?)'\\. Check src/bootstrap/defaults for available options\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/bootstrap/bootstrap.py","lineNumber":1386,"sourceCode":"    profile = RustBuild.get_toml_static(config_toml, \"profile\")\n    is_non_git_source = not os.path.exists(os.path.join(rust_root, \".git\"))\n\n    if profile is None and is_non_git_source:\n        profile = \"dist\"\n\n    if profile is not None:\n        # Allows creating alias for profile names, allowing\n        # profiles to be renamed while maintaining back compatibility\n        # Keep in sync with `profile_aliases` in config.rs\n        profile_aliases = {\"user\": \"dist\"}\n        include_file = \"bootstrap.{}.toml\".format(\n            profile_aliases.get(profile) or profile\n        )\n        include_dir = os.path.join(rust_root, \"src\", \"bootstrap\", \"defaults\")\n        include_path = os.path.join(include_dir, include_file)\n\n        if not os.path.exists(include_path):\n            raise Exception(\n                \"Unrecognized config profile '{}'. Check src/bootstrap/defaults\"\n                \" for available options.\".format(profile)\n            )\n\n        # HACK: This works because `self.get_toml()` returns the first match it finds for a\n        # specific key, so appending our defaults at the end allows the user to override them\n        with open(include_path, encoding=\"utf-8\") as included_toml:\n            config_toml += os.linesep + included_toml.read()\n\n    # Configure initial bootstrap\n    build = RustBuild(config_toml, args)\n    build.check_vendored_status()\n\n    if not os.path.exists(build.build_dir):\n        os.makedirs(os.path.realpath(build.build_dir))\n\n    # Fetch/build the bootstrap\n    build.download_toolchain()","sourceCodeStart":1368,"sourceCodeEnd":1404,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/bootstrap/bootstrap.py#L1368-L1404","documentation":"Raised in bootstrap.py at line 1386 when a config profile name passed via --profile (or the default) does not correspond to an existing file in src/bootstrap/defaults/. The profile is resolved to a filename 'bootstrap.<profile>.toml' (after applying profile_aliases, e.g. 'user' -> 'dist'), and if that file doesn't exist at src/bootstrap/defaults/bootstrap.<profile>.toml, the profile is unrecognized.","triggerScenarios":"At bootstrap.py:1374-1389: profile is not None (set by --profile flag or auto-set to 'dist' for non-git source builds at line 1372). include_path is computed as src/bootstrap/defaults/bootstrap.<profile>.toml (line 1383). os.path.exists(include_path) at line 1385 returns False.","commonSituations":"Typo in the --profile argument (e.g. '--profile developper' instead of '--profile developer'); using a profile name from a newer/older Rust version that doesn't exist in the current checkout; a custom profile that was never created in src/bootstrap/defaults/; or passing 'user' on a version where the alias to 'dist' isn't configured.","solutions":["List available profiles: 'ls src/bootstrap/defaults/' to see valid bootstrap.<name>.toml files.","Check for typos in the --profile argument.","Review profile_aliases at line 1378 (currently {'user': 'dist'}) to see if an alias applies.","Create a custom profile file at src/bootstrap/defaults/bootstrap.<your-profile>.toml if you need a new one."],"exampleFix":"# before\n./x.py build --profile developper\n# after (use the correct name)\n./x.py build --profile developer","handlingStrategy":"validation","validationCode":"# Before building, validate the profile name against available files\nimport os\ndef validate_profile(rust_root, profile):\n    profile_aliases = {'user': 'dist'}\n    resolved = profile_aliases.get(profile) or profile\n    include_path = os.path.join(\n        rust_root, 'src', 'bootstrap', 'defaults', f'bootstrap.{resolved}.toml'\n    )\n    if not os.path.exists(include_path):\n        available = os.listdir(os.path.join(rust_root, 'src', 'bootstrap', 'defaults'))\n        print(f'Invalid profile: {profile}. Available: {available}')\n        return False\n    return True","typeGuard":null,"tryCatchPattern":"try:\n    # ... bootstrap startup code\nexcept Exception as e:\n    if 'Unrecognized config profile' in str(e):\n        import os\n        defaults_dir = os.path.join('src', 'bootstrap', 'defaults')\n        print('Available profiles:', os.listdir(defaults_dir))\n    raise","preventionTips":["List valid profiles with 'ls src/bootstrap/defaults/' before using --profile.","Be aware of profile aliases (currently 'user' -> 'dist') when referencing profiles.","When upgrading Rust versions, check that your profile name still exists."],"tags":["bootstrap","rustc","configuration","profile","python"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}