Expand description
This module defines the central Config struct, which aggregates all components
of the bootstrap configuration into a single unit.
It serves as the primary public interface for accessing the bootstrap configuration.
The module coordinates the overall configuration parsing process using logic from parsing.rs
and provides top-level methods such as Config::parse() for initialization, as well as
utility methods for querying and manipulating the complete configuration state.
Additionally, this module contains the core logic for parsing, validating, and inferring
the final Config from various raw inputs.
It manages the process of reading command-line arguments, environment variables,
and the bootstrap.toml fileβmerging them, applying defaults, and performing
cross-component validation. The main parse_inner function and its supporting
helpers reside here, transforming raw Toml data into the structured Config type.
Re-exportsΒ§
use std::collections::BTreeSet;πuse std::collections::HashMap;πuse std::collections::HashSet;πuse std::io::IsTerminal;πuse std::path::Path;πuse std::path::PathBuf;πuse std::path::absolute;πuse std::str::FromStr;πuse std::sync::Arc;πuse std::sync::Mutex;πuse std::sync::OnceLock;πuse std::cmp;πuse std::env;πuse std::env;πuse std::fs;πuse build_helper::ci::CiEnv;πuse build_helper::git::GitConfig;πuse build_helper::git::PathFreshness;πuse build_helper::git::check_path_modifications;πuse serde::Deserialize;πuse crate::core::backend::CodegenBackendKind;πuse crate::core::build_steps::llvm::LLVM_INVALIDATION_PATHS;πuse crate::core::build_steps::llvm::LlvmKind;πuse crate::core::build_steps::llvm::LlvmOutput;πuse crate::core::build_steps::test::failed_tests::collect_previously_failed_tests;πuse crate::core::config::flags::Color;πuse crate::core::config::flags::Flags;πuse crate::core::config::flags::Subcommand;πuse crate::core::config::flags::Warnings;πuse crate::core::config::target_selection::TargetSelectionList;πuse crate::core::config::toml::TomlConfig;πuse crate::core::config::toml::build::Build;πuse crate::core::config::toml::build::Tool;πuse crate::core::config::toml::change_id::ChangeId;πuse crate::core::config::toml::dist::Dist;πuse crate::core::config::toml::gcc::Gcc;πuse crate::core::config::toml::install::Install;πuse crate::core::config::toml::llvm::Llvm;πuse crate::core::config::toml::pgo::Pgo;πuse crate::core::config::toml::pgo::PgoConfig;πuse crate::core::config::toml::rust::BootstrapOverrideLld;πuse crate::core::config::toml::rust::Rust;πuse crate::core::config::toml::rust::RustOptimize;πuse crate::core::config::toml::rust::check_incompatible_options_for_ci_rustc;πuse crate::core::config::toml::rust::parse_codegen_backends;πuse crate::core::config::toml::target::DefaultLinuxLinkerOverride;πuse crate::core::config::toml::target::Target;πuse crate::core::config::toml::target::TomlTarget;πuse crate::core::config::toml::target::default_linux_linker_overrides;πuse crate::core::config::Allocator;πuse crate::core::config::CompilerBuiltins;πuse crate::core::config::CompressDebuginfo;πuse crate::core::config::DebuggerPath;πuse crate::core::config::DebuginfoLevel;πuse crate::core::config::DryRun;πuse crate::core::config::GccCiMode;πuse crate::core::config::LlvmCiMode;πuse crate::core::config::LlvmLibunwind;πuse crate::core::config::Merge;πuse crate::core::config::ReplaceOpt;πuse crate::core::config::RustcLto;πuse crate::core::config::SplitDebuginfo;πuse crate::core::config::StringOrBool;πuse crate::core::config::TargetSelection;πuse crate::core::config::threads_from_config;πuse crate::core::download::DownloadContext;πuse crate::core::download::is_download_ci_available;πuse crate::utils::channel;πuse crate::utils::channel::GitInfo;πuse crate::utils::exec::ExecutionContext;πuse crate::utils::exec::command;πuse crate::utils::helpers;πuse crate::utils::helpers::exe;πuse crate::utils::helpers::fail;πuse crate::utils::helpers::get_host_target;πuse crate::utils::helpers::t;π
StructsΒ§
- Config π
- Global configuration for the entire build and/or bootstrap.
- Llvm
PgoConfig
EnumsΒ§
ConstantsΒ§
- RUSTC_
IF_ UNCHANGED_ ALLOWED_ PATHS - Each path in this list is considered βallowedβ in the
download-rustc="if-unchanged"logic. This means they can be modified and changes to these paths should never trigger a compiler build when βif-unchangedβ is set.
FunctionsΒ§
- bad_
config π - check_
external_ πbinary_ version - Check that the version of an externally provided rustc/cargo is either the same or 1 version older than the in-tree version.
- check_
path_ modifications_ - compute_
src_ πdirectory_ via_ git - download_
ci_ rustc_ commit - find_
correct_ πsection_ for_ field - git_
config - git_
info - has_
changes_ from_ upstream - join_
oxford_ πcomma - load_
toml_ πconfig - Loads bootstrap TOML config and returns the config together with a path from where
it was loaded.
srcis the source root directory, andconfig_pathis an optionally provided path to the config. - parse_
download_ ci_ llvm - postprocess_
toml π - print_
rustc_ πmodifications - read_
file_ πby_ commit - Returns the content of the given file at a specific commit.
- reconcile_
jemalloc π - Reconciles the deprecated
jemallocboolean option with the newallocatoroption. - submodules_
- update_
submodule π