pub(crate) struct Session {Show 21 fields
pub(crate) config: Config,
pub(crate) version: String,
pub(crate) bootstrap_out: PathBuf,
pub(crate) fail_fast: bool,
pub(crate) test_target: TestTarget,
pub(crate) verbosity: usize,
pub(crate) initial_rustc: PathBuf,
pub(crate) initial_rustdoc: PathBuf,
pub(crate) initial_cargo: PathBuf,
pub(crate) initial_lld: PathBuf,
pub(crate) initial_relative_libdir: PathBuf,
pub(crate) initial_sysroot: PathBuf,
pub(crate) cc: HashMap<TargetSelection, Tool>,
pub(crate) cxx: HashMap<TargetSelection, Tool>,
pub(crate) ar: HashMap<TargetSelection, PathBuf>,
pub(crate) ranlib: HashMap<TargetSelection, PathBuf>,
pub(crate) wasi_sdk_path: Option<PathBuf>,
pub(crate) crates: HashMap<String, Crate>,
pub(crate) crate_paths: HashMap<PathBuf, String>,
pub(crate) is_sudo: bool,
pub(crate) prerelease_version: Cell<Option<u32>>,
}Expand description
Global configuration for the build system.
This structure transitively contains all configuration for the build system.
All filesystem-encoded configuration is in config, all flags are in
flags, and then parsed or probed information is listed in the keys below.
Fields§
§config: ConfigUser-specified configuration from command-line flags and bootstrap.toml.
version: String§bootstrap_out: PathBuf§fail_fast: bool§test_target: TestTarget§verbosity: usize§initial_rustc: PathBuf§initial_rustdoc: PathBuf§initial_cargo: PathBuf§initial_lld: PathBuf§initial_relative_libdir: PathBuf§initial_sysroot: PathBuf§cc: HashMap<TargetSelection, Tool>§cxx: HashMap<TargetSelection, Tool>§ar: HashMap<TargetSelection, PathBuf>§ranlib: HashMap<TargetSelection, PathBuf>§wasi_sdk_path: Option<PathBuf>§crates: HashMap<String, Crate>§crate_paths: HashMap<PathBuf, String>§is_sudo: bool§prerelease_version: Cell<Option<u32>>Implementations§
Source§impl Session
impl Session
Sourcepub(crate) fn new(config: Config) -> Session
pub(crate) fn new(config: Config) -> Session
Creates a new set of build configuration from the flags on the command
line and the filesystem config.
By default all build output will be placed in the current directory.
Sourcepub(crate) fn require_submodule(&self, submodule: &str, err_hint: Option<&str>)
pub(crate) fn require_submodule(&self, submodule: &str, err_hint: Option<&str>)
Updates a submodule, and exits with a failure if submodule management is disabled and the submodule does not exist.
The given submodule name should be its path relative to the root of the main repository.
The given err_hint will be shown to the user if the submodule is not
checked out and submodule management is disabled.
Sourcepub(crate) fn update_existing_submodules(&self)
pub(crate) fn update_existing_submodules(&self)
If any submodule has been initialized already, sync it unconditionally. This avoids contributors checking in a submodule change by accident.
Sourcepub(crate) fn update_existing_submodule(config: &Config, submodule: &str)
pub(crate) fn update_existing_submodule(config: &Config, submodule: &str)
Updates the given submodule only if it’s initialized already; nothing happens otherwise.
Sourcepub(crate) fn build(&mut self)
pub(crate) fn build(&mut self)
Executes the entire build, as configured by the flags and configuration.
pub(crate) fn rust_info(&self) -> &GitInfo
Sourcepub(crate) fn std_features(&self, target: TargetSelection) -> String
pub(crate) fn std_features(&self, target: TargetSelection) -> String
Gets the space-separated set of activated features for the standard library.
This can be configured with the std-features key in bootstrap.toml.
Sourcepub(crate) fn rustc_features(
&self,
kind: Kind,
target: TargetSelection,
crates: &[String],
) -> String
pub(crate) fn rustc_features( &self, kind: Kind, target: TargetSelection, crates: &[String], ) -> String
Gets the space-separated set of activated features for the compiler.
Sourcepub(crate) fn cargo_dir(&self, mode: Mode) -> &'static str
pub(crate) fn cargo_dir(&self, mode: Mode) -> &'static str
Component directory that Cargo will produce output into (e.g. release/debug)
pub(crate) fn tools_dir(&self, build_compiler: Compiler) -> PathBuf
Sourcepub(crate) fn stage_out(&self, build_compiler: Compiler, mode: Mode) -> PathBuf
pub(crate) fn stage_out(&self, build_compiler: Compiler, mode: Mode) -> PathBuf
Returns the root directory for all output generated in a particular stage when being built with a particular build compiler.
The mode indicates what the root directory is for.
Sourcepub(crate) fn cargo_out(
&self,
build_compiler: Compiler,
mode: Mode,
target: TargetSelection,
) -> PathBuf
pub(crate) fn cargo_out( &self, build_compiler: Compiler, mode: Mode, target: TargetSelection, ) -> PathBuf
Returns the root output directory for all Cargo output in a given stage, running a particular compiler, whether or not we’re building the standard library, and targeting the specified architecture.
Sourcepub(crate) fn doc_out(&self, target: TargetSelection) -> PathBuf
pub(crate) fn doc_out(&self, target: TargetSelection) -> PathBuf
Output directory for all documentation for a target
Sourcepub(crate) fn json_doc_out(&self, target: TargetSelection) -> PathBuf
pub(crate) fn json_doc_out(&self, target: TargetSelection) -> PathBuf
Output directory for all JSON-formatted documentation for a target
Sourcepub(crate) fn compiler_doc_out(&self, target: TargetSelection) -> PathBuf
pub(crate) fn compiler_doc_out(&self, target: TargetSelection) -> PathBuf
Output directory for all documentation for a target
Sourcepub(crate) fn vendored_crates_path(&self) -> Option<PathBuf>
pub(crate) fn vendored_crates_path(&self) -> Option<PathBuf>
Path to the vendored Rust crates.
Sourcepub(crate) fn native_dir(&self, target: TargetSelection) -> PathBuf
pub(crate) fn native_dir(&self, target: TargetSelection) -> PathBuf
Directory for libraries built from C/C++ code and shared between stages.
Sourcepub(crate) fn add_rust_test_threads(&self, cmd: &mut BootstrapCommand)
pub(crate) fn add_rust_test_threads(&self, cmd: &mut BootstrapCommand)
Adds the RUST_TEST_THREADS env var if necessary
Sourcepub(crate) fn rustc_snapshot_libdir(&self) -> PathBuf
pub(crate) fn rustc_snapshot_libdir(&self) -> PathBuf
Returns the libdir of the snapshot compiler.
Sourcepub(crate) fn rustc_snapshot_sysroot(&self) -> &Path
pub(crate) fn rustc_snapshot_sysroot(&self) -> &Path
Returns the sysroot of the snapshot compiler.
pub(crate) fn info(&self, msg: &str)
Sourcepub(crate) fn msg(
&self,
action: impl Into<Kind>,
what: impl Display,
mode: impl Into<Option<Mode>>,
target_and_stage: impl Into<TargetAndStage>,
target: impl Into<Option<TargetSelection>>,
) -> Option<Group>
pub(crate) fn msg( &self, action: impl Into<Kind>, what: impl Display, mode: impl Into<Option<Mode>>, target_and_stage: impl Into<TargetAndStage>, target: impl Into<Option<TargetSelection>>, ) -> Option<Group>
Return a Group guard for a Step that:
- Performs
action- If the action is
Kind::Test, useSession::msg_testinstead.
- If the action is
- On
what- Where
whatpossibly corresponds to amode
- Where
actionis performed with/on the given compiler (target_and_stage).- Since for some steps it is not possible to pass a single compiler here, it is also possible to pass the host and stage explicitly.
- With a given
target.
Sourcepub(crate) fn msg_test(
&self,
what: impl Display,
target: TargetSelection,
stage: u32,
) -> Option<Group>
pub(crate) fn msg_test( &self, what: impl Display, target: TargetSelection, stage: u32, ) -> Option<Group>
Return a Group guard for a Step that tests what with the given stage and target.
Use this instead of Session::msg for test steps, because for them it is not always clear
what exactly is a build compiler.
Sourcepub(crate) fn msg_unstaged(
&self,
action: impl Into<Kind>,
what: impl Display,
target: TargetSelection,
) -> Option<Group>
pub(crate) fn msg_unstaged( &self, action: impl Into<Kind>, what: impl Display, target: TargetSelection, ) -> Option<Group>
Return a Group guard for a Step that is only built once and isn’t affected by --stage.
pub(crate) fn group(&self, msg: &str) -> Option<Group>
Sourcepub(crate) fn jobs(&self) -> u32
pub(crate) fn jobs(&self) -> u32
Returns the number of parallel jobs that have been configured for this build.
pub(crate) fn debuginfo_map_to( &self, remap_scheme: RemapScheme, ) -> Option<String>
Sourcepub(crate) fn cc(&self, target: TargetSelection) -> PathBuf
pub(crate) fn cc(&self, target: TargetSelection) -> PathBuf
Returns the path to the C compiler for the target specified.
Sourcepub(crate) fn cc_tool(&self, target: TargetSelection) -> Tool
pub(crate) fn cc_tool(&self, target: TargetSelection) -> Tool
Returns the internal cc::Tool for the C compiler.
Sourcepub(crate) fn cxx_tool(&self, target: TargetSelection) -> Tool
pub(crate) fn cxx_tool(&self, target: TargetSelection) -> Tool
Returns the internal cc::Tool for the C++ compiler.
Sourcepub(crate) fn cc_handled_cflags(
&self,
target: TargetSelection,
c: CLang,
) -> Vec<String>
pub(crate) fn cc_handled_cflags( &self, target: TargetSelection, c: CLang, ) -> Vec<String>
Returns C flags that cc-rs thinks should be enabled for the
specified target by default.
Sourcepub(crate) fn cc_unhandled_cflags(
&self,
target: TargetSelection,
c: CLang,
) -> Vec<String>
pub(crate) fn cc_unhandled_cflags( &self, target: TargetSelection, c: CLang, ) -> Vec<String>
Returns extra C flags that cc-rs doesn’t handle.
Sourcepub(crate) fn ar(&self, target: TargetSelection) -> Option<PathBuf>
pub(crate) fn ar(&self, target: TargetSelection) -> Option<PathBuf>
Returns the path to the ar archive utility for the target specified.
Sourcepub(crate) fn ranlib(&self, target: TargetSelection) -> Option<PathBuf>
pub(crate) fn ranlib(&self, target: TargetSelection) -> Option<PathBuf>
Returns the path to the ranlib utility for the target specified.
Sourcepub(crate) fn cxx(&self, target: TargetSelection) -> Result<PathBuf, String>
pub(crate) fn cxx(&self, target: TargetSelection) -> Result<PathBuf, String>
Returns the path to the C++ compiler for the target specified.
Sourcepub(crate) fn linker(&self, target: TargetSelection) -> Option<PathBuf>
pub(crate) fn linker(&self, target: TargetSelection) -> Option<PathBuf>
Returns the path to the linker for the given target if it needs to be overridden.
pub(crate) fn is_lld_direct_linker(&self, target: TargetSelection) -> bool
Sourcepub(crate) fn crt_static(&self, target: TargetSelection) -> Option<bool>
pub(crate) fn crt_static(&self, target: TargetSelection) -> Option<bool>
Returns if this target should statically link the C runtime, if specified
Sourcepub(crate) fn musl_root(&self, target: TargetSelection) -> Option<&Path>
pub(crate) fn musl_root(&self, target: TargetSelection) -> Option<&Path>
Returns the “musl root” for this target, if defined.
If this is a native target (host is also musl) and no musl-root is given, it falls back to the system toolchain in /usr.
Sourcepub(crate) fn musl_libdir(&self, target: TargetSelection) -> Option<PathBuf>
pub(crate) fn musl_libdir(&self, target: TargetSelection) -> Option<PathBuf>
Returns the “musl libdir” for this target.
Sourcepub(crate) fn wasi_libdir(&self, target: TargetSelection) -> Option<PathBuf>
pub(crate) fn wasi_libdir(&self, target: TargetSelection) -> Option<PathBuf>
Returns the lib directory for the WASI target specified, if
configured.
This first consults wasi-root as configured in per-target
configuration, and failing that it assumes that $WASI_SDK_PATH is
set in the environment, and failing that None is returned.
Sourcepub(crate) fn no_std(&self, target: TargetSelection) -> Option<bool>
pub(crate) fn no_std(&self, target: TargetSelection) -> Option<bool>
Returns true if this is a no-std target, if defined
Sourcepub(crate) fn remote_tested(&self, target: TargetSelection) -> bool
pub(crate) fn remote_tested(&self, target: TargetSelection) -> bool
Returns true if the target will be tested using the remote-test-client
and remote-test-server binaries.
Sourcepub(crate) fn runner(&self, target: TargetSelection) -> Option<String>
pub(crate) fn runner(&self, target: TargetSelection) -> Option<String>
Returns an optional “runner” to pass to compiletest when executing
test binaries.
An example of this would be a WebAssembly runtime when testing the wasm targets.
Sourcefn default_wasi_runner(&self, target: TargetSelection) -> Option<String>
fn default_wasi_runner(&self, target: TargetSelection) -> Option<String>
When a runner configuration is not provided and a WASI-looking target
is being tested this is consulted to prove the environment to see if
there’s a runtime already lying around that seems reasonable to use.
Sourcepub(crate) fn tool_enabled(&self, tool: &str) -> bool
pub(crate) fn tool_enabled(&self, tool: &str) -> bool
Returns whether the specified tool is configured as part of this build.
This requires that both the extended key is set and the tools key is
either unset or specifically contains the specified tool.
Sourcepub(crate) fn qemu_rootfs(&self, target: TargetSelection) -> Option<&Path>
pub(crate) fn qemu_rootfs(&self, target: TargetSelection) -> Option<&Path>
Returns the root of the “rootfs” image that this target will be using, if one was configured.
If Some is returned then that means that tests for this target are
emulated with QEMU and binaries will need to be shipped to the emulator.
Sourcepub(crate) fn force_use_stage1(
&self,
stage: u32,
target: TargetSelection,
) -> bool
pub(crate) fn force_use_stage1( &self, stage: u32, target: TargetSelection, ) -> bool
Tests whether the compiler compiling for target should be forced to
use a stage1 compiler instead.
Currently, by default, the build system does not perform a “full bootstrap” by default where we compile the compiler three times. Instead, we compile the compiler two times. The final stage (stage2) just copies the libraries from the previous stage, which is what this method detects.
Here we return true if:
- The build isn’t performing a full bootstrap
- The
compileris in the final stage, 2 - We’re not cross-compiling, so the artifacts are already available in stage1
When all of these conditions are met the build will lift artifacts from the previous stage forward.
Sourcepub(crate) fn force_use_stage2(&self, stage: u32) -> bool
pub(crate) fn force_use_stage2(&self, stage: u32) -> bool
Checks whether the compiler compiling for target should be forced to
use a stage2 compiler instead.
When we download the pre-compiled version of rustc and compiler stage is >= 2, it should be forced to use a stage2 compiler.
Sourcepub(crate) fn release(&self, num: &str) -> String
pub(crate) fn release(&self, num: &str) -> String
Given num in the form “a.b.c” return a “release string” which
describes the release version number.
For example on nightly this returns “a.b.c-nightly”, on beta it returns “a.b.c-beta.1” and on stable it just returns “a.b.c”.
fn beta_prerelease_version(&self) -> u32
Sourcepub(crate) fn rust_release(&self) -> String
pub(crate) fn rust_release(&self) -> String
Returns the value of release above for Rust itself.
Sourcepub(crate) fn rust_package_vers(&self) -> String
pub(crate) fn rust_package_vers(&self) -> String
Returns the “package version” for a component.
The package version is typically what shows up in the names of tarballs. For channels like beta/nightly it’s just the channel name, otherwise it’s the release version.
Sourcepub(crate) fn rust_version(&self) -> String
pub(crate) fn rust_version(&self) -> String
Returns the version string associated with this compiler for Rust
itself.
Note that this is a descriptive string which includes the commit date, sha, version, etc.
Sourcepub(crate) fn release_num(&self, package: &str) -> String
pub(crate) fn release_num(&self, package: &str) -> String
Returns the a.b.c version that the given package is at.
Sourcepub(crate) fn unstable_features(&self) -> bool
pub(crate) fn unstable_features(&self) -> bool
Returns true if unstable features should be enabled for the compiler
we’re building.
Sourcepub(crate) fn in_tree_crates(
&self,
root: &str,
target: Option<TargetSelection>,
) -> Vec<&Crate>
pub(crate) fn in_tree_crates( &self, root: &str, target: Option<TargetSelection>, ) -> Vec<&Crate>
Returns a Vec of all the dependencies of the given root crate, including transitive dependencies and the root itself. Only includes “local” crates (those in the local source tree, not from a registry).
pub(crate) fn read_stamp_file( &self, stamp: &BuildStamp, ) -> Vec<(PathBuf, DependencyType)>
Sourcepub(crate) fn resolve_symlink_and_copy(&self, src: &Path, dst: &Path)
pub(crate) fn resolve_symlink_and_copy(&self, src: &Path, dst: &Path)
Copies a file from src to dst.
If src is a symlink, src will be resolved to the actual path
and copied to dst instead of the symlink itself.
Sourcepub(crate) fn copy_link(&self, src: &Path, dst: &Path, file_type: FileType)
pub(crate) fn copy_link(&self, src: &Path, dst: &Path, file_type: FileType)
Links a file from src to dst.
Attempts to use hard links if possible, falling back to copying.
You can neither rely on this being a copy nor it being a link,
so do not write to dst.
fn copy_link_internal(&self, src: &Path, dst: &Path, dereference_symlinks: bool)
Sourcepub(crate) fn cp_link_r(&self, src: &Path, dst: &Path)
pub(crate) fn cp_link_r(&self, src: &Path, dst: &Path)
Links the src directory recursively to dst. Both are assumed to exist
when this function is called.
Will attempt to use hard links if possible and fall back to copying.
Sourcepub(crate) fn cp_link_filtered(
&self,
src: &Path,
dst: &Path,
filter: &dyn Fn(&Path) -> bool,
)
pub(crate) fn cp_link_filtered( &self, src: &Path, dst: &Path, filter: &dyn Fn(&Path) -> bool, )
Copies the src directory recursively to dst. Both are assumed to exist
when this function is called.
Will attempt to use hard links if possible and fall back to copying.
Unwanted files or directories can be skipped
by returning false from the filter function.
fn cp_link_filtered_recurse( &self, src: &Path, dst: &Path, relative: &Path, filter: &dyn Fn(&Path) -> bool, )
pub(crate) fn copy_link_to_folder(&self, src: &Path, dest_folder: &Path)
pub(crate) fn install(&self, src: &Path, dstdir: &Path, file_type: FileType)
pub(crate) fn read(&self, path: &Path) -> String
pub(crate) fn create_dir(&self, dir: &Path)
pub(crate) fn remove_dir(&self, dir: &Path)
Sourcepub(crate) fn clear_dir(&self, dir: &Path)
pub(crate) fn clear_dir(&self, dir: &Path)
Make sure that dir will be an empty existing directory after this function ends.
If it existed before, it will be first deleted.
pub(crate) fn read_dir(&self, dir: &Path) -> impl Iterator<Item = DirEntry>
pub(crate) fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>( &self, src: P, link: Q, ) -> Result<()>
Sourcepub(crate) fn ninja(&self) -> bool
pub(crate) fn ninja(&self) -> bool
Returns if config.ninja is enabled, and checks for ninja existence, exiting with a nicer error message if not.
pub(crate) fn colored_stdout<R, F: FnOnce(&mut dyn WriteColor) -> R>( &self, f: F, ) -> R
pub(crate) fn colored_stderr<R, F: FnOnce(&mut dyn WriteColor) -> R>( &self, f: F, ) -> R
fn colored_stream_inner<R, F, C>(&self, constructor: C, is_tty: bool, f: F) -> R
pub(crate) fn report_summary(&self, path: &Path, start_time: Instant)
Methods from Deref<Target = Config>§
pub fn get_dry_run(&self) -> &DryRun
pub fn dry_run(&self) -> bool
pub fn is_running_on_ci(&self) -> bool
pub fn is_explicit_stage(&self) -> bool
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_rustc_dir(&self) -> PathBuf
pub(crate) fn ci_rustc_dir(&self) -> PathBuf
Directory where the extracted rustc-dev component is stored.
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>
Sourcepub fn do_if_verbose(&self, f: impl Fn())
pub fn do_if_verbose(&self, f: impl Fn())
Runs a function if verbosity is greater than 0
pub fn any_sanitizers_to_build(&self) -> bool
pub fn any_profiler_enabled(&self) -> bool
Sourcepub fn submodules(&self) -> bool
pub fn submodules(&self) -> bool
Returns whether or not submodules should be managed by bootstrap.
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 bootstrap.toml explicitly says
not to, or if we’re not in a git repository (like a plain source
tarball). Typically crate::core::session::Session::require_submodule should be
used instead to provide a nice error to the user if the submodule is
missing.
Sourcepub fn has_changes_from_upstream(&self, paths: &[&'static str]) -> bool
pub fn has_changes_from_upstream(&self, paths: &[&'static str]) -> bool
Returns true if any of the paths have been modified locally.
Sourcepub fn check_path_modifications(&self, paths: &[&'static str]) -> PathFreshness
pub fn check_path_modifications(&self, paths: &[&'static str]) -> PathFreshness
Checks whether any of the given paths have been modified w.r.t. upstream.
pub fn sanitizers_enabled(&self, target: TargetSelection) -> bool
pub fn needs_sanitizer_runtime_built(&self, target: TargetSelection) -> bool
pub fn profiler_path(&self, target: TargetSelection) -> Option<&str>
pub fn profiler_enabled(&self, target: TargetSelection) -> bool
Sourcepub fn enabled_codegen_backends(
&self,
target: TargetSelection,
) -> &[CodegenBackendKind]
pub fn enabled_codegen_backends( &self, target: TargetSelection, ) -> &[CodegenBackendKind]
Returns codegen backends that should be:
- Built and added to the sysroot when we build the compiler.
- Distributed when
x distis executed (if the codegen backend has a dist step).
Sourcepub fn default_codegen_backend(
&self,
target: TargetSelection,
) -> &CodegenBackendKind
pub fn default_codegen_backend( &self, target: TargetSelection, ) -> &CodegenBackendKind
Returns the codegen backend that should be configured as the default codegen backend for a rustc compiled by bootstrap.
pub fn allocator(&self, target: TargetSelection) -> Allocator
pub fn rpath_enabled(&self, target: TargetSelection) -> bool
pub fn optimized_compiler_builtins( &self, target: TargetSelection, ) -> &CompilerBuiltins
pub fn llvm_enabled(&self, target: TargetSelection) -> bool
pub fn llvm_libunwind(&self, target: TargetSelection) -> LlvmLibunwind
pub fn split_debuginfo(&self, target: TargetSelection) -> SplitDebuginfo
pub fn compress_debuginfo(&self, target: TargetSelection) -> CompressDebuginfo
Sourcepub fn is_host_target(&self, target: TargetSelection) -> bool
pub fn is_host_target(&self, target: TargetSelection) -> bool
Checks if the given target is the same as the host target.
Sourcepub fn is_rust_llvm(&self, llvm: &LlvmOutput, target: TargetSelection) -> bool
pub fn is_rust_llvm(&self, llvm: &LlvmOutput, target: TargetSelection) -> bool
Returns true if this is our custom, patched, version of LLVM.
This does not necessarily imply that we’re managing the llvm-project submodule.
pub fn exec_ctx(&self) -> &ExecutionContext
pub fn git_info(&self, omit_git_hash: bool, dir: &Path) -> GitInfo
pub(crate) fn get_builder_toml( &self, build_name: &str, ) -> Result<TomlConfig, Error>
pub fn is_verbose(&self) -> bool
pub(crate) fn create<P: AsRef<Path>>(&self, path: P, 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.
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 unpack(&self, tarball: &Path, dst: &Path, pattern: &str)
pub(crate) fn download_clippy(&self, initial_sysroot: &Path) -> 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_std_json_docs( &self, target: TargetSelection, commit: &str, ) -> Option<PathBuf>
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, )
Sourcepub(crate) fn maybe_download_ci_llvm(
&self,
target: TargetSelection,
) -> Option<PathBuf>
pub(crate) fn maybe_download_ci_llvm( &self, target: TargetSelection, ) -> Option<PathBuf>
Attempts to download LLVM from CI for the given target. Returns a path to the downloaded and extracted directory.
fn download_ci_llvm( &self, llvm_root: &Path, target: TargetSelection, llvm_sha: &str, )
pub fn download_ci_gcc(&self, gcc_sha: &str, root_dir: &Path)
Trait Implementations§
Source§impl AsRef<ExecutionContext> for Session
impl AsRef<ExecutionContext> for Session
Source§fn as_ref(&self) -> &ExecutionContext
fn as_ref(&self) -> &ExecutionContext
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Sync for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
§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: 4040 bytes