c4fb0432ae
GitOrigin-RevId: 3fc1143a04da49a92c3663813c6a0c1e8ccd477f
15 lines
522 B
Nix
15 lines
522 B
Nix
# this wraps import to override readFile and readDir to trace the files it touches
|
|
# technique inspired by lorri
|
|
let
|
|
|
|
global = {
|
|
import = global.scopedImport {};
|
|
scopedImport = x: builtins.scopedImport (global // x);
|
|
builtins = builtins // {
|
|
inherit (global) import scopedImport;
|
|
readFile = path: builtins.trace "depot-scan '${toString path}'" (builtins.readFile path);
|
|
readDir = path: builtins.trace "depot-scan '${toString path}'" (builtins.readDir path);
|
|
};
|
|
};
|
|
|
|
in global.import
|