mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Rollup merge of #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.
This commit is contained in:
commit
83e2975797
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user