NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.13k forks source link

Could not find the Qt platform plugin "xcb" in "" while in wireshark nix-shell (installed version works fine) #115297

Open teto opened 3 years ago

teto commented 3 years ago

Describe the bug

I am trying to patch wireshark and while in nix-shell -A wireshark, after a cmakeConfigurePhase && buildPhase, trying to run the built binary fails with:

(ins)❯ ./run/wireshark 
23:28:42.652     Main Warn Could not find the Qt platform plugin "xcb" in ""
Aborted (core dumped)

If I take a look at my system wireshark head /etc/profiles/per-user/teto/bin/wireshark, it exports stuff like

export QT_PLUGIN_PATH='/nix/store/k7sjqfm8hc63s78c7xl9mqrkxmd2vfaz-qtbase-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
export QT_PLUGIN_PATH='/nix/store/bp2yjlck5gni5bc3grnz93w443xxi4q6-qtsvg-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
export QT_PLUGIN_PATH='/nix/store/wd7aaz5zlvqi6r197gx0733c240whnr9-qtdeclarative-5.15.2-bin/lib/qt-5.15.2/plugins'${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH

If I export these in my nix-shell then the error disappears.

I wonder if the qt hooks could automatically prefill the shellHook too ?

cole-h commented 3 years ago

You might try running wrapQtAppsHook in that shell.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info