From 3bb76ec76292313f3d75510c0d673fafdca5579d Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 13 Nov 2026 10:45:26 +0100 Subject: [PATCH 1/2] chore(test): reorganize imports --- src/test/clitools.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/clitools.rs b/src/test/clitools.rs index 9dfc6d7799..82cba1729f 100644 --- a/src/test/clitools.rs +++ b/src/test/clitools.rs @@ -32,8 +32,8 @@ use super::{ }; use crate::{ cli::rustup_mode, - process, test as rustup_test, - test::{const_dist_dir, tempdir_in_with_prefix, this_host_tuple}, + process, + test::{self as rustup_test, const_dist_dir, tempdir_in_with_prefix, this_host_tuple}, utils, }; #[cfg(windows)] From 1fceb1d69e3f3f167f4c0182476b639ac7ae19e7 Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 13 Nov 2026 10:45:26 +0100 Subject: [PATCH 2/2] fix(test): fix `rustup-init` binary detection in fixture --- src/test/clitools.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/clitools.rs b/src/test/clitools.rs index 82cba1729f..66aec434bc 100644 --- a/src/test/clitools.rs +++ b/src/test/clitools.rs @@ -818,11 +818,6 @@ async fn setup_test_state(test_dist_dir: TempDir) -> (TempDir, Config) { } } - let current_exe_path = env::current_exe().unwrap(); - let mut built_exe_dir = current_exe_path.parent().unwrap(); - if built_exe_dir.ends_with("deps") { - built_exe_dir = built_exe_dir.parent().unwrap(); - } let test_dir = rustup_test::test_dir().unwrap(); let exedir = tempdir_in_with_prefix(&test_dir, "rustup-exe").unwrap(); @@ -852,7 +847,10 @@ async fn setup_test_state(test_dist_dir: TempDir) -> (TempDir, Config) { test_registry_id: test_id(), }; - let build_path = built_exe_dir.join(format!("rustup-init{EXE_SUFFIX}")); + let build_path = PathBuf::from( + env::var_os("CARGO_BIN_EXE_rustup-init") + .expect("environment variable `CARGO_BIN_EXE_rustup-init` is not set"), + ); let rustup_path = config.exedir.join(format!("rustup{EXE_SUFFIX}")); // Used to create dist servers. Perhaps should only link when needed?