QT debugging or the frustrating case of the missing symbols

I tried now for multiple days with countless combinations of enableDebugging, override, overrideAttrs or every hint I found so far. I can’t remember all the combinations, I tried only that I compiled QT very, very often.

All I want is to have debugging symbols of QT in the development shell created by our shell.nix but nothing seems to work.

I tried:

buildInputs = [
    (pkgs.enableDebugging ((pkgs.qt5.override {debug = true; developerBuild = true;}).qtbase))
....
];

Nor this try:

buildInputs = [
    pkgs.qt5.qtbase.overrideAttrs (oldAttrs: rec {
       separateDebugInfo = false;
       dontStrip = true;
       debug = true;
       developerBuild = true;
     })
...
];

My environment.enableDebugInfo = true; is set but the shell does only have:

declare -x NIX_DEBUG_INFO_DIRS="/run/current-system/sw/lib/debug"

Why are there no directories to the debug symbols of buildInputs ?

I even tried patching around in my nixpkgs, but all the time the f*** strips when building qt. I run out of ideas in this super frustrating endeavor :frowning:

please help before I install debian again :wink:

I’m assuming you’re using qtX.mkDerivation. Due to how https://github.com/NixOS/nixpkgs/blob/9e2880e5fa0cda607ad670cde12dc93735d2f97a/pkgs/development/libraries/qt-5/mkDerivation.nix is constructed, you would have to do something like this:

mkDebugDerivation = callPackage (pkgs.path + "/development/libraries/qt-5/mkDerivation.nix") { debug = true; }

otherwise release build gets passed to qmake, NIX_CFLAGS_COMPILE, cmake. And that will strip out debug symbols.