From fc31945f1e81ae72a666945b1162f8bae84796e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 12 Dec 2024 18:30:47 +0100 Subject: [PATCH] lib/systems/parse.nix: mkSkeletonFromList: improve error message (#211213) Include the system string in the error message to give a bit more context to the user. Co-authored-by: Wolfgang Walther --- lib/systems/parse.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index a2ee288f2c1f8..fa3cc02647aed 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -441,7 +441,7 @@ rec { mkSkeletonFromList = l: { "1" = if elemAt l 0 == "avr" then { cpu = elemAt l 0; kernel = "none"; abi = "unknown"; } - else throw "Target specification with 1 components is ambiguous"; + else throw "system string '${lib.concatStringsSep "-" l}' with 1 component is ambiguous"; "2" = # We only do 2-part hacks for things Nix already supports if elemAt l 1 == "cygwin" then { cpu = elemAt l 0; kernel = "windows"; abi = "cygnus"; } @@ -479,10 +479,10 @@ rec { then "windows" # autotools breaks on -gnu for window else elemAt l 2; } - else throw "Target specification with 3 components is ambiguous"; + else throw "system string '${lib.concatStringsSep "-" l}' with 3 components is ambiguous"; "4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; }; }.${toString (length l)} - or (throw "system string has invalid number of hyphen-separated components"); + or (throw "system string '${lib.concatStringsSep "-" l}' has invalid number of hyphen-separated components"); # This should revert the job done by config.guess from the gcc compiler. mkSystemFromSkeleton = { cpu