Skip to content

Commit

Permalink
Unrolled build for rust-lang#126348
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#126348 - Kobzol:venv-debug-error, r=albertlarsan68

Improve error message if dependency installation in tidy fails

Should help with easier debugging of issues occuring during [venv installation](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/PR.20CI.20broken) of `tidy` dependencies.
  • Loading branch information
rust-timer authored Jun 13, 2024
2 parents 921645c + 9bba39c commit b307531
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/tools/tidy/src/ext_tool_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,18 @@ fn create_venv_at_path(path: &Path) -> Result<(), Error> {
if out.status.success() {
return Ok(());
}
let err = if String::from_utf8_lossy(&out.stderr).contains("No module named virtualenv") {

let stderr = String::from_utf8_lossy(&out.stderr);
let err = if stderr.contains("No module named virtualenv") {
Error::Generic(format!(
"virtualenv not found: you may need to install it \
(`python3 -m pip install venv`)"
))
} else {
Error::Generic(format!("failed to create venv at '{}' using {sys_py}", path.display()))
Error::Generic(format!(
"failed to create venv at '{}' using {sys_py}: {stderr}",
path.display()
))
};
Err(err)
}
Expand Down

0 comments on commit b307531

Please sign in to comment.