NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.6k stars 1.51k forks source link

Add Debugging Instructions to Nix Manual #11502

Open michaelvanstraten opened 1 month ago

michaelvanstraten commented 1 month ago

Problem

Currently, it's hard to get started with launching a debuggable instance of Nix. Building Nix with debug symbols requires knowledge of internal environment variables like mesonBuildType, which are not well-documented. For example, to build with debug symbols, you need to run:

nix develop .#native-clangStdenvPackages
# `make clean` did not work
trash build 
export mesonBuildType=debug
mesonConfigurePhase
ninjaBuildPhase

Additionally, there is no documentation on how to attach a debugger to the nix-daemon.

Proposal

Add a "Debugging" section to the Nix manual's development chapter. This section should include:

Checklist

Priorities

Add 👍 to issues you find important.

michaelvanstraten commented 1 month ago

I am planning to create a pull request to add this documentation if it hasn't been done already.