Skip to content

Commit

Permalink
Merge pull request #435 from matsjoyce-refeyn/resolve-base-executable…
Browse files Browse the repository at this point in the history
…-path

Canonicalize base executable path when finding interpreter
  • Loading branch information
davidhewitt authored Jun 5, 2024
2 parents f091939 + 35ee55f commit d7868df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,10 @@ def _replace_vendor_with_unknown(target: str) -> Optional[str]:
def _prepare_build_environment() -> Dict[str, str]:
"""Prepares environment variables to use when executing cargo build."""

executable = getattr(sys, "_base_executable", sys.executable)
if not os.path.exists(executable):
base_executable = getattr(sys, "_base_executable")
if base_executable and os.path.exists(base_executable):
executable = os.path.realpath(base_executable)
else:
executable = sys.executable

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

0 comments on commit d7868df

Please sign in to comment.