From 4fdbdcede0af0ab70d94eecb5358225b1a04407f Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Mon, 9 Sep 2019 10:44:39 +0200 Subject: [PATCH] google-cloud-sdk: prefer using a pythonEnv vs just a search path Previously only direct dependencies were available in the python search path. Transitive dependencies would not be available and thus a few features would not work due to import errors. Those import errors were being caugth and gave a (wrong) hint why it wouldn't work. By using `python.withPackages` instead of the crafted search path with only the direct dependencies those missing feature should now be working. See issue #67094 for details on the observed errors. Fixes #67094 --- pkgs/tools/admin/google-cloud-sdk/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index 7c81e861ddb..5b701600dd1 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -13,7 +13,7 @@ let pythonInputs = [ cffi cryptography pyopenssl crcmod ] ++ lib.optional (with-gce) google-compute-engine; - pythonPath = lib.makeSearchPath python.sitePackages pythonInputs; + pythonEnv = python.withPackages (_: pythonInputs); baseUrl = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads"; sources = name: system: { @@ -53,8 +53,8 @@ in stdenv.mkDerivation rec { programPath="$out/google-cloud-sdk/bin/$program" binaryPath="$out/bin/$program" wrapProgram "$programPath" \ - --set CLOUDSDK_PYTHON "${python}/bin/python" \ - --prefix PYTHONPATH : "${pythonPath}" + --set CLOUDSDK_PYTHON "${pythonEnv}/bin/python" \ + --prefix PYTHONPATH : "${pythonEnv}/${python.sitePackages}" mkdir -p $out/bin ln -s $programPath $binaryPath