Skip to content

Commit d7868df

Browse files
authored
Merge pull request #435 from matsjoyce-refeyn/resolve-base-executable-path
Canonicalize base executable path when finding interpreter
2 parents f091939 + 35ee55f commit d7868df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setuptools_rust/build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,10 @@ def _replace_vendor_with_unknown(target: str) -> Optional[str]:
610610
def _prepare_build_environment() -> Dict[str, str]:
611611
"""Prepares environment variables to use when executing cargo build."""
612612

613-
executable = getattr(sys, "_base_executable", sys.executable)
614-
if not os.path.exists(executable):
613+
base_executable = getattr(sys, "_base_executable")
614+
if base_executable and os.path.exists(base_executable):
615+
executable = os.path.realpath(base_executable)
616+
else:
615617
executable = sys.executable
616618

617619
# Make sure that if pythonXX-sys is used, it builds against the current

0 commit comments

Comments
 (0)