summaryrefslogtreecommitdiffstats
path: root/pre_commit/languages
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-03 07:26:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-03 07:26:58 +0000
commitb932a221ec290af1bb9702ef5c235fddea47a17e (patch)
tree98f331d938b8490f5a01185e115624b22ea07d4e /pre_commit/languages
parentAdding upstream version 3.2.0. (diff)
downloadpre-commit-b932a221ec290af1bb9702ef5c235fddea47a17e.tar.xz
pre-commit-b932a221ec290af1bb9702ef5c235fddea47a17e.zip
Adding upstream version 3.2.1.upstream/3.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/languages')
-rw-r--r--pre_commit/languages/rust.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pre_commit/languages/rust.py b/pre_commit/languages/rust.py
index a1f4dbe..7eec0e7 100644
--- a/pre_commit/languages/rust.py
+++ b/pre_commit/languages/rust.py
@@ -80,9 +80,9 @@ def _add_dependencies(
lang_base.setup_cmd(prefix, ('cargo', 'add', *crates))
-def install_rust_with_toolchain(toolchain: str) -> None:
+def install_rust_with_toolchain(toolchain: str, envdir: str) -> None:
with tempfile.TemporaryDirectory() as rustup_dir:
- with envcontext((('RUSTUP_HOME', rustup_dir),)):
+ with envcontext((('CARGO_HOME', envdir), ('RUSTUP_HOME', rustup_dir))):
# acquire `rustup` if not present
if parse_shebang.find_executable('rustup') is None:
# We did not detect rustup and need to download it first.
@@ -145,7 +145,7 @@ def install_environment(
ctx.enter_context(in_env(prefix, version))
if version != 'system':
- install_rust_with_toolchain(_rust_toolchain(version))
+ install_rust_with_toolchain(_rust_toolchain(version), envdir)
tmpdir = ctx.enter_context(tempfile.TemporaryDirectory())
ctx.enter_context(envcontext((('RUSTUP_HOME', tmpdir),)))