Skip to content

heaptrack: wrap GUI for QT plugins - #51597

Closed
bhpdt wants to merge 1 commit into
NixOS:masterfrom
bhpdt:fix/heaptrack-gui
Closed

bhpdt wants to merge 1 commit into
NixOS:masterfrom
bhpdt:fix/heaptrack-gui

Conversation

@bhpdt

@bhpdt bhpdt commented Dec 6, 2018 •

Copy link
Copy Markdown

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

bhpdt commented Dec 6, 2018

Copy link
Copy Markdown
Author

CC @gebner @ttuegel @vcunat

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Dec 6, 2018
@bhipple

bhipple commented Dec 13, 2018

Copy link
Copy Markdown
Contributor

@GrahamcOfBorg build heaptrack

];

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@ttuegel ttuegel mentioned this pull request Jan 24, 2019
5 of 10 tasks
@bhpdt bhpdt closed this Jul 17, 2019
@Janik-Haag Janik-Haag added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants