22 May 2025 |
emily | Sergei Zimmerman (xokdvium): whoops, sorry for forgetting about this. hm, a minimal reproducer seems way less slower than expected. let me try and see what i was observing | 05:44:49 |
emily | I can't reproduce. I guess -v -v is great :) | 05:46:34 |
emily | I wish it would trace other file accesses though | 05:46:45 |
emily | like builtins.readFile | 05:46:54 |
emily | does anyone understand why nix eval .?rev=X#foo will sometimes produce "copying …" messages even when the rev did not change? | 09:35:24 |
Mic92 | https://discourse.nixos.org/t/nix-2-29-0-released/64609 Nix 2.29.0 released | 13:09:10 |
Mic92 | I think if you do a lot of -v than it will print the flake cache that causes the copying. | 13:10:53 |
Mic92 | https://github.com/numtide/nix-eval-cache | 13:12:30 |
Mic92 | currently limited to Linux, but could be ported to darwin as well with the right environment variables for LD_PRELOAD | 13:13:09 |
| Perchun Pak [don't ping; dm instead] changed their display name from Perchun Pak to Perchun Pak [don't ping; dm instead]. | 13:50:46 |
emily | the LD_PRELOAD equivalent doesn't work super reliably on Darwin | 13:58:02 |
emily | though with Nix it might work fine since I guess it probably doesn't go through SIP stuff | 13:58:11 |
emily | does this handle builtins.readFile ? | 13:58:17 |
emily | -v -v doesn't actually seem to slow things down appreciably after re-testing so it seems likely adequate for my usecase | 13:58:29 |
emily | (using scopedImport to catch readFile takes 1.5× longer to eval :( ) | 14:00:53 |
emily | I guess I could PR tracing readFile in -v -v too 🙃 | 14:01:07 |
puck | In reply to @emilazy:matrix.org (using scopedImport to catch readFile takes 1.5× longer to eval :( ) (scopedImport doesn't cache imports the way import does; this is maybe a pretty big reason for the slowdown?) | 14:26:32 |
emily | hmm I'd somewhat hope Nixpkgs doesn't import the same files over and over but maybe that's optimistic | 14:27:11 |
emily | indeed it is, sort -u goes from 6186 to 4003 | 14:28:18 |
emily | which is precisely a ratio that explains the slowdown | 14:28:28 |
emily | I wonder if there's anything disgusting I can do to re-add the caching | 14:28:43 |
emily | best idea I can immediately come up with is let imports = listToAttrs (map (filename: { name = filename; value = scopedImport env filename; }) enumerateEveryFileInNixpkgs); env = { import = filename: imports.${filename} or scopedImport env filename; …; }; or something | 14:32:28 |
emily | and by best I mean horrible | 14:32:33 |
emily | constant factors seem like they'd be brutal too | 14:32:43 |
emily | the other thing is that I actually don't need to trace stuff in Nixpkgs… but I can't just avoid forwarding import = scopedImport env; to Nixpkgs, because Nixpkgs can import user code again (e.g. callPackage ) | 14:36:23 |
emily | I guess I could override lib.callPackageWith and hope there's no other important cases :) | 14:37:49 |
| sbc64 joined the room. | 16:40:46 |
Philip Taron (UTC-8) | Awesome news! Is there someone from the Nix core team on deck to make the nixpkgs PR, or would you like community support from (say) me there? | 17:59:48 |
Philip Taron (UTC-8) | I'm also interested in the future of the componetized build in Nixpkgs | 18:00:21 |
John Ericson | hmm we are using boost regex without doing --with-regex in our boost | 20:24:15 |