From 7244c2062155bb8d2fb9eb4a9e09dd3909a1332d Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Mon, 5 Apr 2021 06:52:06 -0400 Subject: [PATCH 1/4] google-compute-engine: fix incorrect usage of buildPythonApplication --- .../virtualization/google-compute-engine/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/virtualization/google-compute-engine/default.nix b/pkgs/tools/virtualization/google-compute-engine/default.nix index be62ace4797b..0606bef08d1c 100644 --- a/pkgs/tools/virtualization/google-compute-engine/default.nix +++ b/pkgs/tools/virtualization/google-compute-engine/default.nix @@ -1,6 +1,6 @@ { lib , fetchFromGitHub -, buildPythonApplication +, buildPythonPackage , bash , bashInteractive , systemd @@ -10,7 +10,7 @@ , distro }: -buildPythonApplication rec { +buildPythonPackage rec { pname = "google-compute-engine"; version = "20190124"; namePrefix = ""; @@ -25,7 +25,6 @@ buildPythonApplication rec { buildInputs = [ bash ]; propagatedBuildInputs = [ boto setuptools distro ]; - postPatch = '' for file in $(find google_compute_engine -type f); do substituteInPlace "$file" \ @@ -53,7 +52,11 @@ buildPythonApplication rec { patchShebangs $out/bin/* ''; - doCheck = false; + checkPhase = '' + # this package has its own test suite, but they assume the ability to + # access resources like /sys/class/net causing them to fail in the sandbox + python -c 'import google_compute_engine' + ''; meta = with lib; { description = "Google Compute Engine tools and services"; From a9d8afeba97a3c472916bb79fcd304339e648e48 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Mon, 5 Apr 2021 07:02:11 -0400 Subject: [PATCH 2/4] google-compute-engine: remove namePrefix setting --- pkgs/tools/virtualization/google-compute-engine/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/virtualization/google-compute-engine/default.nix b/pkgs/tools/virtualization/google-compute-engine/default.nix index 0606bef08d1c..1aa5674a0e8a 100644 --- a/pkgs/tools/virtualization/google-compute-engine/default.nix +++ b/pkgs/tools/virtualization/google-compute-engine/default.nix @@ -13,7 +13,6 @@ buildPythonPackage rec { pname = "google-compute-engine"; version = "20190124"; - namePrefix = ""; src = fetchFromGitHub { owner = "GoogleCloudPlatform"; From 3568e9526dc3f781ac0da7b0f3cbf1db1910d161 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 5 Apr 2021 11:39:54 -0400 Subject: [PATCH 3/4] google-compute-engine: use pythonImportsCheck Co-authored-by: Sandro --- pkgs/tools/virtualization/google-compute-engine/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/tools/virtualization/google-compute-engine/default.nix b/pkgs/tools/virtualization/google-compute-engine/default.nix index 1aa5674a0e8a..4ec8fc112e80 100644 --- a/pkgs/tools/virtualization/google-compute-engine/default.nix +++ b/pkgs/tools/virtualization/google-compute-engine/default.nix @@ -51,11 +51,7 @@ buildPythonPackage rec { patchShebangs $out/bin/* ''; - checkPhase = '' - # this package has its own test suite, but they assume the ability to - # access resources like /sys/class/net causing them to fail in the sandbox - python -c 'import google_compute_engine' - ''; + pythonImportsCheck = [ "import google_compute_engine" ]; meta = with lib; { description = "Google Compute Engine tools and services"; From 58dfe324776f9fca8896e0cc837f22a995b63c48 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Mon, 5 Apr 2021 11:42:20 -0400 Subject: [PATCH 4/4] google-compute-engine: fix imports check and set doCheck back to false --- pkgs/tools/virtualization/google-compute-engine/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/virtualization/google-compute-engine/default.nix b/pkgs/tools/virtualization/google-compute-engine/default.nix index 4ec8fc112e80..ad187544aea2 100644 --- a/pkgs/tools/virtualization/google-compute-engine/default.nix +++ b/pkgs/tools/virtualization/google-compute-engine/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { patchShebangs $out/bin/* ''; - pythonImportsCheck = [ "import google_compute_engine" ]; + doCheck = false; + pythonImportsCheck = [ "google_compute_engine" ]; meta = with lib; { description = "Google Compute Engine tools and services";