about summary refs log tree commit diff
path: root/src/libexpr/get-drvs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r--src/libexpr/get-drvs.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc
index acdc0c7b585a..3c7061fcd33a 100644
--- a/src/libexpr/get-drvs.cc
+++ b/src/libexpr/get-drvs.cc
@@ -10,6 +10,13 @@ string DrvInfo::queryDrvPath(EvalState & state) const
 {
     if (drvPath == "") {
         Expr a = attrs->get(toATerm("drvPath"));
+
+        /* Backwards compatibility hack with user environments made by
+           Nix <= 0.10: these contain illegal Path("") expressions. */
+        ATerm t;
+        if (a && matchPath(evalExpr(state, a), t))
+            return aterm2String(t);
+        
         PathSet context;
         (string &) drvPath = a ? coerceToPath(state, a, context) : "";
     }