From c89c22a9c28d0487fbbf0e026ba37239464b0779 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li <44064051+ShamrockLee@users.noreply.github.com> Date: Fri, 17 Feb 2023 19:17:10 +0800 Subject: [PATCH 1/2] root: separateDebugInfo = true on Linux --- pkgs/applications/science/misc/root/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index cfda819a42ca..e38bb2ec8fdd 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -261,6 +261,14 @@ stdenv.mkDerivation rec { ]}" ''; + # To use the debug information on the fly (without installation) + # add the outPath of root.debug into NIX_DEBUG_INFO_DIRS (in PATH-like format) + # and make sure that gdb from Nixpkgs can be found in PATH. + # + # Building with debug info and separating them is not supported on all systems + # e.g. Darwin fails to support it (#203380) + separateDebugInfo = stdenv.hostPlatform.isLinux; + setupHook = ./setup-hook.sh; meta = with lib; { From b96226578e8454f2db2b80bb4847bebd748a3857 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li <44064051+ShamrockLee@users.noreply.github.com> Date: Sun, 5 Mar 2023 03:30:17 +0800 Subject: [PATCH 2/2] root: specify separateDebugInfo = true for all pltforms --- pkgs/applications/science/misc/root/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index e38bb2ec8fdd..a33af5795108 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -265,9 +265,10 @@ stdenv.mkDerivation rec { # add the outPath of root.debug into NIX_DEBUG_INFO_DIRS (in PATH-like format) # and make sure that gdb from Nixpkgs can be found in PATH. # - # Building with debug info and separating them is not supported on all systems - # e.g. Darwin fails to support it (#203380) - separateDebugInfo = stdenv.hostPlatform.isLinux; + # Darwin currently fails to support it (#203380) + # we set it to true hoping to benefit from the future fix. + # Before that, please make sure if root.debug exists before using it. + separateDebugInfo = true; setupHook = ./setup-hook.sh;