Skip to content

Commit

Permalink
Better error reporting to better understand #30
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Apr 24, 2023
1 parent 50eefff commit 9417899
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rye/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,23 @@ pub fn ensure_self_venv(output: CommandOutput) -> Result<PathBuf, Error> {
eprintln!("Bootstrapping rye internals");
}

let version = fetch(&SELF_PYTHON_VERSION, output)?;
let version = fetch(&SELF_PYTHON_VERSION, output).with_context(|| {
format!(
"failed to fetch internal cpython toolchain {}",
SELF_PYTHON_VERSION
)
})?;
let py_bin = get_py_bin(&version)?;

// initialize the virtualenv
let mut venv_cmd = Command::new(py_bin);
let mut venv_cmd = Command::new(&py_bin);
venv_cmd.arg("-mvenv");
venv_cmd.arg("--upgrade-deps");
venv_cmd.arg(&dir);

let status = venv_cmd.status().context("unable to create self venv")?;
let status = venv_cmd
.status()
.with_context(|| format!("unable to create self venv using {}", py_bin.display()))?;
if !status.success() {
bail!("failed to initialize virtualenv in {}", dir.display());
}
Expand Down

0 comments on commit 9417899

Please sign in to comment.