mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
set RUSTUP_HOME when using a non-system rust
This commit is contained in:
parent
294590fd12
commit
2700a7d622
1 changed files with 6 additions and 1 deletions
|
|
@ -142,10 +142,15 @@ def install_environment(
|
|||
else:
|
||||
packages_to_install.add((package,))
|
||||
|
||||
with in_env(prefix, version):
|
||||
with contextlib.ExitStack() as ctx:
|
||||
ctx.enter_context(in_env(prefix, version))
|
||||
|
||||
if version != 'system':
|
||||
install_rust_with_toolchain(_rust_toolchain(version))
|
||||
|
||||
tmpdir = ctx.enter_context(tempfile.TemporaryDirectory())
|
||||
ctx.enter_context(envcontext((('RUSTUP_HOME', tmpdir),)))
|
||||
|
||||
if len(lib_deps) > 0:
|
||||
_add_dependencies(prefix, lib_deps)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue