From 3feeedb5e2dd1a21bbbf72bdbca58c86b229f882 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 22 Jan 2023 11:07:12 +1000 Subject: [PATCH] buildGoModule: make the vendor fetcher error if it is empty --- pkgs/build-support/go/module.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 448143f76908..284cc1586dad 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -145,6 +145,11 @@ let cp -r --reflink=auto vendor $out ''} + if ! [ "$(ls -A $out)" ]; then + echo "vendor folder is empty, please set 'vendorHash = null;' or 'vendorSha256 = null;' in your expression" + exit 10 + fi + runHook postInstall '';