Something which is also not well known:
You can do nix develop and then run through all the “phases” of the derivation and see what part fails.
Look like Nix-build-phases: run nix build phases interactively has a nice UX around it.
This script was renamed to nix-develop-interactive and it contains usage instructions inside.
Recently I have integrated it in to Nix Forge so it can be enabled by simple setting debug = true; in a package recipe.
Another approach that has been useful in various situations, use tmate! trivial-builders: init addTmateBreakpoint by MatthewCroughan · Pull Request #334924 · NixOS/nixpkgs · GitHub
All these years without even knowing such a thing existed… Thank you !
tmate maintainer says: “I’m closing the servers permanently”
Oh no ![]()
any good alternatives?
There are some alternatives being discussed in that github issue.
Very cool blog! Thank you!
It would be amazing to get some of this info added into some the tutorials, and/or other docs. - Sorry, but I’m not sure the best ones to put it into.
I wish I’d known about this about a week ago! ![]()
nativeBuildInputs = [
# add the breakpoint hook
pkgs.breakpointHook
];
Oh nice!
This kind of reminds me the builtins.break feature which allows to open an interactive repl anywhere during the evaluation (to debug), in case anyone interested.