!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

883 Members
For people hacking on the Nix package manager itself189 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
18 Jul 2025
@fzakaria:one.ems.hostfzakariasure; still better than current model. You can special case the 10% rather than give up on the 90%15:08:38
@joerg:thalheim.ioMic92
In reply to @fzakaria:one.ems.host
sweet -- the IWYU is what i'm really after.
You mean the clang-tidy one? Works quite well on nix-eval-jobs
17:33:14
@joerg:thalheim.ioMic92
In reply to @qyliss:fairydust.space
IWYU is difficult for portable programs like Nix
Maybe that can be enabled somehow for nix header only?
17:34:34
@joerg:thalheim.ioMic92Same actually for platform specific header - could be a bit tedious though 17:35:25
@joerg:thalheim.ioMic92 @xokdvium:matrix.org: clang format stuff is good to go? 17:36:58
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)I think so. The diff is good and the auto-rebase script seems to work well.17:37:33
@joerg:thalheim.ioMic92Okay. Hit it!17:38:04
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Done! No more range formatting. Yay!17:40:50
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Pinned an issue about the auto-rebase script: https://github.com/NixOS/nix/issues/1350218:02:18
@connorbaker:matrix.orgconnor (burnt/out) (UTC-8)I know that one of the expensive parts of CI with Nix monorepos is evaluation on each commit in part because there's no re-use of evaluation caches across commits. I see that a new AttrDb is created for each fingerprint (https://github.com/NixOS/nix/blob/b8d223a2106c7dbdb0c61f822288195ee9e26e9b/src/libexpr/eval-cache.cc#L75). For those with knowledge about evaluation caching as it is currently implemented: would it be feasible to rewrite it such that entries in Attributes use the hash of their source files as part of their primary key? As an example, if the hashes of the files read to evaluate an attribute doesn't change across two commits, the result from the first evaluation would be returned for the second (it would be cached).22:05:10
@andiandi:tchncs.deandiandi ๐Ÿˆ changed their display name from andiandi ๐Ÿฆ† to andiandi@hadr25.22:09:06
@andiandi:tchncs.deandiandi ๐Ÿˆ changed their display name from andiandi@hadr25 to andiandi@hadr25 ๐Ÿฐ๐Ÿž๏ธ.22:13:42
19 Jul 2025
@ma27:nicht-so.sexyma27
In reply to @connorbaker:matrix.org
I know that one of the expensive parts of CI with Nix monorepos is evaluation on each commit in part because there's no re-use of evaluation caches across commits.
I see that a new AttrDb is created for each fingerprint (https://github.com/NixOS/nix/blob/b8d223a2106c7dbdb0c61f822288195ee9e26e9b/src/libexpr/eval-cache.cc#L75).
For those with knowledge about evaluation caching as it is currently implemented: would it be feasible to rewrite it such that entries in Attributes use the hash of their source files as part of their primary key?
As an example, if the hashes of the files read to evaluate an attribute doesn't change across two commits, the result from the first evaluation would be returned for the second (it would be cached).
I think part of the problem is that you can't really say which files are the sourcefiles of an attribute without an evaluation, right?
17:41:11
20 Jul 2025
@connorbaker:matrix.orgconnor (burnt/out) (UTC-8) I think you could if using the flake interface. I've lookged through the eval-cache.cc file a bit, here's an idea.
Consider the portion which involves getting the keys of an attribute set. If before and after forcing a value you were snapshot and then compare the results of the import cache, that could be a start.
03:48:39
@roberthensing:matrix.orgroberth I plan to work on that starting Sep/Oct. Might work regardless of flakes :: Bool 15:16:39
@magic_rb:matrix.redalder.orgmagic_rb
In reply to @ma27:nicht-so.sexy
I think part of the problem is that you can't really say which files are the sourcefiles of an attribute without an evaluation, right?
Evaluation should form a tree of visited files theoretically. So you could go and rehash all the files and once you find the first divergence you need to reeval (if we could take incremental snapshots of the evaluator state and flatten the visited files into a list on the time axis, you could even pick up the eval maybe from where it left off? Essentially if you change only a leaf file, you only reimport the leaf)
15:31:04
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)It's about time the compile times got better. Yeeted https://github.com/NixOS/nix/pull/13510 and https://github.com/NixOS/nix/pull/13512.19:25:10
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)This smells much like Boost.Spirit or Boost.X320:41:54
21 Jul 2025
@connorbaker:matrix.orgconnor (burnt/out) (UTC-8)If youโ€™re going to NixCamp or NixCon this year, Iโ€™d love to find out more about your thoughts on how that could be implemented!02:34:48
@roberthensing:matrix.orgroberthI'll be at NixCon. Basic idea is: refactor evaluation so that it's an interaction between these three actors and "communication links": CLI - Evaluator - OS, and nothing else. Then MITM the Evaluator on both sides by recording the interactions of previous calls to the evaluator, and replaying them if possible.09:05:43
@roberthensing:matrix.orgroberthIt's somewhat of a research project; nothing is guaranteed09:07:02
@magic_rb:matrix.redalder.orgmagic_rbThats kinda what i was proposing https://matrix.to/#/!VRULIdgoKmKPzJZzjj:nixos.org/$FvXA39aRGz0iER7ZM-bRtUkJCuorYa0Ecy_YupgUPC8?via=nixos.org&via=matrix.org&via=nixos.dev ill be at nixcon too. Definitely will be around for this09:08:24
@andiandi:tchncs.deandiandi ๐Ÿˆ changed their display name from andiandi@hadr25 ๐Ÿฐ๐Ÿž๏ธ to andiandi ๐Ÿˆ.11:04:23
@connorbaker:matrix.orgconnor (burnt/out) (UTC-8) Iโ€™d love to talk more about this with you all!
Any chance C++ has something akin to Haskellโ€™s STM?
14:11:52
@connorbaker:matrix.orgconnor (burnt/out) (UTC-8) tomberek you might be interested in this โ€” I know I talked with you about having an import cache which stores the processed AST instead of the file itself. (One idea I had was to key on the hash of the AST so formatting wouldnโ€™t cause cache misses.) 14:44:35
@toonn:matrix.orgtoonn .oO(Unison...) 14:45:29
@emilazy:matrix.orgemilysee https://matrix.to/#/!VRULIdgoKmKPzJZzjj:nixos.org/$ynuYm1cT2gUMemb4CiyueY7KlkO0yqppb8i9xb6ENJ8?via=nixos.org&via=matrix.org&via=nixos.dev for my attempts14:48:07
@emilazy:matrix.orgemily unfortunately to trace builtins.readFile you need scopedImport which slows things down a bunch 14:48:23
@magic_rb:matrix.redalder.orgmagic_rb
In reply to @emilazy:matrix.org
unfortunately to trace builtins.readFile you need scopedImport which slows things down a bunch
Well, it would have to be done at the c++ level and the evaluator would have to become serializable for my idea to work
14:54:00
@emilazy:matrix.orgemilyyes, that would be better14:54:20

Show newer messages


Back to Room ListRoom Version: 6