Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

bhpdt
Copy link

@bhpdt bhpdt commented Dec 6, 2018

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: #9680

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

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
@bhpdt
Copy link
Author

bhpdt commented Dec 6, 2018

CC @gebner @ttuegel @vcunat

@bhipple
Copy link
Contributor

bhipple commented Dec 13, 2018

@GrahamcOfBorg build heaptrack

qtbase kio kitemmodels threadweaver kconfigwidgets kcoreaddons kdiagram
];

postInstall = ''
wrapProgram $out/bin/heaptrack_gui --set QT_PLUGIN_PATH ${qtbase}/${qtbase.qtPluginPrefix}
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants