mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #2788 from pre-commit/rustup-home-temporary
set RUSTUP_HOME when using a non-system rust
This commit is contained in:
commit
7f386a752e
1 changed files with 6 additions and 1 deletions
|
|
@ -142,10 +142,15 @@ def install_environment(
|
||||||
else:
|
else:
|
||||||
packages_to_install.add((package,))
|
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':
|
if version != 'system':
|
||||||
install_rust_with_toolchain(_rust_toolchain(version))
|
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:
|
if len(lib_deps) > 0:
|
||||||
_add_dependencies(prefix, lib_deps)
|
_add_dependencies(prefix, lib_deps)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue