From e5ec487840c458146440511e8d23f13de9bcadca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 1 Apr 2021 22:29:39 +0200 Subject: [PATCH] fetchurl: check that `url` is a string Otherwise we (may) get a hard to debug issue in the tarball job, e.g. see the grandparent commit. --- pkgs/build-support/fetchurl/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index c65738aef41a..8ce69a7f1878 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -104,7 +104,9 @@ let if urls != [] && url == "" then (if lib.isList urls then urls else throw "`urls` is not a list") - else if urls == [] && url != "" then [url] + else if urls == [] && url != "" then + (if lib.isString url then [url] + else throw "`url` is not a string") else throw "fetchurl requires either `url` or `urls` to be set"; hash_ =