!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

839 Members
For people hacking on the Nix package manager itself182 Servers

Load older messages


SenderMessageTime
22 May 2025
@emilazy:matrix.orgemily 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
@emilazy:matrix.orgemily I can't reproduce. I guess -v -v is great :) 05:46:34
@emilazy:matrix.orgemilyI wish it would trace other file accesses though05:46:45
@emilazy:matrix.orgemily like builtins.readFile 05:46:54
@emilazy:matrix.orgemily does anyone understand why nix eval .?rev=X#foo will sometimes produce "copying …" messages even when the rev did not change? 09:35:24
@joerg:thalheim.ioMic92https://discourse.nixos.org/t/nix-2-29-0-released/64609 Nix 2.29.0 released13:09:10
@joerg:thalheim.ioMic92I think if you do a lot of -v than it will print the flake cache that causes the copying.13:10:53
@joerg:thalheim.ioMic92https://github.com/numtide/nix-eval-cache13:12:30
@joerg:thalheim.ioMic92currently limited to Linux, but could be ported to darwin as well with the right environment variables for LD_PRELOAD13:13:09
@perchun:matrix.orgPerchun Pak [don't ping; dm instead] changed their display name from Perchun Pak to Perchun Pak [don't ping; dm instead].13:50:46
@emilazy:matrix.orgemilythe LD_PRELOAD equivalent doesn't work super reliably on Darwin13:58:02
@emilazy:matrix.orgemilythough with Nix it might work fine since I guess it probably doesn't go through SIP stuff13:58:11
@emilazy:matrix.orgemily does this handle builtins.readFile? 13:58:17
@emilazy:matrix.orgemily -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
@emilazy:matrix.orgemily (using scopedImport to catch readFile takes 1.5× longer to eval :( ) 14:00:53
@emilazy:matrix.orgemily I guess I could PR tracing readFile in -v -v too 🙃 14:01:07
@puck:puck.moepuck
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
@emilazy:matrix.orgemilyhmm I'd somewhat hope Nixpkgs doesn't import the same files over and over but maybe that's optimistic14:27:11
@emilazy:matrix.orgemily indeed it is, sort -u goes from 6186 to 4003 14:28:18
@emilazy:matrix.orgemilywhich is precisely a ratio that explains the slowdown14:28:28
@emilazy:matrix.orgemilyI wonder if there's anything disgusting I can do to re-add the caching14:28:43
@emilazy:matrix.orgemily 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
@emilazy:matrix.orgemilyand by best I mean horrible14:32:33
@emilazy:matrix.orgemilyconstant factors seem like they'd be brutal too14:32:43
@emilazy:matrix.orgemily 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
@emilazy:matrix.orgemily I guess I could override lib.callPackageWith and hope there's no other important cases :) 14:37:49
@sbc64:matrix.orgsbc64 joined the room.16:40:46
@philiptaron:matrix.orgPhilip 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
@philiptaron:matrix.orgPhilip Taron (UTC-8)I'm also interested in the future of the componetized build in Nixpkgs18:00:21
@Ericson2314:matrix.orgJohn Ericson hmm we are using boost regex without doing --with-regex in our boost 20:24:15

Show newer messages


Back to Room ListRoom Version: 6