| 8 Jun 2021 |
manveru | builtins.unsafeGetAttrPos "bar" (builtins.listToAttrs [ { name = "foo"; value = "bar"; } ]) returns null in both the fixed and unfixed version... | 08:33:00 |
Regnat | In reply to @manveru:matrix.org now... how do you write a test for this? That’s very good question. I fear the best solution is to grep stderr to ensure that there’s a proper error message and check the return code (should be different between a segfault and a proper exit) | 08:37:49 |
manveru | anyway, here's my PR: https://github.com/NixOS/nix/pull/4895 | 08:37:46 |
manveru | hm, i see, most other tests are ad-hoc shell scripts as well | 08:40:00 |
manveru | ok, got a working test now as well :) | 09:03:14 |
manveru | thanks a lot | 09:03:16 |
Regnat | niksnut Looking at the GC again, is it correct that Exprs are generally leaking? | 17:09:09 |
niksnut | It's by design | 17:09:51 |
niksnut | There is basically no point in GC'ing ASTs | 17:11:08 |
niksnut | Since they generally exist for the duration of the program | 17:11:30 |
Regnat | Oh, do they? I kind-of assumed that once a thunk is evaluated, the underlying AST isn’t used anymore (and is unreachable anyways) | 17:29:18 |
Regnat | I’ll have to review my understanding of the evaluator then 🤔 | 17:34:01 |
niksnut | AST nodes are shared by all the thunks that refer to them | 17:46:32 |
niksnut | And there is a file cache, so if you import a file twice you get the same AST | 17:47:00 |
niksnut | But the most important thing is that AST memory usage is bounded by the set of Nix expressions imported | 17:48:16 |
niksnut | Unlike values, of which there can be arbitrarily many during an eval | 17:48:42 |
Regnat | In reply to @niksnut:matrix.org But the most important thing is that AST memory usage is bounded by the set of Nix expressions imported Ahah, yes, that’s true | 18:09:41 |
Regnat | I wonder though whether there’s something to gain from freeing them at the end of the eval… but given that there’s no clear point where we finish the eval, it probably doesn’t make much sense | 18:10:54 |
| 9 Jun 2021 |
| matto153 joined the room. | 08:06:21 |
matto153 | Hello all | 08:17:41 |
Mic92 (Old) | I assume flakes cannot have git submodules? | 11:42:14 |
manveru | Mic92: they can... but it's a major PITA | 11:50:42 |
manveru | you basically have to import self with fetchGit and submodules | 11:51:11 |
Mic92 (Old) | manveru: do you have an example? | 11:51:29 |
manveru | and it only works if the dir isn't dirty :P | 11:51:33 |
manveru | fullself = builtins.fetchGit { url = "https://whatever"; ref = "master"; rev = self.rev; submodules = true; }; | 11:52:41 |
manveru | kinda like that | 11:52:48 |
Mic92 (Old) | Ok. I see the problem | 11:53:32 |
manveru | of course that only works with master branch, because Nix can't get revs from undefined branches... | 11:53:41 |
manveru | and self.rev is only set if the flake isn't dirty | 11:53:54 |