pub struct Config {Show 166 fields
pub change_id: Option<usize>,
pub bypass_bootstrap_lock: bool,
pub ccache: Option<String>,
pub ninja_in_file: bool,
pub verbose: usize,
pub submodules: Option<bool>,
pub compiler_docs: bool,
pub library_docs_private_items: bool,
pub docs_minification: bool,
pub docs: bool,
pub locked_deps: bool,
pub vendor: bool,
pub target_config: HashMap<TargetSelection, Target>,
pub full_bootstrap: bool,
pub bootstrap_cache_path: Option<PathBuf>,
pub extended: bool,
pub tools: Option<HashSet<String>>,
pub sanitizers: bool,
pub profiler: bool,
pub omit_git_hash: bool,
pub skip: Vec<PathBuf>,
pub include_default_paths: bool,
pub rustc_error_format: Option<String>,
pub json_output: bool,
pub test_compare_mode: bool,
pub color: Color,
pub patch_binaries_for_nix: Option<bool>,
pub stage0_metadata: Stage0,
pub android_ndk: Option<PathBuf>,
pub optimized_compiler_builtins: bool,
pub stdout_is_tty: bool,
pub stderr_is_tty: bool,
pub on_fail: Option<String>,
pub stage: u32,
pub keep_stage: Vec<u32>,
pub keep_stage_std: Vec<u32>,
pub src: PathBuf,
pub config: Option<PathBuf>,
pub jobs: Option<u32>,
pub cmd: Subcommand,
pub incremental: bool,
pub dry_run: DryRun,
pub dump_bootstrap_shims: bool,
pub free_args: Vec<String>,
download_rustc_commit: Option<String>,
pub deny_warnings: bool,
pub backtrace_on_ice: bool,
pub llvm_assertions: bool,
pub llvm_tests: bool,
pub llvm_enzyme: bool,
pub llvm_plugins: bool,
pub llvm_optimize: bool,
pub llvm_thin_lto: bool,
pub llvm_release_debuginfo: bool,
pub llvm_static_stdcpp: bool,
pub llvm_libzstd: bool,
llvm_link_shared: Cell<Option<bool>>,
pub llvm_clang_cl: Option<String>,
pub llvm_targets: Option<String>,
pub llvm_experimental_targets: Option<String>,
pub llvm_link_jobs: Option<u32>,
pub llvm_version_suffix: Option<String>,
pub llvm_use_linker: Option<String>,
pub llvm_allow_old_toolchain: bool,
pub llvm_polly: bool,
pub llvm_clang: bool,
pub llvm_enable_warnings: bool,
pub llvm_from_ci: bool,
pub llvm_build_config: HashMap<String, String>,
pub lld_mode: LldMode,
pub lld_enabled: bool,
pub llvm_tools_enabled: bool,
pub llvm_bitcode_linker_enabled: bool,
pub llvm_cflags: Option<String>,
pub llvm_cxxflags: Option<String>,
pub llvm_ldflags: Option<String>,
pub llvm_use_libcxx: bool,
pub rust_optimize: RustOptimize,
pub rust_codegen_units: Option<u32>,
pub rust_codegen_units_std: Option<u32>,
pub rust_debug_assertions: bool,
pub rust_debug_assertions_std: bool,
pub rust_overflow_checks: bool,
pub rust_overflow_checks_std: bool,
pub rust_debug_logging: bool,
pub rust_debuginfo_level_rustc: DebuginfoLevel,
pub rust_debuginfo_level_std: DebuginfoLevel,
pub rust_debuginfo_level_tools: DebuginfoLevel,
pub rust_debuginfo_level_tests: DebuginfoLevel,
pub rust_rpath: bool,
pub rust_strip: bool,
pub rust_frame_pointers: bool,
pub rust_stack_protector: Option<String>,
pub rustc_parallel: bool,
pub rustc_default_linker: Option<String>,
pub rust_optimize_tests: bool,
pub rust_dist_src: bool,
pub rust_codegen_backends: Vec<String>,
pub rust_verify_llvm_ir: bool,
pub rust_thin_lto_import_instr_limit: Option<u32>,
pub rust_randomize_layout: bool,
pub rust_remap_debuginfo: bool,
pub rust_new_symbol_mangling: Option<bool>,
pub rust_profile_use: Option<String>,
pub rust_profile_generate: Option<String>,
pub rust_lto: RustcLto,
pub rust_validate_mir_opts: Option<u32>,
pub rust_std_features: BTreeSet<String>,
pub llvm_profile_use: Option<String>,
pub llvm_profile_generate: bool,
pub llvm_libunwind_default: Option<LlvmLibunwind>,
pub enable_bolt_settings: bool,
pub reproducible_artifacts: Vec<String>,
pub build: TargetSelection,
pub hosts: Vec<TargetSelection>,
pub targets: Vec<TargetSelection>,
pub local_rebuild: bool,
pub jemalloc: bool,
pub control_flow_guard: bool,
pub ehcont_guard: bool,
pub dist_sign_folder: Option<PathBuf>,
pub dist_upload_addr: Option<String>,
pub dist_compression_formats: Option<Vec<String>>,
pub dist_compression_profile: String,
pub dist_include_mingw_linker: bool,
pub dist_vendor: bool,
pub backtrace: bool,
pub low_priority: bool,
pub channel: String,
pub description: Option<String>,
pub verbose_tests: bool,
pub save_toolstates: Option<PathBuf>,
pub print_step_timings: bool,
pub print_step_rusage: bool,
pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
pub docdir: Option<PathBuf>,
pub bindir: PathBuf,
pub libdir: Option<PathBuf>,
pub mandir: Option<PathBuf>,
pub codegen_tests: bool,
pub nodejs: Option<PathBuf>,
pub npm: Option<PathBuf>,
pub gdb: Option<PathBuf>,
pub lldb: Option<PathBuf>,
pub python: Option<PathBuf>,
pub reuse: Option<PathBuf>,
pub cargo_native_static: bool,
pub configure_args: Vec<String>,
pub out: PathBuf,
pub rust_info: GitInfo,
pub cargo_info: GitInfo,
pub rust_analyzer_info: GitInfo,
pub clippy_info: GitInfo,
pub miri_info: GitInfo,
pub rustfmt_info: GitInfo,
pub enzyme_info: GitInfo,
pub in_tree_llvm_info: GitInfo,
pub in_tree_gcc_info: GitInfo,
pub initial_cargo: PathBuf,
pub initial_rustc: PathBuf,
pub initial_cargo_clippy: Option<PathBuf>,
initial_rustfmt: RefCell<RustfmtState>,
pub paths: Vec<PathBuf>,
}
Expand description
Global configuration for the entire build and/or bootstrap.
This structure is parsed from config.toml
, and some of the fields are inferred from git
or build-time parameters.
Note that this structure is not decoded directly into, but rather it is
filled out from the decoded forms of the structs below. For documentation
each field, see the corresponding fields in
config.example.toml
.
Fields§
§change_id: Option<usize>
§bypass_bootstrap_lock: bool
§ccache: Option<String>
§ninja_in_file: bool
Call Build::ninja() instead of this.
verbose: usize
§submodules: Option<bool>
§compiler_docs: bool
§library_docs_private_items: bool
§docs_minification: bool
§docs: bool
§locked_deps: bool
§vendor: bool
§target_config: HashMap<TargetSelection, Target>
§full_bootstrap: bool
§bootstrap_cache_path: Option<PathBuf>
§extended: bool
§tools: Option<HashSet<String>>
§sanitizers: bool
§profiler: bool
§omit_git_hash: bool
§skip: Vec<PathBuf>
§include_default_paths: bool
§rustc_error_format: Option<String>
§json_output: bool
§test_compare_mode: bool
§color: Color
§patch_binaries_for_nix: Option<bool>
§stage0_metadata: Stage0
§android_ndk: Option<PathBuf>
§optimized_compiler_builtins: bool
Whether to use the c
feature of the compiler_builtins
crate.
stdout_is_tty: bool
§stderr_is_tty: bool
§on_fail: Option<String>
§stage: u32
§keep_stage: Vec<u32>
§keep_stage_std: Vec<u32>
§src: PathBuf
§config: Option<PathBuf>
defaults to config.toml
jobs: Option<u32>
§cmd: Subcommand
§incremental: bool
§dry_run: DryRun
§dump_bootstrap_shims: bool
§free_args: Vec<String>
Arguments appearing after --
to be forwarded to tools,
e.g. --fix-broken
or test arguments.
download_rustc_commit: Option<String>
None
if we shouldn’t download CI compiler artifacts, or the commit to download if we should.
deny_warnings: bool
§backtrace_on_ice: bool
§llvm_assertions: bool
§llvm_tests: bool
§llvm_enzyme: bool
§llvm_plugins: bool
§llvm_optimize: bool
§llvm_thin_lto: bool
§llvm_release_debuginfo: bool
§llvm_static_stdcpp: bool
§llvm_libzstd: bool
None
if llvm_from_ci
is true and we haven’t yet downloaded llvm.
llvm_clang_cl: Option<String>
§llvm_targets: Option<String>
§llvm_experimental_targets: Option<String>
§llvm_link_jobs: Option<u32>
§llvm_version_suffix: Option<String>
§llvm_use_linker: Option<String>
§llvm_allow_old_toolchain: bool
§llvm_polly: bool
§llvm_clang: bool
§llvm_enable_warnings: bool
§llvm_from_ci: bool
§llvm_build_config: HashMap<String, String>
§lld_mode: LldMode
§lld_enabled: bool
§llvm_tools_enabled: bool
§llvm_bitcode_linker_enabled: bool
§llvm_cflags: Option<String>
§llvm_cxxflags: Option<String>
§llvm_ldflags: Option<String>
§llvm_use_libcxx: bool
§rust_optimize: RustOptimize
§rust_codegen_units: Option<u32>
§rust_codegen_units_std: Option<u32>
§rust_debug_assertions: bool
§rust_debug_assertions_std: bool
§rust_overflow_checks: bool
§rust_overflow_checks_std: bool
§rust_debug_logging: bool
§rust_debuginfo_level_rustc: DebuginfoLevel
§rust_debuginfo_level_std: DebuginfoLevel
§rust_debuginfo_level_tools: DebuginfoLevel
§rust_debuginfo_level_tests: DebuginfoLevel
§rust_rpath: bool
§rust_strip: bool
§rust_frame_pointers: bool
§rust_stack_protector: Option<String>
§rustc_parallel: bool
§rustc_default_linker: Option<String>
§rust_optimize_tests: bool
§rust_dist_src: bool
§rust_codegen_backends: Vec<String>
§rust_verify_llvm_ir: bool
§rust_thin_lto_import_instr_limit: Option<u32>
§rust_randomize_layout: bool
§rust_remap_debuginfo: bool
§rust_new_symbol_mangling: Option<bool>
§rust_profile_use: Option<String>
§rust_profile_generate: Option<String>
§rust_lto: RustcLto
§rust_validate_mir_opts: Option<u32>
§rust_std_features: BTreeSet<String>
§llvm_profile_use: Option<String>
§llvm_profile_generate: bool
§llvm_libunwind_default: Option<LlvmLibunwind>
§enable_bolt_settings: bool
§reproducible_artifacts: Vec<String>
§build: TargetSelection
§hosts: Vec<TargetSelection>
§targets: Vec<TargetSelection>
§local_rebuild: bool
§jemalloc: bool
§control_flow_guard: bool
§ehcont_guard: bool
§dist_sign_folder: Option<PathBuf>
§dist_upload_addr: Option<String>
§dist_compression_formats: Option<Vec<String>>
§dist_compression_profile: String
§dist_include_mingw_linker: bool
§dist_vendor: bool
§backtrace: bool
§low_priority: bool
§channel: String
§description: Option<String>
§verbose_tests: bool
§save_toolstates: Option<PathBuf>
§print_step_timings: bool
§print_step_rusage: bool
§musl_root: Option<PathBuf>
§prefix: Option<PathBuf>
§sysconfdir: Option<PathBuf>
§datadir: Option<PathBuf>
§docdir: Option<PathBuf>
§bindir: PathBuf
§libdir: Option<PathBuf>
§mandir: Option<PathBuf>
§codegen_tests: bool
§nodejs: Option<PathBuf>
§npm: Option<PathBuf>
§gdb: Option<PathBuf>
§lldb: Option<PathBuf>
§python: Option<PathBuf>
§reuse: Option<PathBuf>
§cargo_native_static: bool
§configure_args: Vec<String>
§out: PathBuf
§rust_info: GitInfo
§cargo_info: GitInfo
§rust_analyzer_info: GitInfo
§clippy_info: GitInfo
§miri_info: GitInfo
§rustfmt_info: GitInfo
§enzyme_info: GitInfo
§in_tree_llvm_info: GitInfo
§in_tree_gcc_info: GitInfo
§initial_cargo: PathBuf
§initial_rustc: PathBuf
§initial_cargo_clippy: Option<PathBuf>
§initial_rustfmt: RefCell<RustfmtState>
§paths: Vec<PathBuf>
The paths to work with. For example: with ./x check foo bar
we get
paths=["foo", "bar"]
.
Implementations§
source§impl Config
impl Config
pub fn default_opts() -> Config
pub(crate) fn get_builder_toml( &self, build_name: &str, ) -> Result<TomlConfig, Error>
pub(crate) fn get_toml(file: &Path) -> Result<TomlConfig, Error>
pub fn parse(flags: Flags) -> Config
pub(crate) fn parse_inner( flags: Flags, get_toml: impl Fn(&Path) -> Result<TomlConfig, Error>, ) -> Config
pub fn dry_run(&self) -> bool
sourcepub(crate) fn try_run(&self, cmd: &mut Command) -> Result<(), ()>
👎Deprecated: use Builder::try_run
instead where possible
pub(crate) fn try_run(&self, cmd: &mut Command) -> Result<(), ()>
Builder::try_run
instead where possibleRuns a command, printing out nice contextual information if it fails.
Exits if the command failed to execute at all, otherwise returns its
status.success()
.
pub(crate) fn test_args(&self) -> Vec<&str>
pub(crate) fn args(&self) -> Vec<&str>
sourcepub(crate) fn read_file_by_commit(&self, file: &Path, commit: &str) -> String
pub(crate) fn read_file_by_commit(&self, file: &Path, commit: &str) -> String
Returns the content of the given file at a specific commit.
sourcepub(crate) fn artifact_version_part(&self, commit: &str) -> String
pub(crate) fn artifact_version_part(&self, commit: &str) -> String
Bootstrap embeds a version number into the name of shared libraries it uploads in CI. Return the version it would have used for the given commit.
sourcepub fn bindir_relative(&self) -> &Path
pub fn bindir_relative(&self) -> &Path
Try to find the relative path of bindir
, otherwise return it in full.
sourcepub fn libdir_relative(&self) -> Option<&Path>
pub fn libdir_relative(&self) -> Option<&Path>
Try to find the relative path of libdir
.
sourcepub(crate) fn ci_llvm_root(&self) -> PathBuf
pub(crate) fn ci_llvm_root(&self) -> PathBuf
The absolute path to the downloaded LLVM artifacts.
sourcepub(crate) fn ci_rustc_dir(&self) -> PathBuf
pub(crate) fn ci_rustc_dir(&self) -> PathBuf
Directory where the extracted rustc-dev
component is stored.
Determine whether llvm should be linked dynamically.
If false
, llvm should be linked statically.
This is computed on demand since LLVM might have to first be downloaded from CI.
sourcepub(crate) fn download_rustc(&self) -> bool
pub(crate) fn download_rustc(&self) -> bool
Return whether we will use a downloaded, pre-compiled version of rustc, or just build from source.
pub(crate) fn download_rustc_commit(&self) -> Option<&str>
pub(crate) fn initial_rustfmt(&self) -> Option<PathBuf>
pub fn sanitizers_enabled(&self, target: TargetSelection) -> bool
pub fn needs_sanitizer_runtime_built(&self, target: TargetSelection) -> bool
pub fn any_sanitizers_to_build(&self) -> bool
pub fn profiler_path(&self, target: TargetSelection) -> Option<&str>
pub fn profiler_enabled(&self, target: TargetSelection) -> bool
pub fn any_profiler_enabled(&self) -> bool
pub fn rpath_enabled(&self, target: TargetSelection) -> bool
pub fn llvm_enabled(&self, target: TargetSelection) -> bool
pub fn llvm_libunwind(&self, target: TargetSelection) -> LlvmLibunwind
pub fn split_debuginfo(&self, target: TargetSelection) -> SplitDebuginfo
sourcepub fn submodules(&self) -> bool
pub fn submodules(&self) -> bool
Returns whether or not submodules should be managed by bootstrap.
pub fn codegen_backends(&self, target: TargetSelection) -> &[String]
pub fn default_codegen_backend(&self, target: TargetSelection) -> Option<String>
pub fn git_config(&self) -> GitConfig<'_>
sourcepub(crate) fn update_submodule(&self, relative_path: &str)
pub(crate) fn update_submodule(&self, relative_path: &str)
Given a path to the directory of a submodule, update it.
relative_path
should be relative to the root of the git repository, not an absolute path.
This does not update the submodule if config.toml
explicitly says
not to, or if we’re not in a git repository (like a plain source
tarball). Typically crate::Build::require_submodule
should be
used instead to provide a nice error to the user if the submodule is
missing.
sourcepub fn check_stage0_version(
&self,
program_path: &Path,
component_name: &'static str,
)
pub fn check_stage0_version( &self, program_path: &Path, component_name: &'static str, )
check rustc/cargo version is same or lower with 1 apart from the building one
sourcefn download_ci_rustc_commit(
&self,
download_rustc: Option<StringOrBool>,
llvm_assertions: bool,
) -> Option<String>
fn download_ci_rustc_commit( &self, download_rustc: Option<StringOrBool>, llvm_assertions: bool, ) -> Option<String>
Returns the commit to download, or None
if we shouldn’t download CI artifacts.
fn parse_download_ci_llvm( &self, download_ci_llvm: Option<StringOrBool>, asserts: bool, ) -> bool
source§impl Config
impl Config
Generic helpers that are useful anywhere in bootstrap.
pub fn is_verbose(&self) -> bool
pub(crate) fn create(&self, path: &Path, s: &str)
pub(crate) fn remove(&self, f: &Path)
sourcepub(crate) fn tempdir(&self) -> PathBuf
pub(crate) fn tempdir(&self) -> PathBuf
Create a temporary directory in out
and return its path.
NOTE: this temporary directory is shared between all steps; if you need an empty directory, create a new subdirectory inside it.
sourcepub(crate) fn check_run(&self, cmd: &mut BootstrapCommand) -> bool
pub(crate) fn check_run(&self, cmd: &mut BootstrapCommand) -> bool
Runs a command, printing out nice contextual information if it fails.
Returns false if do not execute at all, otherwise returns its
status.success()
.
sourcefn should_fix_bins_and_dylibs(&self) -> bool
fn should_fix_bins_and_dylibs(&self) -> bool
Whether or not fix_bin_or_dylib
needs to be run; can only be true
on NixOS
sourcefn fix_bin_or_dylib(&self, fname: &Path)
fn fix_bin_or_dylib(&self, fname: &Path)
Modifies the interpreter section of ‘fname’ to fix the dynamic linker, or the RPATH section, to fix the dynamic library search path
This is only required on NixOS and uses the PatchELF utility to change the interpreter/RPATH of ELF executables.
Please see https://nixos.org/patchelf.html for more information
fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str)
fn download_http_with_retries( &self, tempfile: &Path, url: &str, help_on_error: &str, )
fn unpack(&self, tarball: &Path, dst: &Path, pattern: &str)
source§impl Config
impl Config
Functions that are only ever called once, but named for clarify and to avoid thousand-line functions.
pub(crate) fn download_clippy(&self) -> PathBuf
sourcepub(crate) fn maybe_download_rustfmt(&self) -> Option<PathBuf>
pub(crate) fn maybe_download_rustfmt(&self) -> Option<PathBuf>
NOTE: rustfmt is a completely different toolchain than the bootstrap compiler, so it can’t reuse target directories or artifacts
pub(crate) fn ci_rust_std_contents(&self) -> Vec<String>
pub(crate) fn ci_rustc_dev_contents(&self) -> Vec<String>
fn ci_component_contents(&self, stamp_file: &str) -> Vec<String>
pub(crate) fn download_ci_rustc(&self, commit: &str)
pub(crate) fn download_beta_toolchain(&self)
fn download_toolchain( &self, version: &str, sysroot: &str, stamp_key: &str, extra_components: &[&str], download_component: fn(_: &Config, _: String, _: &str, _: &str), )
sourcefn download_ci_component(
&self,
filename: String,
prefix: &str,
commit_with_assertions: &str,
)
fn download_ci_component( &self, filename: String, prefix: &str, commit_with_assertions: &str, )
Download a single component of a CI-built toolchain (not necessarily a published nightly).
fn download_component( &self, mode: DownloadSource, filename: String, prefix: &str, key: &str, destination: &str, )
pub(crate) fn maybe_download_ci_llvm(&self)
fn download_ci_llvm(&self, llvm_sha: &str)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl !Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2904 bytes