mirror of
https://github.com/NixOS/nix.git
synced 2025-12-22 17:01:08 +01:00
Merge pull request #14798 from NixOS/devshell-debug
dev-shell: Set mesonBuildType to debugoptimized
This commit is contained in:
commit
8e044f1ed0
2 changed files with 4 additions and 8 deletions
|
|
@ -6,14 +6,7 @@ Additionally, see [Testing Nix](./testing.md) for further instructions on how to
|
||||||
|
|
||||||
## Building Nix with Debug Symbols
|
## Building Nix with Debug Symbols
|
||||||
|
|
||||||
In the development shell, set the `mesonBuildType` environment variable to `debug` before configuring the build:
|
In the development shell, `mesonBuildType` is set automatically to `debugoptimized`. This builds Nix with debug symbols, which are essential for effective debugging.
|
||||||
|
|
||||||
```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.
|
|
||||||
|
|
||||||
It is also possible to build without optimization for faster build:
|
It is also possible to build without optimization for faster build:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -258,10 +258,13 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
|
||||||
|
|
||||||
# We use this shell with the local checkout, not unpackPhase.
|
# We use this shell with the local checkout, not unpackPhase.
|
||||||
src = null;
|
src = null;
|
||||||
|
|
||||||
# Workaround https://sourceware.org/pipermail/gdb-patches/2025-October/221398.html
|
# Workaround https://sourceware.org/pipermail/gdb-patches/2025-October/221398.html
|
||||||
# Remove when gdb fix is rolled out everywhere.
|
# Remove when gdb fix is rolled out everywhere.
|
||||||
separateDebugInfo = false;
|
separateDebugInfo = false;
|
||||||
|
|
||||||
|
mesonBuildType = "debugoptimized";
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
# For `make format`, to work without installing pre-commit
|
# For `make format`, to work without installing pre-commit
|
||||||
_NIX_PRE_COMMIT_HOOKS_CONFIG = "${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml"
|
_NIX_PRE_COMMIT_HOOKS_CONFIG = "${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue