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 Oct 20, 2023
1 parent ca012a0 commit 4285520
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 = rust.toRustTargetSpec stdenv.hostPlatform;
cargoLinkerVar = lib.toUpper (
builtins.replaceStrings ["-"] ["_"] (
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 4285520

Please sign in to comment.