From fd613a859742173af8a524e9203e55a8a349bde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 10 Mar 2023 10:08:37 +0100 Subject: [PATCH 1/2] python3.pkgs.ray: fix evaluation when generating nix dependency graph Due to some oddities in the language `builtins.tryEval` fails to catch some instances in certain edge cases. While it would be nice to have them fixed in nix itself for now it seems way easier to just remove these two instances. This fixes evaluating nativeBuildInputs in https://github.com/tweag/nixpkgs-graph/ Retrieve this information from nixpkgs is quite complex but having it would enable a lot of interesting use cases. --- pkgs/development/python-modules/ray/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/ray/default.nix b/pkgs/development/python-modules/ray/default.nix index c6b764181875..99a62a64025d 100644 --- a/pkgs/development/python-modules/ray/default.nix +++ b/pkgs/development/python-modules/ray/default.nix @@ -68,7 +68,7 @@ buildPythonPackage rec { src = let pyShortVersion = "cp${builtins.replaceStrings ["."] [""] python.pythonVersion}"; - binary-hash = (import ./binary-hashes.nix)."${pyShortVersion}"; + binary-hash = (import ./binary-hashes.nix)."${pyShortVersion}" or {}; in fetchPypi ({ inherit pname version format; From b6d9b11bf0ca422eb699ed85a74936f0654eae25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 10 Mar 2023 10:08:40 +0100 Subject: [PATCH 2/2] python3.pkgs.tensorflow: fix evaluation when generating nix dependency graph --- pkgs/development/python-modules/tensorflow/bin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index dcfa8e0e964c..c9ed92712166 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -57,7 +57,7 @@ in buildPythonPackage { platform = if stdenv.isDarwin then "mac" else "linux"; unit = if cudaSupport then "gpu" else "cpu"; key = "${platform}_py_${pyVerNoDot}_${unit}"; - in fetchurl packages.${key}; + in fetchurl (packages.${key} or {}); propagatedBuildInputs = [ astunparse