4 ms·
> Error messages that tell you absolutely nothing about what went wrong were pretty common. Maybe I'm holding it wrong, but I almost never get useful error mes
by _hl_ 4y ago
> Error messages that tell you absolutely nothing about what went wrong were pretty common.
Maybe I'm holding it wrong, but I almost never get useful error messages from Nix (NixOS and NixOps). Almost every error is deep within some module with no trace to the option I set. Just nix barfing its 300-line eval traceback where my own code doesn't even appear.
- geddawm 4y agoNix has a debugger now. You can drop into the frames that are causing problems and inspect the state. Miles easier than looking at the trace manually.
- benreesman 4y agoI last flashed my flake.lock in June, so I might be out of date, but my rigs can’t reliably include the line number in my code that led to the duck-typing fiasco deep in the core of someLanguage.withPackages.fuck.WTF.this. Fix the fucking “—show-trace” thing folks. Seriously.
- VTimofeenko 4y agoOut of all cases when I used --show-trace, I can remember it being useful only once or twice. I gave up and just sprinkled builtins.trace. IIRC debugger comes with nix 2.9 and nixpkgs for 22.05 still has 2.8.x.
- n8henrie 4y agoI was excited to see the debugger flag to nix build the other day, since I'm really struggling cross-compiling an RPi on BTRFS root sd image. Of course running with the debugger flag resulted in an unintelligible error message and no debugger.
- rtpg 4y agoAny link to documentation on how to use it? Would be a godsend for me
- baby 4y agoI agree. I'm actually trying a hello-world example from the tweag website, and it complains about "gcc" not existing. I try adding buildInputs = [ nixpkgs.gcc ]; but it complains that nixpkgs.gcc does not exist. There's nothing helpful. I remember fixing this issue a month ago, and I have no recollection on how I did it.
- kaba0 4y agoI don’t know what is the specific file you are working on, but shouldn’t it be pkgs.gcc?
- hypersoar 4y agoAre you using flakes? You need to use the legacyPackages output for your system, e.g. buildInputs = [ nixpkgs.legacyPackages."x64_64-linux".gcc ]; In practice, it usually looks something like this: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; in stdenv.mkDerivation { ... buildInputs = [ pkgs.gcc ]; ... }
- SuperSandro2000 4y agoThat's strange. GCC is part of the stdenv on Linux and though always available. To correct your coffee snippet: nativeBuildInputs = [ pkgs.gcc ];
- baby 4y agoI’m on mac, I managed to fix it with https://mimoo.github.io/nixbyexample/flakes-packaging.html https://mimoo.github.io/nixbyexample/flakes-packaging.html
- baby 4y agoAnd now I’m trying to understand how devshells work in flakes and there’s pretty no doc
- Smaug123 4y agoAsk your questions on discourse.nixos.org please - the documentation situation in Nix-land is generally exactly as you have noted, which means centralised question-asking in well-known locations is much much more helpful for Those Who Come After.