mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-03-12 21:23:02 -07:00
Go through rustup proxy if possible
This commit is contained in:
6
build.py
6
build.py
@@ -239,8 +239,12 @@ def build_cpp_src(targets: set[str]):
|
||||
def run_cargo(cmds: list[str]):
|
||||
ensure_paths()
|
||||
env = os.environ.copy()
|
||||
env["PATH"] = f"{rust_sysroot / "bin"}{os.pathsep}{env["PATH"]}"
|
||||
env["CARGO_BUILD_RUSTFLAGS"] = f"-Z threads={min(8, cpu_count)}"
|
||||
if shutil.which("rustup"):
|
||||
# Go through rustup proxies by default if available
|
||||
env["RUSTUP_TOOLCHAIN"] = str(rust_sysroot)
|
||||
else:
|
||||
env["PATH"] = f"{rust_sysroot / "bin"}{os.pathsep}{env["PATH"]}"
|
||||
# Cargo calls executables in $RUSTROOT/lib/rustlib/$TRIPLE/bin, we need
|
||||
# to make sure the runtime linker also search $RUSTROOT/lib for libraries.
|
||||
# This is only required on Unix, as Windows search dlls from PATH.
|
||||
|
||||
Reference in New Issue
Block a user