pub struct Config {Show 143 fields
pub changelog_seen: Option<usize>,
pub change_id: Option<usize>,
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 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 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 use_lld: bool,
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 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 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 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>
§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
§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
§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
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>
§use_lld: bool
§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
§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>
§reproducible_artifacts: Vec<String>
§build: TargetSelection
§hosts: Vec<TargetSelection>
§targets: Vec<TargetSelection>
§local_rebuild: bool
§jemalloc: bool
§control_flow_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
impl Config
pub fn default_opts() -> Config
pub fn parse(args: &[String]) -> Config
fn parse_inner( args: &[String], get_toml: impl Fn(&Path) -> TomlConfig ) -> Config
pub(crate) 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()
.
sourcepub(crate) fn git(&self) -> Command
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.
pub(crate) fn test_args(&self) -> Vec<&str>
pub(crate) fn args(&self) -> Vec<&str>
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 verbose(&self, msg: &str)
pub fn sanitizers_enabled(&self, target: TargetSelection) -> bool
pub fn any_sanitizers_enabled(&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) -> bool
pub fn llvm_libunwind(&self, target: TargetSelection) -> LlvmLibunwind
pub fn submodules(&self, rust_info: &GitInfo) -> bool
pub fn default_codegen_backend(&self) -> Option<Interned<String>>
pub fn check_build_rustc_version(&self, rustc_path: &str)
sourcefn download_ci_rustc_commit(
&self,
download_rustc: Option<StringOrBool>
) -> Option<String>
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§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 Command) -> bool
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()
.
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 maybe_download_rustfmt(&self) -> Option<PathBuf>
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 !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
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: 2160 bytes