| 4 May 2023 |
raitobezarius | Right now, what I'm doing is that I am adding touched_modules to track nixos/activation: ... or stuff like that | 20:57:15 |
raitobezarius | then transform touched modules into a proper list of affected modules ideally | 20:57:25 |
raitobezarius | by checking also the changed paths | 20:57:31 |
raitobezarius | the most annoying thing though is it's unclear I can do ./test-pr $pr-number and run the whole nixpkgs eval logic on it without setting everything | 20:58:05 |
raitobezarius | I'm wondering how hackable a thin wrapper to create this test-pr would require given the presence of a full fledged AMQP broker in this thing | 20:58:22 |
raitobezarius | the code is full of easter eggs | 21:00:22 |
raitobezarius | // FIXME: remove with rust/cargo update
#[allow(clippy::cognitive_complexity)]
| 21:01:58 |
raitobezarius | I wonder if the easiest thing is to extract the logic that makes sense in a general way into a separate crate and test it then rewire it in ofborg | 21:03:09 |
hexa | raitobezarius: you did see the call that was posted into the related issue? | 21:38:18 |
hexa |
nix-instantiate --eval '<nixpkgs/nixos>' --arg configuration '{}' -A config.meta.maintainers --strict --json
| 21:38:35 |
raitobezarius | Yeah I know about nix-instantiate --eval '<nixpkgs/nixos>' --arg configuration '{}' -A config.meta.maintainers --strict --json | 21:38:50 |
hexa | ok, just making sure | 21:38:58 |
raitobezarius | I'm trying to understand the options | 21:39:07 |
raitobezarius | Clearly, if I had a way to relate changed paths with those paths in the JSON, it would be easy win | 21:39:25 |
raitobezarius | But I think it's a good idea to try to be proper about it | 21:40:17 |
raitobezarius | now that I talked enough I have an idea to do it purely in Nix maybe | 21:46:46 |
raitobezarius | ah but your technique cannot recover the name of the module | 21:54:32 |
raitobezarius | also I don't think we store the name of modules anywhere anyway | 21:54:38 |
raitobezarius | https://github.com/NixOS/ofborg/pull/641 here's a wip | 22:09:05 |
raitobezarius | some stuff might need to be fixed but I think the strategy should work | 22:09:30 |
raitobezarius | interested into some feedback though before going too far | 22:10:21 |
raitobezarius | In reply to @raitobezarius:matrix.org also I don't think we store the name of modules anywhere anyway (I can derive it via string ops on filenames) | 22:11:39 |
cole-h | Having to evaluate NixOS seems like it would add a lot of overheard to the evaluation times. Maybe you could look at how it would change that before going too far.
ofborg/src/nixstats.rs and ofborg/src/outpathdiff.rs might have some hints on how that information is generated. | 22:12:11 |
raitobezarius | evaluating NixOS with an empty module set I believe is extremely fast? | 22:12:44 |
raitobezarius | * evaluating NixOS with an empty configuration I believe is extremely fast? | 22:12:51 |
cole-h | I'd be happier with empirical evidence :P | 22:13:05 |
raitobezarius | ❯ hyperfine "nix-instantiate --eval '<nixpkgs/nixos>' --arg configuration '{}' -A config.meta.maintainers --strict --json"
Benchmark 1: nix-instantiate --eval '<nixpkgs/nixos>' --arg configuration '{}' -A config.meta.maintainers --strict --json
Time (mean ± σ): 621.8 ms ± 22.6 ms [User: 524.8 ms, System: 91.2 ms]
Range (min … max): 597.3 ms … 663.9 ms 10 runs
| 22:13:59 |
raitobezarius | {
"cpuTime": 0.49957001209259033,
"envs": {
"bytes": 12506824,
"elements": 609381,
"number": 476986
},
"gc": {
"heapSize": 402915328,
"totalBytes": 87726480
},
"list": {
"bytes": 1933232,
"concats": 13049,
"elements": 241654
},
"nrAvoided": 488806,
"nrFunctionCalls": 412021,
"nrLookups": 240540,
"nrOpUpdateValuesCopied": 1193821,
"nrOpUpdates": 12482,
"nrPrimOpCalls": 244606,
"nrThunks": 691079,
"sets": {
"bytes": 29699424,
"elements": 1702651,
"number": 153563
},
"sizes": {
"Attr": 16,
"Bindings": 16,
"Env": 16,
"Value": 24
},
"symbols": {
"bytes": 531386,
"number": 45882
},
"values": {
"bytes": 27441768,
"number": 1143407
}
}
| 22:14:20 |
raitobezarius | for the nix show stats | 22:14:23 |
cole-h | Cool | 22:14:35 |