(target_dir: str, version: str)
| 49 | |
| 50 | |
| 51 | def get_env_patch(target_dir: str, version: str) -> PatchesT: |
| 52 | return ( |
| 53 | ('PATH', (os.path.join(target_dir, 'bin'), os.pathsep, Var('PATH'))), |
| 54 | # Only set RUSTUP_TOOLCHAIN if we don't want use the system's default |
| 55 | # toolchain |
| 56 | *( |
| 57 | (('RUSTUP_TOOLCHAIN', _rust_toolchain(version)),) |
| 58 | if version != 'system' else () |
| 59 | ), |
| 60 | ) |
| 61 | |
| 62 | |
| 63 | @contextlib.contextmanager |
no test coverage detected