Skip to main content

Module config

Module config 

Source
Expand description

Entry point for the config module.

Additionally, this module defines common types, enums, and helper functions used across various TOML configuration sections in bootstrap.toml.

It provides shared definitions for:

  • Data types deserialized from TOML.
  • Utility enums for specific configuration options.
  • Helper functions for managing configuration values.

Re-exportsΒ§

use std::collections::HashSet; πŸ”’
use std::fmt::Display; πŸ”’
use std::path::PathBuf; πŸ”’
use std::str::FromStr; πŸ”’
use serde::de::Unexpected; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserializer; πŸ”’
use serde_derive::Deserialize; πŸ”’
pub use target_selection::TargetSelection;
pub use toml::BUILDER_CONFIG_FILENAME;
pub use toml::change_id::ChangeId;
pub use toml::rust::BootstrapOverrideLld;
pub use toml::target::Target;
use crate::utils::helpers; πŸ”’

ModulesΒ§

config πŸ”’
This module defines the central Config struct, which aggregates all components of the bootstrap configuration into a single unit.
flags
Command-line interface of the bootstrap build system.
macros πŸ”’
This module defines two macros:
target_selection
toml
This module defines the structures that directly mirror the bootstrap.toml file’s format. These types are used for serde deserialization.

StructsΒ§

Config πŸ”’
Global configuration for the entire build and/or bootstrap.
LlvmPgoConfig πŸ”’

EnumsΒ§

Allocator
CompilerBuiltins
CompressDebuginfo
DebuggerPath
DebuginfoLevel
DryRun
GccCiMode
Determines how will GCC be provided.
LlvmCiMode
Determines how will LLVM be provided.
LlvmLibunwind
LlvmPgoGenerationMode πŸ”’
ReplaceOpt
Describes how to handle conflicts in merging two TomlConfig
RustcLto
LTO mode used for compiling rustc itself.
SplitDebuginfo
StringOrBool
StringOrInt
WouldBeValidFor πŸ”’

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.

TraitsΒ§

Merge πŸ”’

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. src is the source root directory, and config_path is 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 jemalloc boolean option with the new allocator option.
submodules_ πŸ”’
threads_from_config
update_submodule πŸ”’