@@ -120,15 +120,13 @@ fn main() {
|
||||
};
|
||||
cmd.args(&args).env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
|
||||
|
||||
if let Some(crate_name) = crate_name {
|
||||
if let Some(target) = env::var_os("RUSTC_TIME") {
|
||||
if target == "all"
|
||||
|| target.into_string().unwrap().split(',').any(|c| c.trim() == crate_name)
|
||||
if let Some(crate_name) = crate_name
|
||||
&& let Some(target) = env::var_os("RUSTC_TIME")
|
||||
&& (target == "all"
|
||||
|| target.into_string().unwrap().split(',').any(|c| c.trim() == crate_name))
|
||||
{
|
||||
cmd.arg("-Ztime-passes");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Print backtrace in case of ICE
|
||||
if env::var("RUSTC_BACKTRACE_ON_ICE").is_ok() && env::var("RUST_BACKTRACE").is_err() {
|
||||
@@ -242,11 +240,11 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
if env::var_os("RUSTC_BOLT_LINK_FLAGS").is_some() {
|
||||
if let Some("rustc_driver") = crate_name {
|
||||
if env::var_os("RUSTC_BOLT_LINK_FLAGS").is_some()
|
||||
&& let Some("rustc_driver") = crate_name
|
||||
{
|
||||
cmd.arg("-Clink-args=-Wl,-q");
|
||||
}
|
||||
}
|
||||
|
||||
let is_test = args.iter().any(|a| a == "--test");
|
||||
if verbose > 2 {
|
||||
@@ -282,10 +280,10 @@ fn main() {
|
||||
(child, status)
|
||||
};
|
||||
|
||||
if env::var_os("RUSTC_PRINT_STEP_TIMINGS").is_some()
|
||||
|| env::var_os("RUSTC_PRINT_STEP_RUSAGE").is_some()
|
||||
if (env::var_os("RUSTC_PRINT_STEP_TIMINGS").is_some()
|
||||
|| env::var_os("RUSTC_PRINT_STEP_RUSAGE").is_some())
|
||||
&& let Some(crate_name) = crate_name
|
||||
{
|
||||
if let Some(crate_name) = crate_name {
|
||||
let dur = start.elapsed();
|
||||
// If the user requested resource usage data, then
|
||||
// include that in addition to the timing output.
|
||||
@@ -301,7 +299,6 @@ fn main() {
|
||||
rusage_data.unwrap_or_default(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if status.success() {
|
||||
std::process::exit(0);
|
||||
|
||||
@@ -626,20 +626,20 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
|
||||
|
||||
// Help the libc crate compile by assisting it in finding various
|
||||
// sysroot native libraries.
|
||||
if target.contains("musl") {
|
||||
if let Some(p) = builder.musl_libdir(target) {
|
||||
if target.contains("musl")
|
||||
&& let Some(p) = builder.musl_libdir(target)
|
||||
{
|
||||
let root = format!("native={}", p.to_str().unwrap());
|
||||
cargo.rustflag("-L").rustflag(&root);
|
||||
}
|
||||
}
|
||||
|
||||
if target.contains("-wasi") {
|
||||
if let Some(dir) = builder.wasi_libdir(target) {
|
||||
if target.contains("-wasi")
|
||||
&& let Some(dir) = builder.wasi_libdir(target)
|
||||
{
|
||||
let root = format!("native={}", dir.to_str().unwrap());
|
||||
cargo.rustflag("-L").rustflag(&root);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// By default, rustc uses `-Cembed-bitcode=yes`, and Cargo overrides that
|
||||
// with `-Cembed-bitcode=no` for non-LTO builds. However, libstd must be
|
||||
@@ -1391,13 +1391,14 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
|
||||
// found. This is to avoid the linker errors about undefined references to
|
||||
// `__llvm_profile_instrument_memop` when linking `rustc_driver`.
|
||||
let mut llvm_linker_flags = String::new();
|
||||
if builder.config.llvm_profile_generate && target.is_msvc() {
|
||||
if let Some(ref clang_cl_path) = builder.config.llvm_clang_cl {
|
||||
if builder.config.llvm_profile_generate
|
||||
&& target.is_msvc()
|
||||
&& let Some(ref clang_cl_path) = builder.config.llvm_clang_cl
|
||||
{
|
||||
// Add clang's runtime library directory to the search path
|
||||
let clang_rt_dir = get_clang_cl_resource_dir(builder, clang_cl_path);
|
||||
llvm_linker_flags.push_str(&format!("-L{}", clang_rt_dir.display()));
|
||||
}
|
||||
}
|
||||
|
||||
// The config can also specify its own llvm linker flags.
|
||||
if let Some(ref s) = builder.config.llvm_ldflags {
|
||||
|
||||
@@ -2276,12 +2276,13 @@ impl Step for LlvmTools {
|
||||
let target = self.target;
|
||||
|
||||
// Run only if a custom llvm-config is not used
|
||||
if let Some(config) = builder.config.target_config.get(&target) {
|
||||
if !builder.config.llvm_from_ci && config.llvm_config.is_some() {
|
||||
if let Some(config) = builder.config.target_config.get(&target)
|
||||
&& !builder.config.llvm_from_ci
|
||||
&& config.llvm_config.is_some()
|
||||
{
|
||||
builder.info(&format!("Skipping LlvmTools ({target}): external LLVM"));
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
if !builder.config.dry_run() {
|
||||
builder.require_submodule("src/llvm-project", None);
|
||||
@@ -2398,12 +2399,12 @@ impl Step for RustDev {
|
||||
let target = self.target;
|
||||
|
||||
/* run only if llvm-config isn't used */
|
||||
if let Some(config) = builder.config.target_config.get(&target) {
|
||||
if let Some(ref _s) = config.llvm_config {
|
||||
if let Some(config) = builder.config.target_config.get(&target)
|
||||
&& let Some(ref _s) = config.llvm_config
|
||||
{
|
||||
builder.info(&format!("Skipping RustDev ({target}): external LLVM"));
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
if !builder.config.dry_run() {
|
||||
builder.require_submodule("src/llvm-project", None);
|
||||
|
||||
@@ -318,11 +318,11 @@ pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
|
||||
// `into_path` produces an absolute path. Try to strip `cwd` to get a shorter
|
||||
// relative path.
|
||||
let mut path = entry.clone().into_path();
|
||||
if let Ok(cwd) = cwd {
|
||||
if let Ok(path2) = path.strip_prefix(cwd) {
|
||||
if let Ok(cwd) = cwd
|
||||
&& let Ok(path2) = path.strip_prefix(cwd)
|
||||
{
|
||||
path = path2.to_path_buf();
|
||||
}
|
||||
}
|
||||
path.display().to_string()
|
||||
});
|
||||
t!(tx.send(entry.into_path()));
|
||||
|
||||
@@ -107,8 +107,9 @@ pub fn prebuilt_llvm_config(
|
||||
|
||||
// If we're using a custom LLVM bail out here, but we can only use a
|
||||
// custom LLVM for the build triple.
|
||||
if let Some(config) = builder.config.target_config.get(&target) {
|
||||
if let Some(ref s) = config.llvm_config {
|
||||
if let Some(config) = builder.config.target_config.get(&target)
|
||||
&& let Some(ref s) = config.llvm_config
|
||||
{
|
||||
check_llvm_version(builder, s);
|
||||
let llvm_config = s.to_path_buf();
|
||||
let mut llvm_cmake_dir = llvm_config.clone();
|
||||
@@ -119,7 +120,6 @@ pub fn prebuilt_llvm_config(
|
||||
llvm_cmake_dir.push("llvm");
|
||||
return LlvmBuildStatus::AlreadyBuilt(LlvmResult { llvm_config, llvm_cmake_dir });
|
||||
}
|
||||
}
|
||||
|
||||
if handle_submodule_when_needed {
|
||||
// If submodules are disabled, this does nothing.
|
||||
@@ -467,11 +467,11 @@ impl Step for Llvm {
|
||||
cfg.define("LLVM_ENABLE_RUNTIMES", enabled_llvm_runtimes.join(";"));
|
||||
}
|
||||
|
||||
if let Some(num_linkers) = builder.config.llvm_link_jobs {
|
||||
if num_linkers > 0 {
|
||||
if let Some(num_linkers) = builder.config.llvm_link_jobs
|
||||
&& num_linkers > 0
|
||||
{
|
||||
cfg.define("LLVM_PARALLEL_LINK_JOBS", num_linkers.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
// https://llvm.org/docs/HowToCrossCompileLLVM.html
|
||||
if !builder.config.is_host_target(target) {
|
||||
@@ -596,11 +596,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
|
||||
|
||||
let version = get_llvm_version(builder, llvm_config);
|
||||
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
|
||||
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
||||
if major >= 19 {
|
||||
if let (Some(major), Some(_minor)) = (parts.next(), parts.next())
|
||||
&& major >= 19
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
panic!("\n\nbad LLVM version: {version}, need >=19\n\n")
|
||||
}
|
||||
|
||||
@@ -729,12 +729,10 @@ fn configure_cmake(
|
||||
|
||||
// If ccache is configured we inform the build a little differently how
|
||||
// to invoke ccache while also invoking our compilers.
|
||||
if use_compiler_launcher {
|
||||
if let Some(ref ccache) = builder.config.ccache {
|
||||
if use_compiler_launcher && let Some(ref ccache) = builder.config.ccache {
|
||||
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
|
||||
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
|
||||
}
|
||||
}
|
||||
cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
|
||||
.define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
|
||||
.define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
|
||||
@@ -791,21 +789,21 @@ fn configure_cmake(
|
||||
cxxflags.push(format!(" --target={target}"));
|
||||
}
|
||||
cfg.define("CMAKE_CXX_FLAGS", cxxflags);
|
||||
if let Some(ar) = builder.ar(target) {
|
||||
if ar.is_absolute() {
|
||||
if let Some(ar) = builder.ar(target)
|
||||
&& ar.is_absolute()
|
||||
{
|
||||
// LLVM build breaks if `CMAKE_AR` is a relative path, for some reason it
|
||||
// tries to resolve this path in the LLVM build directory.
|
||||
cfg.define("CMAKE_AR", sanitize_cc(&ar));
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ranlib) = builder.ranlib(target) {
|
||||
if ranlib.is_absolute() {
|
||||
if let Some(ranlib) = builder.ranlib(target)
|
||||
&& ranlib.is_absolute()
|
||||
{
|
||||
// LLVM build breaks if `CMAKE_RANLIB` is a relative path, for some reason it
|
||||
// tries to resolve this path in the LLVM build directory.
|
||||
cfg.define("CMAKE_RANLIB", sanitize_cc(&ranlib));
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ref flags) = builder.config.llvm_ldflags {
|
||||
ldflags.push_all(flags);
|
||||
@@ -1037,14 +1035,15 @@ impl Step for Lld {
|
||||
// when doing PGO on CI, cmake or clang-cl don't automatically link clang's
|
||||
// profiler runtime in. In that case, we need to manually ask cmake to do it, to avoid
|
||||
// linking errors, much like LLVM's cmake setup does in that situation.
|
||||
if builder.config.llvm_profile_generate && target.is_msvc() {
|
||||
if let Some(clang_cl_path) = builder.config.llvm_clang_cl.as_ref() {
|
||||
if builder.config.llvm_profile_generate
|
||||
&& target.is_msvc()
|
||||
&& let Some(clang_cl_path) = builder.config.llvm_clang_cl.as_ref()
|
||||
{
|
||||
// Find clang's runtime library directory and push that as a search path to the
|
||||
// cmake linker flags.
|
||||
let clang_rt_dir = get_clang_cl_resource_dir(builder, clang_cl_path);
|
||||
ldflags.push_all(format!("/libpath:{}", clang_rt_dir.display()));
|
||||
}
|
||||
}
|
||||
|
||||
// LLD is built as an LLVM tool, but is distributed outside of the `llvm-tools` component,
|
||||
// which impacts where it expects to find LLVM's shared library. This causes #80703.
|
||||
|
||||
@@ -154,11 +154,11 @@ Consider setting `rust.debuginfo-level = 1` in `bootstrap.toml`."#);
|
||||
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
||||
builder.ensure(Std::new(compiler, builder.config.build));
|
||||
|
||||
if let Some(opts) = args.cmd.shared_opts() {
|
||||
if opts.profiles.contains(&Profile::Doc) {
|
||||
if let Some(opts) = args.cmd.shared_opts()
|
||||
&& opts.profiles.contains(&Profile::Doc)
|
||||
{
|
||||
builder.ensure(Rustdoc { compiler });
|
||||
}
|
||||
}
|
||||
|
||||
let sysroot = builder.ensure(Sysroot::new(compiler));
|
||||
let mut rustc = sysroot.clone();
|
||||
|
||||
@@ -241,12 +241,12 @@ impl Step for Link {
|
||||
if run.builder.config.dry_run() {
|
||||
return;
|
||||
}
|
||||
if let [cmd] = &run.paths[..] {
|
||||
if cmd.assert_single_path().path.as_path().as_os_str() == "link" {
|
||||
if let [cmd] = &run.paths[..]
|
||||
&& cmd.assert_single_path().path.as_path().as_os_str() == "link"
|
||||
{
|
||||
run.builder.ensure(Link);
|
||||
}
|
||||
}
|
||||
}
|
||||
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
||||
let config = &builder.config;
|
||||
|
||||
@@ -457,12 +457,12 @@ impl Step for Hook {
|
||||
}
|
||||
|
||||
fn make_run(run: RunConfig<'_>) {
|
||||
if let [cmd] = &run.paths[..] {
|
||||
if cmd.assert_single_path().path.as_path().as_os_str() == "hook" {
|
||||
if let [cmd] = &run.paths[..]
|
||||
&& cmd.assert_single_path().path.as_path().as_os_str() == "hook"
|
||||
{
|
||||
run.builder.ensure(Hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
||||
let config = &builder.config;
|
||||
@@ -672,12 +672,12 @@ impl Step for Editor {
|
||||
if run.builder.config.dry_run() {
|
||||
return;
|
||||
}
|
||||
if let [cmd] = &run.paths[..] {
|
||||
if cmd.assert_single_path().path.as_path().as_os_str() == "editor" {
|
||||
if let [cmd] = &run.paths[..]
|
||||
&& cmd.assert_single_path().path.as_path().as_os_str() == "editor"
|
||||
{
|
||||
run.builder.ensure(Editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
||||
let config = &builder.config;
|
||||
|
||||
@@ -2417,11 +2417,11 @@ impl Step for ErrorIndex {
|
||||
}
|
||||
|
||||
fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> bool {
|
||||
if let Ok(contents) = fs::read_to_string(markdown) {
|
||||
if !contents.contains("```") {
|
||||
if let Ok(contents) = fs::read_to_string(markdown)
|
||||
&& !contents.contains("```")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
builder.verbose(|| println!("doc tests for: {}", markdown.display()));
|
||||
let mut cmd = builder.rustdoc_cmd(compiler);
|
||||
|
||||
@@ -988,8 +988,9 @@ impl Builder<'_> {
|
||||
// requirement, but the `-L` library path is not propagated across
|
||||
// separate Cargo projects. We can add LLVM's library path to the
|
||||
// rustc args as a workaround.
|
||||
if mode == Mode::ToolRustc || mode == Mode::Codegen {
|
||||
if let Some(llvm_config) = self.llvm_config(target) {
|
||||
if (mode == Mode::ToolRustc || mode == Mode::Codegen)
|
||||
&& let Some(llvm_config) = self.llvm_config(target)
|
||||
{
|
||||
let llvm_libdir =
|
||||
command(llvm_config).arg("--libdir").run_capture_stdout(self).stdout();
|
||||
if target.is_msvc() {
|
||||
@@ -998,7 +999,6 @@ impl Builder<'_> {
|
||||
rustflags.arg(&format!("-Clink-arg=-L{llvm_libdir}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Compile everything except libraries and proc macros with the more
|
||||
// efficient initial-exec TLS model. This doesn't work with `dlopen`,
|
||||
@@ -1226,14 +1226,13 @@ impl Builder<'_> {
|
||||
_ => None,
|
||||
};
|
||||
|
||||
if let Some(limit) = limit {
|
||||
if stage == 0
|
||||
|| self.config.default_codegen_backend(target).unwrap_or_default() == "llvm"
|
||||
if let Some(limit) = limit
|
||||
&& (stage == 0
|
||||
|| self.config.default_codegen_backend(target).unwrap_or_default() == "llvm")
|
||||
{
|
||||
rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={limit}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if matches!(mode, Mode::Std) {
|
||||
if let Some(mir_opt_level) = self.config.rust_validate_mir_opts {
|
||||
|
||||
@@ -1700,8 +1700,9 @@ impl Config {
|
||||
};
|
||||
// We want to be able to set string values without quotes,
|
||||
// like in `configure.py`. Try adding quotes around the right hand side
|
||||
if let Some((key, value)) = option.split_once('=') {
|
||||
if !value.contains('"') {
|
||||
if let Some((key, value)) = option.split_once('=')
|
||||
&& !value.contains('"')
|
||||
{
|
||||
match get_table(&format!(r#"{key}="{value}""#)) {
|
||||
Ok(v) => {
|
||||
override_toml.merge(
|
||||
@@ -1715,7 +1716,6 @@ impl Config {
|
||||
Err(e) => err = e,
|
||||
}
|
||||
}
|
||||
}
|
||||
eprintln!("failed to parse override `{option}`: `{err}");
|
||||
exit!(2)
|
||||
}
|
||||
@@ -2057,17 +2057,16 @@ impl Config {
|
||||
|| (matches!(debug_toml, Some(true))
|
||||
&& !matches!(rustc_debug_assertions_toml, Some(false)));
|
||||
|
||||
if debug_assertions_requested {
|
||||
if let Some(ref opt) = download_rustc {
|
||||
if opt.is_string_or_true() {
|
||||
if debug_assertions_requested
|
||||
&& let Some(ref opt) = download_rustc
|
||||
&& opt.is_string_or_true()
|
||||
{
|
||||
eprintln!(
|
||||
"WARN: currently no CI rustc builds have rustc debug assertions \
|
||||
enabled. Please either set `rust.debug-assertions` to `false` if you \
|
||||
want to use download CI rustc or set `rust.download-rustc` to `false`."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config.download_rustc_commit = config.download_ci_rustc_commit(
|
||||
download_rustc,
|
||||
@@ -2177,20 +2176,18 @@ impl Config {
|
||||
// We need to override `rust.channel` if it's manually specified when using the CI rustc.
|
||||
// This is because if the compiler uses a different channel than the one specified in bootstrap.toml,
|
||||
// tests may fail due to using a different channel than the one used by the compiler during tests.
|
||||
if let Some(commit) = &config.download_rustc_commit {
|
||||
if is_user_configured_rust_channel {
|
||||
if let Some(commit) = &config.download_rustc_commit
|
||||
&& is_user_configured_rust_channel
|
||||
{
|
||||
println!(
|
||||
"WARNING: `rust.download-rustc` is enabled. The `rust.channel` option will be overridden by the CI rustc's channel."
|
||||
);
|
||||
|
||||
let channel = config
|
||||
.read_file_by_commit(Path::new("src/ci/channel"), commit)
|
||||
.trim()
|
||||
.to_owned();
|
||||
let channel =
|
||||
config.read_file_by_commit(Path::new("src/ci/channel"), commit).trim().to_owned();
|
||||
|
||||
config.channel = channel;
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(llvm) = toml.llvm {
|
||||
let Llvm {
|
||||
@@ -2699,12 +2696,12 @@ impl Config {
|
||||
let bindir = &self.bindir;
|
||||
if bindir.is_absolute() {
|
||||
// Try to make it relative to the prefix.
|
||||
if let Some(prefix) = &self.prefix {
|
||||
if let Ok(stripped) = bindir.strip_prefix(prefix) {
|
||||
if let Some(prefix) = &self.prefix
|
||||
&& let Ok(stripped) = bindir.strip_prefix(prefix)
|
||||
{
|
||||
return stripped;
|
||||
}
|
||||
}
|
||||
}
|
||||
bindir
|
||||
}
|
||||
|
||||
@@ -3480,8 +3477,9 @@ fn check_incompatible_options_for_ci_rustc(
|
||||
// We always build the in-tree compiler on cross targets, so we only care
|
||||
// about the host target here.
|
||||
let host_str = host.to_string();
|
||||
if let Some(current_cfg) = current_config_toml.target.as_ref().and_then(|c| c.get(&host_str)) {
|
||||
if current_cfg.profiler.is_some() {
|
||||
if let Some(current_cfg) = current_config_toml.target.as_ref().and_then(|c| c.get(&host_str))
|
||||
&& current_cfg.profiler.is_some()
|
||||
{
|
||||
let ci_target_toml = ci_config_toml.target.as_ref().and_then(|c| c.get(&host_str));
|
||||
let ci_cfg = ci_target_toml.ok_or(format!(
|
||||
"Target specific config for '{host_str}' is not present for CI-rustc"
|
||||
@@ -3493,7 +3491,6 @@ fn check_incompatible_options_for_ci_rustc(
|
||||
let optimized_compiler_builtins = &ci_cfg.optimized_compiler_builtins;
|
||||
err!(current_cfg.optimized_compiler_builtins, optimized_compiler_builtins, "build");
|
||||
}
|
||||
}
|
||||
|
||||
let (Some(current_rust_config), Some(ci_rust_config)) =
|
||||
(current_config_toml.rust, ci_config_toml.rust)
|
||||
|
||||
@@ -709,11 +709,11 @@ download-rustc = false
|
||||
";
|
||||
}
|
||||
self.download_file(&format!("{base_url}/{url}"), &tarball, help_on_error);
|
||||
if let Some(sha256) = checksum {
|
||||
if !self.verify(&tarball, sha256) {
|
||||
if let Some(sha256) = checksum
|
||||
&& !self.verify(&tarball, sha256)
|
||||
{
|
||||
panic!("failed to verify {}", tarball.display());
|
||||
}
|
||||
}
|
||||
|
||||
self.unpack(&tarball, &bin_root, prefix);
|
||||
}
|
||||
|
||||
@@ -1451,8 +1451,9 @@ Executed at: {executed_at}"#,
|
||||
// Look for Wasmtime, and for its default options be sure to disable
|
||||
// its caching system since we're executing quite a lot of tests and
|
||||
// ideally shouldn't pollute the cache too much.
|
||||
if let Some(path) = finder.maybe_have("wasmtime") {
|
||||
if let Ok(mut path) = path.into_os_string().into_string() {
|
||||
if let Some(path) = finder.maybe_have("wasmtime")
|
||||
&& let Ok(mut path) = path.into_os_string().into_string()
|
||||
{
|
||||
path.push_str(" run -C cache=n --dir .");
|
||||
// Make sure that tests have access to RUSTC_BOOTSTRAP. This (for example) is
|
||||
// required for libtest to work on beta/stable channels.
|
||||
@@ -1468,7 +1469,6 @@ Executed at: {executed_at}"#,
|
||||
|
||||
return Some(path);
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
@@ -1637,13 +1637,13 @@ Executed at: {executed_at}"#,
|
||||
/// sha, version, etc.
|
||||
fn rust_version(&self) -> String {
|
||||
let mut version = self.rust_info().version(self, &self.version);
|
||||
if let Some(ref s) = self.config.description {
|
||||
if !s.is_empty() {
|
||||
if let Some(ref s) = self.config.description
|
||||
&& !s.is_empty()
|
||||
{
|
||||
version.push_str(" (");
|
||||
version.push_str(s);
|
||||
version.push(')');
|
||||
}
|
||||
}
|
||||
version
|
||||
}
|
||||
|
||||
@@ -1760,8 +1760,9 @@ Executed at: {executed_at}"#,
|
||||
pub fn copy_link(&self, src: &Path, dst: &Path, file_type: FileType) {
|
||||
self.copy_link_internal(src, dst, false);
|
||||
|
||||
if file_type.could_have_split_debuginfo() {
|
||||
if let Some(dbg_file) = split_debuginfo(src) {
|
||||
if file_type.could_have_split_debuginfo()
|
||||
&& let Some(dbg_file) = split_debuginfo(src)
|
||||
{
|
||||
self.copy_link_internal(
|
||||
&dbg_file,
|
||||
&dst.with_extension(dbg_file.extension().unwrap()),
|
||||
@@ -1769,7 +1770,6 @@ Executed at: {executed_at}"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_link_internal(&self, src: &Path, dst: &Path, dereference_symlinks: bool) {
|
||||
if self.config.dry_run() {
|
||||
@@ -1779,14 +1779,15 @@ Executed at: {executed_at}"#,
|
||||
if src == dst {
|
||||
return;
|
||||
}
|
||||
if let Err(e) = fs::remove_file(dst) {
|
||||
if cfg!(windows) && e.kind() != io::ErrorKind::NotFound {
|
||||
if let Err(e) = fs::remove_file(dst)
|
||||
&& cfg!(windows)
|
||||
&& e.kind() != io::ErrorKind::NotFound
|
||||
{
|
||||
// workaround for https://github.com/rust-lang/rust/issues/127126
|
||||
// if removing the file fails, attempt to rename it instead.
|
||||
let now = t!(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH));
|
||||
let _ = fs::rename(dst, format!("{}-{}", dst.display(), now.as_nanos()));
|
||||
}
|
||||
}
|
||||
let metadata = t!(src.symlink_metadata(), format!("src = {}", src.display()));
|
||||
let mut src = src.to_path_buf();
|
||||
if metadata.file_type().is_symlink() {
|
||||
@@ -1894,12 +1895,12 @@ Executed at: {executed_at}"#,
|
||||
chmod(&dst, file_type.perms());
|
||||
|
||||
// If this file can have debuginfo, look for split debuginfo and install it too.
|
||||
if file_type.could_have_split_debuginfo() {
|
||||
if let Some(dbg_file) = split_debuginfo(src) {
|
||||
if file_type.could_have_split_debuginfo()
|
||||
&& let Some(dbg_file) = split_debuginfo(src)
|
||||
{
|
||||
self.install(&dbg_file, dstdir, FileType::Regular);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn read(&self, path: &Path) -> String {
|
||||
if self.config.dry_run() {
|
||||
|
||||
@@ -46,11 +46,11 @@ pub fn find_recent_config_change_ids(current_id: usize) -> &'static [ChangeInfo]
|
||||
// an empty list (it may be due to switching from a recent branch to an
|
||||
// older one); otherwise, return the full list (assuming the user provided
|
||||
// the incorrect change-id by accident).
|
||||
if let Some(config) = CONFIG_CHANGE_HISTORY.iter().max_by_key(|config| config.change_id) {
|
||||
if current_id > config.change_id {
|
||||
if let Some(config) = CONFIG_CHANGE_HISTORY.iter().max_by_key(|config| config.change_id)
|
||||
&& current_id > config.change_id
|
||||
{
|
||||
return &[];
|
||||
}
|
||||
}
|
||||
|
||||
CONFIG_CHANGE_HISTORY
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user