place .cargo/bin at end of path when packaging

Otherwise a system-installed older Rust will override the version we
have set with cargo-env, which can break the build.
This commit is contained in:
Damien Elmes 2021-12-04 16:43:56 +10:00
parent 933ee647bc
commit 6de2dc6cd4

View File

@ -23,11 +23,11 @@ pyo3_config = output_root / "pyo3-build-config-file.txt"
if is_win: if is_win:
python_bin_folder = venv / "scripts" python_bin_folder = venv / "scripts"
os.environ["PATH"] = os.getenv("USERPROFILE") + r"\.cargo\bin;" + os.getenv("PATH") os.environ["PATH"] += fr";{os.getenv('USERPROFILE')}\.cargo\bin"
cargo_features = "build-mode-prebuilt-artifacts" cargo_features = "build-mode-prebuilt-artifacts"
else: else:
python_bin_folder = venv / "bin" python_bin_folder = venv / "bin"
os.environ["PATH"] = os.getenv("HOME") + "/.cargo/bin:" + os.getenv("PATH") os.environ["PATH"] += f":{os.getenv('HOME')}/.cargo/bin"
cargo_features = ( cargo_features = (
"build-mode-prebuilt-artifacts global-allocator-jemalloc allocator-jemalloc" "build-mode-prebuilt-artifacts global-allocator-jemalloc allocator-jemalloc"
) )