!UUqahLbShAYkkrXmKs:matrix.org

DevOS

37 Members
Seeking help and geeking out together on https://github.com/divnix/devos & https://github.com/divnix/digga10 Servers

Load older messages


SenderMessageTime
30 Jul 2021
@blaggacao:matrix.orgDavid Arnold (blaggacao)So I look at the backtraces and place a few traces in nixpkgs to understand what's really going on and then use that modified version of nixpkgs as an inout 16:41:24
@blaggacao:matrix.orgDavid Arnold (blaggacao)* So I look at the backtraces and place a few traces in nixpkgs to understand what's really going on and then use that modified version of nixpkgs as an input. 16:41:36
@blaggacao:matrix.orgDavid Arnold (blaggacao)* ... at least it guarantees that you are eventually able to find the root cause without resorting to rolling the dices.16:42:31
@blaggacao:matrix.orgDavid Arnold (blaggacao) Gytis Ivaskevicius has made a PR to nix to eventually improve that situation. 16:43:20
@yusdacra:nixos.devyusdacra
In reply to @blaggacao:matrix.org
So I look at the backtraces and place a few traces in nixpkgs to understand what's really going on and then use that modified version of nixpkgs as an input.
Ooooh
16:44:34
@blaggacao:matrix.orgDavid Arnold (blaggacao)https://github.com/NixOS/nix/pull/491416:44:34
@yusdacra:nixos.devyusdacraThat's useful16:46:01
@timdeh:matrix.org@timdeh:matrix.org

I find some common patterns that reliably cause infinite recursion:

  • careless use of rec in overlays
  • computation directly in an import

Both of these can be easily solved by using a let binding instead. Whenever I find infinite recursion and I can't trace it back to my local changes, i.e. tons of nixpkgs traces, I just start commenting stuff out until it works, and then work backwards from there 😅

16:46:35
@blaggacao:matrix.orgDavid Arnold (blaggacao)... buts somtimes chaos monkey dice rolling is quicker 😃🦧16:46:46
@yusdacra:nixos.devyusdacraI would love to add debugging traces to a nix library of mine, but using builtins.trace would print way too much stuff16:46:48
@blaggacao:matrix.orgDavid Arnold (blaggacao)
In reply to @timdeh:matrix.org

I find some common patterns that reliably cause infinite recursion:

  • careless use of rec in overlays
  • computation directly in an import

Both of these can be easily solved by using a let binding instead. Whenever I find infinite recursion and I can't trace it back to my local changes, i.e. tons of nixpkgs traces, I just start commenting stuff out until it works, and then work backwards from there 😅

I can complement:

  • Similar to rec, it can also happen with overlays and "recless" crossing of prev and final dependency.
  • Using flake self outside of an output value seems to cause that too.
16:48:54
@timdeh:matrix.org@timdeh:matrix.orgMaybe we change to channel to DevOS/Nix Debugging 🤣16:49:43
@timdeh:matrix.org@timdeh:matrix.org * Maybe we change the channel name to DevOS/Nix Debugging 🤣16:49:53
@timdeh:matrix.org@timdeh:matrix.orgWhat you refer to as DevOS is in fact Nix Debugging/DevOS 🤓16:50:35
@blaggacao:matrix.orgDavid Arnold (blaggacao)If we are a nixos nursery, we need to definitly empower users as much as possible. 😎16:50:44
@blaggacao:matrix.orgDavid Arnold (blaggacao)Which makes me think of adding a section to the docs for debugging...16:51:33
@blaggacao:matrix.orgDavid Arnold (blaggacao)* Which makes me think of adding a section to the docs for (teaching) debugging...16:51:44
@blaggacao:matrix.orgDavid Arnold (blaggacao) I'd rather be an enabler than a fixer. 16:52:32
@gytis-ivaskevicius:matrix.org@gytis-ivaskevicius:matrix.org
In reply to @blaggacao:matrix.org
Gytis Ivaskevicius has made a PR to nix to eventually improve that situation.
if you are talking about builtins.debug - dont expect it to get merged :D
16:53:20
@timdeh:matrix.org@timdeh:matrix.org d4hines: hopefully our little Nix debugging venting session is useful for your future endeavors 😛 16:57:56
@d4hines:matrix.orgd4hinesYeah, this looks like helpful info but I don't have the context to place it yet16:58:18
@blaggacao:matrix.orgDavid Arnold (blaggacao) I think another journyman status standard move is rg 'someThingThatINeedToUnderstand =' <path to nixpkgs> 16:59:45
@blaggacao:matrix.orgDavid Arnold (blaggacao) * I think another journeyman status standard move is rg 'someThingThatINeedToUnderstand =' <path to nixpkgs> 17:00:08
@blaggacao:matrix.orgDavid Arnold (blaggacao) * I think another journeyman status standard move is rg 'someThingThatINeedToUnderstand =' <path to nixpkgs> (but there might be an improved version of that move?) 17:00:34
@blaggacao:matrix.orgDavid Arnold (blaggacao) * I think another journeyman status standard move is rg -A 3 'someThingThatINeedToUnderstand =' <path to nixpkgs> (but there might be an improved version of that move?) 17:00:55
@blaggacao:matrix.orgDavid Arnold (blaggacao) * I think another journeyman status standard move is rg -C 3 'someThingThatINeedToUnderstand =' <path to nixpkgs> (but there might be an improved version of that move?) 17:01:03
@timdeh:matrix.org@timdeh:matrix.org I use that one quite a bit as well, don't think there is a better one except maybe manix? 17:03:26
@timdeh:matrix.org@timdeh:matrix.orgWhich reminds me, one of our colleagues recently spruced up the old manix integrated fork of rnix-lsp if it's useful to anyone: https://github.com/kreisys/rnix-lsp17:08:15
@yusdacra:nixos.devyusdacra
In reply to @timdeh:matrix.org
I use that one quite a bit as well, don't think there is a better one except maybe manix?
Using manix with skim / fzf is quite nice
17:11:50
@timdeh:matrix.org@timdeh:matrix.orgyeah but it doesn't always seem to find everything I'm looking for unfortunately, but otherwise I agree completely 17:35:02

Show newer messages


Back to Room ListRoom Version: 6