-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
heaptrack: wrap GUI for QT plugins #51597
Conversation
The `heaptrack_gui` program requires QT plugins. This works if it's included in a full install, since QT will search the users' `$PATH` for plugins; however it immediately crashes if run in a pure environment. This wraps the program to find the given `qtbase` plugins directory without requiring an impure installation. Related: NixOS#9680
@GrahamcOfBorg build heaptrack |
qtbase kio kitemmodels threadweaver kconfigwidgets kcoreaddons kdiagram | ||
]; | ||
|
||
postInstall = '' | ||
wrapProgram $out/bin/heaptrack_gui --set QT_PLUGIN_PATH ${qtbase}/${qtbase.qtPluginPrefix} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried to install heaptrack_gui
in your nix profile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impurity for qt is necessary because the way qt searches for plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it works just fine when impurely installed and run through a user profile. However, with this change it also works when package is used outside of a nix-env
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting QT_PLUGIN_PATH
will break integration with desktop environments: #24256 (comment)
This needs to be fixed in a central place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a such a fix: #44047
The
heaptrack_gui
program requires QT plugins. This works if it's included ina full install, since QT will search the users'
$PATH
for plugins; however itimmediately crashes if run in a pure environment.
This wraps the program to find the given
qtbase
plugins directory withoutrequiring an impure installation.
Related: #9680
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)