diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-07-24 15:08:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-24 15:08:26 +0200 |
| commit | 352e02bce172fd59313f66339e60371bb7a13ed9 (patch) | |
| tree | 09396e706bdc0bafcd7f9e82f2d4feb2a61d3ac3 | |
| parent | 488fc49e05160ae19c0aa89daca6494f6f528388 (diff) | |
| parent | 2d1fccd7a1fb713d0d2cea6cb33ad245a6b1f383 (diff) | |
| download | rust-352e02bce172fd59313f66339e60371bb7a13ed9.tar.gz rust-352e02bce172fd59313f66339e60371bb7a13ed9.zip | |
Rollup merge of #144317 - lolbinarycat:tidy-obey-build.npm, r=Kobzol
pass build.npm from bootstrap to tidy and use it for npm install followup to rust-lang/rust#142924 r? ```@Kobzol```
| -rw-r--r-- | src/bootstrap/src/core/build_steps/test.rs | 6 | ||||
| -rw-r--r-- | src/tools/tidy/src/ext_tool_checks.rs | 5 | ||||
| -rw-r--r-- | src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs | 5 | ||||
| -rw-r--r-- | src/tools/tidy/src/main.rs | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index d346062761c..ebbb569e9db 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1113,6 +1113,12 @@ impl Step for Tidy { 8 * std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32 }); cmd.arg(jobs.to_string()); + // pass the path to the npm command used for installing js deps. + if let Some(npm) = &builder.config.npm { + cmd.arg(npm); + } else { + cmd.arg("npm"); + } if builder.is_verbose() { cmd.arg("--verbose"); } diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 911d4daae5c..8121eb057db 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -50,6 +50,7 @@ pub fn check( ci_info: &CiInfo, librustdoc_path: &Path, tools_path: &Path, + npm: &Path, bless: bool, extra_checks: Option<&str>, pos_args: &[String], @@ -61,6 +62,7 @@ pub fn check( ci_info, librustdoc_path, tools_path, + npm, bless, extra_checks, pos_args, @@ -75,6 +77,7 @@ fn check_impl( ci_info: &CiInfo, librustdoc_path: &Path, tools_path: &Path, + npm: &Path, bless: bool, extra_checks: Option<&str>, pos_args: &[String], @@ -293,7 +296,7 @@ fn check_impl( } if js_lint || js_typecheck { - rustdoc_js::npm_install(root_path, outdir)?; + rustdoc_js::npm_install(root_path, outdir, npm)?; } if js_lint { diff --git a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs index c1a62cedd33..7708b128e23 100644 --- a/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs +++ b/src/tools/tidy/src/ext_tool_checks/rustdoc_js.rs @@ -23,9 +23,8 @@ fn spawn_cmd(cmd: &mut Command) -> Result<Child, io::Error> { } /// install all js dependencies from package.json. -pub(super) fn npm_install(root_path: &Path, outdir: &Path) -> Result<(), super::Error> { - // FIXME(lolbinarycat): make this obey build.npm bootstrap option - npm::install(root_path, outdir, Path::new("npm"))?; +pub(super) fn npm_install(root_path: &Path, outdir: &Path, npm: &Path) -> Result<(), super::Error> { + npm::install(root_path, outdir, npm)?; Ok(()) } diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 13b20f33bd0..11ee2ae688d 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -29,6 +29,7 @@ fn main() { let concurrency: NonZeroUsize = FromStr::from_str(&env::args().nth(4).expect("need concurrency")) .expect("concurrency must be a number"); + let npm: PathBuf = env::args_os().nth(5).expect("need name/path of npm command").into(); let root_manifest = root_path.join("Cargo.toml"); let src_path = root_path.join("src"); @@ -182,6 +183,7 @@ fn main() { &ci_info, &librustdoc_path, &tools_path, + &npm, bless, extra_checks, pos_args |
