Module helpers

Source
Expand description

Various utility functions used throughout bootstrap.

Simple things like testing the various filesystem operations here and there, not a lot of interesting happenings here unfortunately.

Re-exports§

pub use crate::utils::shared_helpers::dylib_path;
pub use crate::utils::shared_helpers::dylib_path_var;
pub use t;

Structs§

TimeIt

Enums§

LldThreads

Functions§

add_dylib_path
Adds a list of lookup paths to cmd’s dynamic library lookup path. If the dylib_path_var is already set for this cmd, the old value will be overwritten!
add_rustdoc_cargo_linker_args
check_cfg_arg
Create a --check-cfg argument invocation for a given name and it’s values.
check_run
dir_is_empty
dir_up_to_date 🔒
exe
extract_beta_rev
Extract the beta revision from the full version string.
forcing_clang_based_tests
get_clang_cl_resource_dir
Adapted from https://github.com/llvm/llvm-project/blob/782e91224601e461c019e0a4573bbccc6094fbcd/llvm/cmake/modules/HandleLLVMOptions.cmake#L1058-L1079
git
Prepares BootstrapCommand that runs git inside the source directory if given.
hex_encode
Converts T into a hexadecimal String.
is_aix_shared_archive 🔒
is_debug_info
Returns true if the file name given looks like a debug info file
is_dylib
Returns true if the file name given looks like a dynamic library.
is_valid_test_suite_arg
libdir
Returns the corresponding relative library directory that the compiler’s dylibs will be found in.
linker_args
Returns the linker arguments for rustc/rustdoc for the given builder and target.
linker_flags
Returns the linker arguments for rustc/rustdoc for the given builder and target, without the -Clinker flag.
lld_flag_no_threads 🔒
Returns a flag that configures LLD to use only a single thread. If we use an external LLD, we need to find out which version is it to know which flag should we pass to it (LLD older than version 10 had a different flag).
make
move_file
Rename a file if from and to are in the same filesystem or copy and remove the file otherwise
mtime
Returns the last-modified time for path, or zero if it doesn’t exist.
output
set_file_times
Sets the file times for a given file at path.
split_debuginfo
Returns the path to the split debug info for the specified file if it exists.
start_process
Spawn a process and return a closure that will wait for the process to finish and then return its output. This allows the spawned process to do work without immediately blocking bootstrap.
submodule_path_of
Return the path to the containing submodule if available.
symlink_dir
Symlinks two directories, using junctions on Windows and normal symlinks on Unix.
target_supports_cranelift_backend
timeit
Returns an RAII structure that prints out how long it took to drop.
unhashed_basename
Returns the filename without the hash prefix added by the cc crate.
up_to_date
Returns true if dst is up to date given that the file or files in src are used to generate it.
use_host_linker