Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkgs/development/interpreters/python/passthrufun.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ rec {
pythonAtLeast = lib.versionAtLeast pythonVersion;
pythonOlder = lib.versionOlder pythonVersion;
inherit hasDistutilsCxxPatch;
inherit pythonOnBuildForHost;
inherit
pythonOnBuildForBuild
pythonOnBuildForHost
pythonOnBuildForTarget
pythonOnHostForHost
pythonOnTargetForTarget
;
inherit pythonABITags;

tests = callPackage ./tests.nix {
Expand Down
21 changes: 7 additions & 14 deletions pkgs/development/python-modules/setuptools-rust/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
setuptools-rust,
setuptools-scm,
replaceVars,
python,
targetPackages,
}:
buildPythonPackage rec {
Expand Down Expand Up @@ -44,20 +45,12 @@ buildPythonPackage rec {

# integrate the setup hook to set up the build environment for cross compilation
# this hook is automatically propagated to consumers using setuptools-rust as build-system
#
# Only include the setup hook if targetPackages.python3 is defined.
# targetPackages.python3 is not always available, for example when including
# setuptools-rust via buildInputs instead of nativeBuildInputs or building it directly.
setupHook =
if !(targetPackages ? python3) then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous workaround is still needed, I'll add it back

null
else
replaceVars ./setuptools-rust-hook.sh {
pyLibDir = "${targetPackages.python3}/lib/${targetPackages.python3.libPrefix}";
cargoBuildTarget = stdenv.targetPlatform.rust.rustcTargetSpec;
cargoLinkerVar = stdenv.targetPlatform.rust.cargoEnvVarTarget;
targetLinker = "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc";
};
setupHook = replaceVars ./setuptools-rust-hook.sh {
pyLibDir = "${python.pythonOnTargetForTarget}/lib/${python.pythonOnTargetForTarget.libPrefix}";
cargoBuildTarget = stdenv.targetPlatform.rust.rustcTargetSpec;
cargoLinkerVar = stdenv.targetPlatform.rust.cargoEnvVarTarget;
targetLinker = "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc";
};

passthru.tests = {
pyo3 = maturin.tests.pyo3.override {
Expand Down
Loading