summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-15 11:24:55 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-15 11:24:55 +0200
commit42d94b6f15987ecaae03c639300d38e0b5c4afd4 (patch)
tree5916b59f86fed7e2488b3c7cc78f1ab820401d75 /pkgs/stdenv/generic
parent41e1900ea1a6323918596a17434b2011b5915b40 (diff)
downloadnixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.tar
nixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.tar.gz
nixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.tar.bz2
nixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.tar.lz
nixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.tar.xz
nixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.tar.zst
nixlib-42d94b6f15987ecaae03c639300d38e0b5c4afd4.zip
Barf on non-existant build inputs
Previously saying

  buildInputs = [ "bla" ];

was quietly ignored. Now it's a fatal error.
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/setup.sh21
1 files changed, 13 insertions, 8 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index fb79d8832886..75cc86934806 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -222,7 +222,7 @@ runHook addInputsHook
 
 # Recursively find all build inputs.
 findInputs() {
-    local pkg=$1
+    local pkg="$1"
     local var=$2
     local propagatedBuildInputsFile=$3
 
@@ -234,17 +234,22 @@ findInputs() {
 
     eval $var="'${!var} $pkg '"
 
-    if [ -f $pkg ]; then
-        source $pkg
+    if ! [ -e "$pkg" ]; then
+        echo "build input $pkg does not exist" >&2
+        exit 1
+    fi
+
+    if [ -f "$pkg" ]; then
+        source "$pkg"
     fi
 
-    if [ -f $pkg/nix-support/setup-hook ]; then
-        source $pkg/nix-support/setup-hook
+    if [ -f "$pkg/nix-support/setup-hook" ]; then
+        source "$pkg/nix-support/setup-hook"
     fi
 
-    if [ -f $pkg/nix-support/$propagatedBuildInputsFile ]; then
-        for i in $(cat $pkg/nix-support/$propagatedBuildInputsFile); do
-            findInputs $i $var $propagatedBuildInputsFile
+    if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then
+        for i in $(cat "$pkg/nix-support/$propagatedBuildInputsFile"); do
+            findInputs "$i" $var $propagatedBuildInputsFile
         done
     fi
 }