Skip to content

Commit

Permalink
setuptools-rust-hook: Use correct python for cross
Browse files Browse the repository at this point in the history
  • Loading branch information
kjeremy committed Dec 18, 2023
1 parent ec58a9e commit bf46f5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkgs/development/interpreters/python/hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ in {
name = "setuptools-rust-setup-hook";
propagatedBuildInputs = [ setuptools-rust ];
substitutions = {
pyIncludeDir = "${python}/include/${python.libPrefix}";
pyLibDir = "${python}/lib/${python.libPrefix}";
pyBin = python.interpreter;
cargoBuildTarget = stdenv.hostPlatform.rust.rustcTargetSpec;
cargoLinkerVar = stdenv.hostPlatform.rust.cargoEnvVarTarget;
targetLinker = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ setuptoolsRustSetup() {
exit 1
fi

export PYO3_CROSS_LIB_DIR="@pyLibDir@"
export PYO3_CROSS_INCLUDE_DIR="@pyIncludeDir@";
export PYO3_CROSS_LIB_DIR="@pyLibDir@";
export PYO3_PYTHON="@pyBin@";
export CARGO_BUILD_TARGET=@cargoBuildTarget@
# TODO theoretically setting linker should not be required because it is
# already set in pkgs/build-support/rust/hooks/default.nix but build fails
Expand Down

0 comments on commit bf46f5e

Please sign in to comment.