summary refs log tree commit diff
path: root/lib/debug.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-06-26 01:23:25 +0200
committerProfpatsch <mail@profpatsch.de>2016-06-26 02:05:45 +0200
commit93bbe13f98c1759330a6a37728607f636734b930 (patch)
tree928d48edcada888c9f0070096ba76a15e179ae88 /lib/debug.nix
parent6889f53397edf4c2e94df67d72ef0b1e7b18d35a (diff)
downloadnixpkgs-93bbe13f98c1759330a6a37728607f636734b930.tar
nixpkgs-93bbe13f98c1759330a6a37728607f636734b930.tar.gz
nixpkgs-93bbe13f98c1759330a6a37728607f636734b930.tar.bz2
nixpkgs-93bbe13f98c1759330a6a37728607f636734b930.tar.lz
nixpkgs-93bbe13f98c1759330a6a37728607f636734b930.tar.xz
nixpkgs-93bbe13f98c1759330a6a37728607f636734b930.tar.zst
nixpkgs-93bbe13f98c1759330a6a37728607f636734b930.zip
debug.nix: deprecate strict
Replace the implementation by seq and add a deprecation warning.
The semantics seems a little bit off, but the function should only be
used for debugging.
Diffstat (limited to 'lib/debug.nix')
-rw-r--r--lib/debug.nix24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/debug.nix b/lib/debug.nix
index 38612d630b3..e2e895ab620 100644
--- a/lib/debug.nix
+++ b/lib/debug.nix
@@ -73,27 +73,9 @@ rec {
   # usage: { testX = allTrue [ true ]; }
   testAllTrue = expr : { inherit expr; expected = map (x: true) expr; };
 
-  # evaluate everything once so that errors will occur earlier
-  # hacky: traverse attrs by adding a dummy
-  # ignores functions (should this behavior change?) See strictf
-  #
-  # Note: This should be a primop! Something like seq of haskell would be nice to
-  # have as well. It's used fore debugging only anyway
-  strict = x :
-    let
-        traverse = x :
-          if isString x then true
-          else if isAttrs x then
-            if x ? outPath then true
-            else all id (mapAttrsFlatten (n: traverse) x)
-          else if isList x then
-            all id (map traverse x)
-          else if isBool x then true
-          else if isFunction x then true
-          else if isInt x then true
-          else if x == null then true
-          else true; # a (store) path?
-    in if traverse x then x else throw "else never reached";
+  strict = v:
+    trace "Warning: strict is deprecated and will be removed in the next release"
+      (builtins.seq v v);
 
   # example: (traceCallXml "myfun" id 3) will output something like
   # calling myfun arg 1: 3 result: 3