Struct bootstrap::Config

source ·
pub struct Config {
Show 150 fields pub changelog_seen: Option<usize>, 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 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: Stage0Metadata, pub android_ndk: Option<PathBuf>, 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_plugins: bool, pub llvm_optimize: bool, pub llvm_thin_lto: bool, pub llvm_release_debuginfo: bool, pub llvm_static_stdcpp: 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_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_split_debuginfo: SplitDebuginfo, pub rust_rpath: bool, pub rust_strip: 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<Interned<String>>, pub rust_verify_llvm_ir: bool, pub rust_thin_lto_import_instr_limit: Option<u32>, 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 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 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 missing_tools: 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 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 initial_cargo: PathBuf, pub initial_rustc: 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§

§changelog_seen: Option<usize>§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§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: Stage0Metadata§android_ndk: Option<PathBuf>§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_plugins: bool§llvm_optimize: bool§llvm_thin_lto: bool§llvm_release_debuginfo: bool§llvm_static_stdcpp: bool§llvm_link_shared: Cell<Option<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_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_split_debuginfo: SplitDebuginfo§rust_rpath: bool§rust_strip: 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<Interned<String>>§rust_verify_llvm_ir: bool§rust_thin_lto_import_instr_limit: Option<u32>§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>§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§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§missing_tools: 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>§python: Option<PathBuf>§reuse: Option<PathBuf>§cargo_native_static: bool§configure_args: Vec<String>§out: PathBuf§rust_info: GitInfo§initial_cargo: PathBuf§initial_rustc: PathBuf§initial_rustfmt: RefCell<RustfmtState>§paths: Vec<PathBuf>

Implementations§

source§

impl Config

source

pub fn default_opts() -> Config

source

pub fn parse(args: &[String]) -> Config

source

fn parse_inner( args: &[String], get_toml: impl Fn(&Path) -> TomlConfig ) -> Config

source

pub fn dry_run(&self) -> bool

source

pub(crate) fn try_run(&self, cmd: &mut Command) -> Result<(), ()>

👎Deprecated: use Builder::try_run instead where possible

Runs a command, printing out nice contextual information if it fails. Exits if the command failed to execute at all, otherwise returns its status.success().

source

pub(crate) fn git(&self) -> Command

A git invocation which runs inside the source directory.

Use this rather than Command::new("git") in order to support out-of-tree builds.

source

pub(crate) fn test_args(&self) -> Vec<&str>

source

pub(crate) fn args(&self) -> Vec<&str>

source

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.

source

pub fn bindir_relative(&self) -> &Path

Try to find the relative path of bindir, otherwise return it in full.

source

pub fn libdir_relative(&self) -> Option<&Path>

Try to find the relative path of libdir.

source

pub(crate) fn ci_llvm_root(&self) -> PathBuf

The absolute path to the downloaded LLVM artifacts.

source

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.

source

pub(crate) fn download_rustc(&self) -> bool

Return whether we will use a downloaded, pre-compiled version of rustc, or just build from source.

source

pub(crate) fn download_rustc_commit(&self) -> Option<&str>

source

pub(crate) fn initial_rustfmt(&self) -> Option<PathBuf>

source

pub fn verbose(&self, msg: &str)

source

pub fn sanitizers_enabled(&self, target: TargetSelection) -> bool

source

pub fn any_sanitizers_enabled(&self) -> bool

source

pub fn profiler_path(&self, target: TargetSelection) -> Option<&str>

source

pub fn profiler_enabled(&self, target: TargetSelection) -> bool

source

pub fn any_profiler_enabled(&self) -> bool

source

pub fn rpath_enabled(&self, target: TargetSelection) -> bool

source

pub fn llvm_enabled(&self) -> bool

source

pub fn llvm_libunwind(&self, target: TargetSelection) -> LlvmLibunwind

source

pub fn submodules(&self, rust_info: &GitInfo) -> bool

source

pub fn default_codegen_backend(&self) -> Option<Interned<String>>

source

pub fn git_config(&self) -> GitConfig<'_>

source

pub fn check_build_rustc_version(&self, rustc_path: &str)

source

fn download_ci_rustc_commit( &self, download_rustc: Option<StringOrBool> ) -> Option<String>

Returns the commit to download, or None if we shouldn’t download CI artifacts.

source

fn parse_download_ci_llvm( &self, download_ci_llvm: Option<StringOrBool>, asserts: bool ) -> bool

source

pub fn last_modified_commit( &self, modified_paths: &[&str], option_name: &str, if_unchanged: bool ) -> Option<String>

Returns the last commit in which any of modified_paths were changed, or None if there are untracked changes in the working directory and if_unchanged is true.

source§

impl Config

Generic helpers that are useful anywhere in bootstrap.

source

pub fn is_verbose(&self) -> bool

source

pub(crate) fn create(&self, path: &Path, s: &str)

source

pub(crate) fn remove(&self, f: &Path)

source

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.

source

pub(crate) fn check_run(&self, cmd: &mut Command) -> 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().

source

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

source

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

source

fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str)

source

fn download_http_with_retries( &self, tempfile: &Path, url: &str, help_on_error: &str )

source

fn unpack(&self, tarball: &Path, dst: &Path, pattern: &str)

source

pub(crate) fn verify(&self, path: &Path, expected: &str) -> bool

Returns whether the SHA256 checksum of path matches expected.

source§

impl Config

Functions that are only ever called once, but named for clarify and to avoid thousand-line functions.

source

pub(crate) fn download_clippy(&self) -> PathBuf

source

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

source

pub(crate) fn ci_rust_std_contents(&self) -> Vec<String>

source

pub(crate) fn ci_rustc_dev_contents(&self) -> Vec<String>

source

fn ci_component_contents(&self, stamp_file: &str) -> Vec<String>

source

pub(crate) fn download_ci_rustc(&self, commit: &str)

source

pub(crate) fn download_beta_toolchain(&self)

source

fn download_toolchain( &self, version: &str, sysroot: &str, stamp_key: &str, extra_components: &[&str], download_component: fn(_: &Config, _: String, _: &str, _: &str) )

source

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).

source

fn download_component( &self, mode: DownloadSource, filename: String, prefix: &str, key: &str, destination: &str )

source

pub(crate) fn maybe_download_ci_llvm(&self)

source

fn download_ci_llvm(&self, llvm_sha: &str)

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

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: 2232 bytes