| 5 Jan 2025 |
connor (burnt/out) (UTC-8) | I’m not a member of the stdenv team but I’m all for more visibility | 18:53:46 |
emily | teams are a fake idea :) | 18:54:36 |
emily | (what I mean is, I'm of course partially looking for feedback from people with a better sense of the likely consequences than me, but also I think starting to make judgement calls and seeing how they end up is the only way you develop that sense in the first place.) | 18:57:46 |
connor (burnt/out) (UTC-8) | Well then ;)
Does anyone have thoughts on https://github.com/NixOS/nixpkgs/pull/370750 or https://github.com/NixOS/nixpkgs/pull/370742? | 18:57:53 |
emily | I saw these while trawling through open staging PRs for the upcoming cycle but mainly concluded "nope, not right before we dive into another staging-next" 😅 | 18:58:42 |
emily | I'd really like @nix-based unconditional logging filtered on the client so that you can access verbose stuff without fussing around with stdenv overrides | 18:59:04 |
emily | not that that should block incremental improvements in the meantime | 18:59:10 |
emily | the hook seems like a good idea to me | 19:00:06 |
connor (burnt/out) (UTC-8) | Oh you mean like structured JSON logging? I had tried to do stuff with the @nix formatting but I didn’t like what the result looked like and templating JSON from bash is tricky, so it just does plain text logging | 19:00:07 |
emily | not structured per se | 19:00:28 |
emily | just using @nix to signal a log level and message, so that nix build/nix log can show your desired logging level without needing a rebuild | 19:00:43 |
emily | that would require getting changes in Nix though 🙃 | 19:00:53 |
emily | this came up back when we had really verbose logging for hooks on by default | 19:01:01 |
emily | which is useful to debug things without rebuilding the world but was really unpleasant most of the time | 19:01:10 |
emily | basically ideally we shouldn't be deciding to filter at build time but on the viewing end | 19:01:23 |
emily | (except for things so spammy that they might slow down a build appreciably to even shove through a pipe) | 19:01:35 |
connor (burnt/out) (UTC-8) | Ahhhhh yeah! It’d be particularly nice if there were an option to always capture the most verbose output in a build log file on disk (which could be compressed) while the content printed out was filtered for the current log level | 19:02:21 |
connor (burnt/out) (UTC-8) | lol agreed took me longer to type out the same thing | 19:02:50 |
emily | right. | 19:02:50 |
emily | I think most of the pieces are there already, it just needs implementing | 19:03:02 |
emily | here's some historical context | 19:03:33 |
emily | https://github.com/NixOS/nixpkgs/issues/328229
https://github.com/NixOS/nixpkgs/pull/331560
https://github.com/NixOS/nixpkgs/pull/331794 | 19:03:51 |
emily |
Both projects support structured output logging (through the @nix { "action": "msg", "level": "[0-7]", "msg": "some message" } special messages output to the file descriptor that $NIX_LOG_FD points to.
| 19:04:46 |
emily | IMO this would be very high value if someone managed to get it into Nix/Lix | 19:05:10 |
emily | because rebuilding with a higher NIX_DEBUG just to check some build issue sucks | 19:05:19 |
emily | we would have to check how much overhead even processing/storing/discarding the logs would be and there's even considerations like Hydra's web interface, but it would be really great | 19:05:39 |
emily | anyway, like I said enough of a task that it shouldn't block incremental improvements :) | 19:05:47 |
emily | but I don't think it would be an immense amount of implementation work and the benefits would be huge | 19:06:02 |
connor (burnt/out) (UTC-8) | Wouldn’t that change need to be backported through Nix 2.3? | 19:48:29 |
connor (burnt/out) (UTC-8) | * Wouldn’t such changes need to be backported through Nix 2.3? | 19:49:40 |