about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 2a3f1e2c3221..ce0b9e8b0bd2 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -347,6 +347,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
        derivation. */
     foreach (PathSet::iterator, i, context) {
         Path path = *i;
+        bool explicitlyPassed = false;
         
         /* Paths marked with `=' denote that the path of a derivation
            is explicitly passed to the builder.  Since that allows the
@@ -361,8 +362,10 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
             foreach (PathSet::iterator, j, refs) {
                 drv.inputSrcs.insert(*j);
                 if (isDerivation(*j))
-                    drv.inputDrvs[*j] = singleton<StringSet>("out");
+                    drv.inputDrvs[*j] = store -> queryDerivationOutputNames(*j);
             }
+
+            explicitlyPassed = true;
         }
 
         /* See prim_unsafeDiscardOutputDependency. */
@@ -376,7 +379,10 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
 
         debug(format("derivation uses `%1%'") % path);
         if (!useDrvAsSrc && isDerivation(path))
-            drv.inputDrvs[path] = singleton<StringSet>("out");
+            if (explicitlyPassed)
+                drv.inputDrvs[path] = store -> queryDerivationOutputNames(path);
+            else
+                drv.inputDrvs[path] = singleton<StringSet>("out");
         else
             drv.inputSrcs.insert(path);
     }