Unverified Commit a48f11c5 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

python3Packages.setuptools-rust: fix python version inconsistency (#473299)

parents fb7bf470 95668624
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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 {
+7 −14
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
  setuptools-rust,
  setuptools-scm,
  replaceVars,
  python,
  targetPackages,
}:
buildPythonPackage rec {
@@ -44,16 +45,8 @@ 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
      null
    else
      replaceVars ./setuptools-rust-hook.sh {
        pyLibDir = "${targetPackages.python3}/lib/${targetPackages.python3.libPrefix}";
  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";