Qt Apps cant make use of qtwayland due to QT_PLUGIN_PATH '= wrapping

DoneSubmitted by Brendan Tildesley.
Details
4 participants
  • Hartmut Goebel
  • Brendan Tildesley
  • Raghav Gururajan
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
B
B
Brendan Tildesley wrote on 16 Sep 2020 13:16
(address . bug-guix@gnu.org)
650d1848-7dc8-2063-265c-1a965a1dd5ee@brendan.scot
qt-build-system wraps variables such as QT_PLUGIN_PATH  with  '= instead
of prefix, so when qtwayland is installed in a profile or included in
the environment, the application fails to see it. Programs run with
export QT_QPA_PLATFORM=wayland-egl will fail to launch.

We could:

1. Use 'prefix so that the parent environment's variables are appended
and users have to manually install qtwayland them selves.
2. Include qtwayland as an input to every qt package somehow. Can the
build system do that? Considering that Wayland seems to be the
future, I feel that Qt GUI applications should support it by
default. I mean, wayland is in the closure of qtbase anyway.
3. Both? Why is '= used anyway?

How should this be done?
Attachment: file
R
R
Raghav Gururajan wrote on 4 Oct 2020 12:46
EGL-Wayland
(address . 43446@debbugs.gnu.org)
9d8684c688ff378de36e92ffa67c5cf6@disroot.org
Hello Brendan!

I think you are missing 'egl-wayland'.

Not sure if, Qt packages or Qt apps or both, requires rebuilding with egl-wayland as input.

Regards,
RG.
B
B
Brendan Tildesley wrote on 4 Oct 2020 13:23
[PATCH] guix: qt-build-system: Fix search-path wrapping.
(address . 43446@debbugs.gnu.org)
9e55f119-b476-cefe-c5b2-33c96d60015c@brendan.scot
From 9c1d5b76c70ebf9942f6bb891677d260fe16cb62 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Sun, 4 Oct 2020 21:58:08 +1100
Subject: [PATCH] guix: qt-build-system: Fix search-path wrapping.

* guix/build/qt-build-system.scm: (variables-for-wrapping): Modify
qt-build-system's wrap-all-programs phase to prefix all wrapped
search-path variables instead of overwriting them with =. This allows Qt
applications to find plugins available in the environment.
---
guix/build/qt-build-system.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm
index 005157b0a4..93f512b5d6 100644
--- a/guix/build/qt-build-system.scm
+++ b/guix/build/qt-build-system.scm
@@ -60,7 +60,7 @@
    (lambda (var-to-wrap) (not (null? (last var-to-wrap))))
    (map
     (lambda (var-spec)
-      `(,(first var-spec) = ,(collect-sub-dirs base-directories (last var-spec))))
+      `(,(first var-spec) prefix ,(collect-sub-dirs base-directories (last var-spec))))
     (list
      ;; these shall match the search-path-specification for Qt and KDE
      ;; libraries
-- 
2.28.0
R
R
Ricardo Wurmus wrote on 4 Oct 2020 14:43
Re: bug#43446: Qt Apps cant make use of qtwayland due to QT_PLUGIN_PATH '= wrapping
(name . Brendan Tildesley)(address . mail@brendan.scot)(address . 43446@debbugs.gnu.org)
87mu1217s3.fsf@elephly.net
Brendan Tildesley <mail@brendan.scot> writes:

Toggle quote (15 lines)
> qt-build-system wraps variables such as QT_PLUGIN_PATH with '=
> instead of prefix, so when qtwayland is installed in a profile or
> included in the environment, the application fails to see it. Programs
> run with export QT_QPA_PLATFORM=wayland-egl will fail to launch.
>
> We could:
>
> 1. Use 'prefix so that the parent environment's variables are appended
> and users have to manually install qtwayland them selves.
> 2. Include qtwayland as an input to every qt package somehow. Can the
> build system do that? Considering that Wayland seems to be the
> future, I feel that Qt GUI applications should support it by
> default. I mean, wayland is in the closure of qtbase anyway.
> 3. Both? Why is '= used anyway?

I can’t say why the Qt build system does this, but in other cases we
know that 'prefix causes problems because the application may end up
loading incompatible binaries leading to a crash. That’s especially the
case on foreign distros, e.g. when the Guix-installed graphical
application loads a plugin from the system’s XDG_* directories.

--
Ricardo
B
B
Brendan Tildesley wrote on 5 Oct 2020 08:39
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 43446@debbugs.gnu.org)
400a2e9e-4d0a-75b5-8288-0e07d515c139@brendan.scot
On 4/10/20 10:43 pm, Ricardo Wurmus wrote:
Toggle quote (22 lines)
> Brendan Tildesley <mail@brendan.scot> writes:
>
>> qt-build-system wraps variables such as QT_PLUGIN_PATH with '=
>> instead of prefix, so when qtwayland is installed in a profile or
>> included in the environment, the application fails to see it. Programs
>> run with export QT_QPA_PLATFORM=wayland-egl will fail to launch.
>>
>> We could:
>>
>> 1. Use 'prefix so that the parent environment's variables are appended
>> and users have to manually install qtwayland them selves.
>> 2. Include qtwayland as an input to every qt package somehow. Can the
>> build system do that? Considering that Wayland seems to be the
>> future, I feel that Qt GUI applications should support it by
>> default. I mean, wayland is in the closure of qtbase anyway.
>> 3. Both? Why is '= used anyway?
> I can’t say why the Qt build system does this, but in other cases we
> know that 'prefix causes problems because the application may end up
> loading incompatible binaries leading to a crash. That’s especially the
> case on foreign distros, e.g. when the Guix-installed graphical
> application loads a plugin from the system’s XDG_* directories.
>
Thanks for pointing that out. But, currently a Guix Qt program is unable
to see plugins available in the environment/profile even if the variable
is set because the wrapper just deletes that in its local environment.
It can only see what's in it's inputs. How else can that be fixed?

cat `which nheko`|grep QT;

export
QT_PLUGIN_PATH="/gnu/store/swqnld90m4gmmc1qaf4lg1psvf6q0rr0-qttools-5.14.2/lib/qt5/plugins:/gnu/store/j0b10r3djln34avx4qxh1kxzg70fn04r-qtbase-5.14.2/lib/qt5/plugins:/gnu/store/lh2yq7dlw3cfaf613h787drpy6f146n3-qtdeclarative-5.14.2/lib/qt5/plugins:/gnu/store/cz6lfbphrdqvgrbhgdq0hd7a50015i5h-qtmultimedia-5.14.2/lib/qt5/plugins:/gnu/store/r4h7w3zw02nc33bi7bjlqbl9b8kilh9r-qtsvg-5.14.2/lib/qt5/plugins"
H
H
Hartmut Goebel wrote on 11 Jan 2021 17:08
Re: [PATCH] guix: qt-build-system: Wrapped executables honor user's envvars.
(address . 43446-close@debbugs.gnu.org)
4450fa4e-50d2-f28b-c8fa-9325cae7852d@crazy-compilers.com
?
Your comment

This issue is archived.

To comment on this conversation send email to 43446@debbugs.gnu.org