You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/fileset/README.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,13 +41,21 @@ An attribute set with these values:
41
41
-`_type` (constant string `"fileset"`):
42
42
Tag to indicate this value is a file set.
43
43
44
-
-`_internalVersion` (constant string equal to the current version):
45
-
Version of the representation
44
+
-`_internalVersion` (constant `2`, the current version):
45
+
Version of the representation.
46
46
47
47
-`_internalBase` (path):
48
48
Any files outside of this path cannot influence the set of files.
49
49
This is always a directory.
50
50
51
+
-`_internalBaseRoot` (path):
52
+
The filesystem root of `_internalBase`, same as `(lib.path.splitRoot _internalBase).root`.
53
+
This is here because this needs to be computed anyway, and this computation shouldn't be duplicated.
54
+
55
+
-`_internalBaseComponents` (list of strings):
56
+
The path components of `_internalBase`, same as `lib.path.subpath.components (lib.path.splitRoot _internalBase).subpath`.
57
+
This is here because this needs to be computed anyway, and this computation shouldn't be duplicated.
58
+
51
59
-`_internalTree` ([filesetTree](#filesettree)):
52
60
A tree representation of all included files under `_internalBase`.
53
61
@@ -59,8 +67,8 @@ An attribute set with these values:
59
67
One of the following:
60
68
61
69
-`{ <name> = filesetTree; }`:
62
-
A directory with a nested `filesetTree` value for every directory entry.
63
-
Even entries that aren't included are present as `null` because it improves laziness and allows using this as a sort of `builtins.readDir` cache.
70
+
A directory with a nested `filesetTree` value for directory entries.
71
+
Entries not included may either be omitted or set to `null`, as necessary to improve efficiency or laziness.
64
72
65
73
-`"directory"`:
66
74
A directory with all its files included recursively, allowing early cutoff for some operations.
@@ -169,15 +177,9 @@ Arguments:
169
177
## To update in the future
170
178
171
179
Here's a list of places in the library that need to be updated in the future:
172
-
-> The file set library is currently very limited but is being expanded to include more functions over time.
180
+
-> The file set library is currently somewhat limited but is being expanded to include more functions over time.
173
181
174
182
in [the manual](../../doc/functions/fileset.section.md)
175
-
-> Currently the only way to construct file sets is using implicit coercion from paths.
176
-
177
-
in [the `toSource` reference](./default.nix)
178
-
-> For now filesets are always paths
179
-
180
-
in [the `toSource` implementation](./default.nix), also update the variable name there
181
183
- Once a tracing function exists, `__noEval` in [internal.nix](./internal.nix) should mention it
182
184
- If/Once a function to convert `lib.sources` values into file sets exists, the `_coerce` and `toSource` functions should be updated to mention that function in the error when such a value is passed
183
185
- If/Once a function exists that can optionally include a path depending on whether it exists, the error message for the path not existing in `_coerce` should mention the new function
echo -e "Mean CPU time $newMean (σ = $newSd) for $runs runs is \e[0;33m$percentageMean% (σ = $percentageSd%)\e[0m of the old value $oldMean (σ = $oldSd)">&2
100
+
101
+
different=0
102
+
forstatin"${stats[@]}";do
103
+
oldValue=$(jq "$stat""$tmp/old.json")
104
+
newValue=$(jq "$stat""$tmp/new.json")
105
+
if(( oldValue != newValue ));then
106
+
percent=$(bc <<<"scale=100; result = 100/$oldValue*$newValue; scale=4; result / 1")
107
+
if(( oldValue < newValue ));then
108
+
echo -e "Statistic $stat ($newValue) is \e[0;31m$percent% (+$(( newValue - oldValue )))\e[0m of the old value $oldValue">&2
109
+
else
110
+
echo -e "Statistic $stat ($newValue) is \e[0;32m$percent% (-$(( oldValue - newValue )))\e[0m of the old value $oldValue">&2
111
+
fi
112
+
(( different++))||true
113
+
fi
114
+
done
115
+
echo"$different stats differ between the current tree and $compareTo"
0 commit comments