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

Qt: purify plugin paths, unify Linux and Darwin builders #25285

Merged
merged 32 commits into from Apr 30, 2017

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Apr 28, 2017

Motivation

  1. Qt applications are quite fragile in the face of mis-versioned plugins installed to the system or user environment. This is a particular problem with platform plugins because Qt attempts to load every platform plugin it can find. This problem is mitigated by allowing Qt to search only its installation path and explicitly specified paths for platform plugins.
  2. The Linux and Darwin builders have diverged significantly. This is remedied in part by unifying the patchsets used by each system.

Testing

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

I have no ability to test these changes on Darwin. If I recall correctly, @copumpkin and @acowley have worked on Qt-on-Darwin in the past; could you take a look?

Some package(s) refer to kwin service types by the wrong names. I would prefer
to patch those packages, but I cannot find them!
libkscreen provides all available kscreen backends, so there is no reason to
search the environment for plugins.
The default installation path for QPA plugins is appended to
QT_QPA_PLATFORM_PLUGIN_PATH, making it unnecessary to wrap some applications and
preventing applications from loading platform plugins from the wrong Qt version.
This option does not require a patch; it can be enabled through
NIX_CFLAGS_COMPILE.
Qt is configure with `-openssl-linked` which causes the library paths to be
resolved at build time and added to RPATH.
Qt is configured with `-dbus-linked` which causes the library paths to be
resolved at compile time and added to RPATH.
@mention-bot
Copy link

@ttuegel, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bjornfor, @periklis and @copumpkin to be potential reviewers.

@copumpkin
Copy link
Member

I don't actually use qt at all; my only work on it was during the LLVM 4 stdenv upgrade, which broke qt, so I fixed it. @periklis seemed to be pretty interested though.

-QMAKE_INCDIR_OPENGL =
-QMAKE_LIBDIR_OPENGL =
+QMAKE_INCDIR_OPENGL = @mesa_inc@/include
+QMAKE_LIBDIR_OPENGL = @mesa_lib@/lib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be included in qt5/5.8/qtbase/default.nix L94 for the mac mkspec, too. I suspect these are the missing dependencies for building qtwebkit on mac, because of the "missing OpenGL" errors i see.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what libGL should be used on macs.

@periklis
Copy link
Contributor

periklis commented Apr 28, 2017

@ttuegel Thx for the great work, i'll put this PR on a jobset to test it on darwin.

@ttuegel ttuegel merged commit 4e0d21e into NixOS:master Apr 30, 2017
@ttuegel ttuegel deleted the qt--fix-plugin-paths branch April 30, 2017 12:33
vcunat added a commit that referenced this pull request Apr 30, 2017
@ericsagnes
Copy link
Contributor

ericsagnes commented May 20, 2017

@ttuegel This seem to have broke how libsForQt5.fcitx-qt5 is supposed to work. Any idea / suggestion on how this could be fixed?

Update: To be more precise, 6169bd9 seems to be the cause.

@ttuegel
Copy link
Member Author

ttuegel commented May 20, 2017

@ericsagnes For the moment, we can set QT_PLUGIN_PATH from the NixOS module.

In the longer-term, I am working on some changes to our Qt packages for better integration with the user environment. That includes reverting 6169bd9 (or at least, bringing back something like what we had before). Sorry for the churn!

ericsagnes added a commit to ericsagnes/nixpkgs that referenced this pull request May 20, 2017
PR NixOS#25285 removed the auto-detection of qt plugins from NIX_PROFILE,
explicitly declaring QT_PLUGIN_PATH in the module solve the problem
@ericsagnes
Copy link
Contributor

@ttuegel Thanks!

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

6 participants