diff --git a/doc/manual/source/development/debugging.md b/doc/manual/source/development/debugging.md index d2450495e..6578632d9 100644 --- a/doc/manual/source/development/debugging.md +++ b/doc/manual/source/development/debugging.md @@ -6,14 +6,7 @@ Additionally, see [Testing Nix](./testing.md) for further instructions on how to ## Building Nix with Debug Symbols -In the development shell, set the `mesonBuildType` environment variable to `debug` before configuring the build: - -```console -[nix-shell]$ export mesonBuildType=debugoptimized -``` - -Then, proceed to build Nix as described in [Building Nix](./building.md). -This will build Nix with debug symbols, which are essential for effective debugging. +In the development shell, `mesonBuildType` is set automatically to `debugoptimized`. This builds Nix with debug symbols, which are essential for effective debugging. It is also possible to build without optimization for faster build: diff --git a/packaging/dev-shell.nix b/packaging/dev-shell.nix index 95cbc4a36..8fb4cb743 100644 --- a/packaging/dev-shell.nix +++ b/packaging/dev-shell.nix @@ -258,10 +258,13 @@ pkgs.nixComponents2.nix-util.overrideAttrs ( # We use this shell with the local checkout, not unpackPhase. src = null; + # Workaround https://sourceware.org/pipermail/gdb-patches/2025-October/221398.html # Remove when gdb fix is rolled out everywhere. separateDebugInfo = false; + mesonBuildType = "debugoptimized"; + env = { # For `make format`, to work without installing pre-commit _NIX_PRE_COMMIT_HOOKS_CONFIG = "${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml"