Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 491494 - dev-qt/qtsingleapplication pulls too many dependencies on headless systems
Summary: dev-qt/qtsingleapplication pulls too many dependencies on headless systems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-17 12:10 UTC by Markos Chandras (RETIRED)
Modified: 2013-12-29 10:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (qbittorrent-3.1.2_-X_build.log,35.13 KB, text/plain)
2013-11-17 13:32 UTC, Nikoli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markos Chandras (RETIRED) gentoo-dev 2013-11-17 12:10:06 UTC
Hi,

I use net-p2p/qbittorrent USE=-X on a headless system. However, ever since this application uses system's qtsingleapplication, qtgui is pulled as part of qtsingleapplications's dependencies and this also pulls numerous useless X libraries which makes no sense on such a system.

I am not sure what's the correct path is here but this scenario does not quite fit my needs very well. Is there absolutely no way to make qtsingleapplication not use QtGui? Given it was bundled in qbittorrent and worked without QtGui I suspect there is a way to do that.
I would like to revert #487560 and make the use of system's qtsingleapplication optional until someone comes up with a better solution.
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2013-11-17 12:19:13 UTC
The other alternative is to have something like this in the src_configure in qbittorrent

    if use X; then
        myconf+=" --with-qtsingleapplication=system"
    else
        myconf+=" --disable-gui"
    fi
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2013-11-17 12:22:30 UTC
My understanding is that the qtsingleapplication has only effects in gui applications so it's correct that it pulls dev-qt/qtgui unconditionally. If that's true, then the way i have it implemented in qbittorrent is wrong and it should in fact depend on the X flag.
Comment 3 Nikoli 2013-11-17 13:00:10 UTC
May be ask upstream?
Comment 4 Markos Chandras (RETIRED) gentoo-dev 2013-11-17 13:07:09 UTC
(In reply to Nikoli from comment #3)
> May be ask upstream?

What upstream and ask them about what?
Comment 5 Nikoli 2013-11-17 13:32:15 UTC
Created attachment 363414 [details]
build.log

With X enabled qbittorrent-3.1.2 builds fine, but if it is disabled - build fails. dev-qt/qtsingleapplication-2.6.1 was installed.


> What upstream and ask them about what?

qbittorrent. Ask about building it in headless mode: does it need qtsingleapplication or not? Does it support system qtsingleapplication?
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2013-11-17 13:37:45 UTC
(In reply to Nikoli from comment #5)
> Created attachment 363414 [details]
> build.log
> 
> With X enabled qbittorrent-3.1.2 builds fine, but if it is disabled - build
> fails. dev-qt/qtsingleapplication-2.6.1 was installed.
> 
> 
> > What upstream and ask them about what?
> 
> qbittorrent. Ask about building it in headless mode: does it need
> qtsingleapplication or not? Does it support system qtsingleapplication?

Given that your build.log for USE=-X seems to suggest that qtsingleapplication is used then what's the question to ask? The problem here is not whether systems' qtsingleapplication can be used in headless mode or not but that qtsingleapplication pulls so many useless dependencies in headless mode that it make it unusable for headless systems.
Comment 7 Nikoli 2013-11-17 13:46:24 UTC
I agree that requiring qtgui for building headless daemon is wrong, but may be upstream tries to use qtsingleapplication by mistake when building with -X.
Comment 8 Davide Pesavento (RETIRED) gentoo-dev 2013-11-17 19:14:11 UTC
qtsingleapplication contains also a QtSingleCoreApplication class that has no GUI dependencies. However the consumer application must explicitly use this class instead of QtSingleApplication otherwise it's pointless... is this the case for qbittorrent[-X]?
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2013-11-17 20:17:14 UTC
Yes that is the case

hwoarang@helix /var/tmp/portage/net-p2p/qbittorrent-3.1.2/work/qbittorrent-3.1.2 $ grep -r QtSingleCoreApplication src/main.cpp 
  QtSingleCoreApplication app("qBittorrent-"+uid, argc, argv);

this part of the code is between an #ifdef DISABLE_GUI block which is used when using -X.
Comment 10 Markos Chandras (RETIRED) gentoo-dev 2013-11-22 18:26:53 UTC
Opened 

https://github.com/qbittorrent/qBittorrent/issues/1118

but the real problem on this bug remains. Since qtsingleapplication does not *always* need GUI classes, it should not pull qt-gui unconditionally.
Comment 11 Davide Pesavento (RETIRED) gentoo-dev 2013-11-22 18:33:08 UTC
(In reply to Markos Chandras from comment #10)
> Opened 
> 
> https://github.com/qbittorrent/qBittorrent/issues/1118
> 

I believe the above bug is actually invalid as a qbittorrent bug. The real issue is that we don't currently install that header file. So it's a packaging bug.

> but the real problem on this bug remains. Since qtsingleapplication does not
> *always* need GUI classes, it should not pull qt-gui unconditionally.

Agreed. In fact there are 2 different issues here:

1/ QtSingleCoreApplication is not built and its headers not installed

2/ the hard-dep on qtgui could/should actually be made optional
Comment 12 Markos Chandras (RETIRED) gentoo-dev 2013-11-22 18:47:28 UTC
(In reply to Davide Pesavento from comment #11)
> (In reply to Markos Chandras from comment #10)
> > Opened 
> > 
> > https://github.com/qbittorrent/qBittorrent/issues/1118
> > 
> 
> I believe the above bug is actually invalid as a qbittorrent bug. The real
> issue is that we don't currently install that header file. So it's a
> packaging bug.
> 
Sorry I didn't realize that we don't installed the required header.

I will close it as invalid.

> > but the real problem on this bug remains. Since qtsingleapplication does not
> > *always* need GUI classes, it should not pull qt-gui unconditionally.
> 
> Agreed. In fact there are 2 different issues here:
> 
> 1/ QtSingleCoreApplication is not built and its headers not installed
> 
> 2/ the hard-dep on qtgui could/should actually be made optional
Comment 13 Markos Chandras (RETIRED) gentoo-dev 2013-11-22 22:52:07 UTC
In the meantime i added a workaround on the ebuilds to use the bundled qtsingleapplication for -X

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-p2p/qbittorrent/qbittorrent-9999.ebuild?r1=1.11&r2=1.12
Comment 14 Davide Pesavento (RETIRED) gentoo-dev 2013-12-28 22:56:55 UTC
Fixed in qtsingleapplication-2.6.1_p20130904.

  28 Dec 2013; Davide Pesavento <pesa@gentoo.org>
  +files/2.6.1_p20130904-no-gui.patch,
  +files/2.6.1_p20130904-unbundle-qtlockedfile.patch,
  +qtsingleapplication-2.6.1_p20130904.ebuild:
  New snapshot from qt-solutions git repo wrt bug 489168. Install
  QtSingleCoreApplication header file. Implement USE="X" to solve bug 491494.


@Markos, please revert the workaround in qbittorrent and add a proper USE-dep.
Comment 15 Markos Chandras (RETIRED) gentoo-dev 2013-12-29 10:58:54 UTC
(In reply to Davide Pesavento from comment #14)
> Fixed in qtsingleapplication-2.6.1_p20130904.
> 
>   28 Dec 2013; Davide Pesavento <pesa@gentoo.org>
>   +files/2.6.1_p20130904-no-gui.patch,
>   +files/2.6.1_p20130904-unbundle-qtlockedfile.patch,
>   +qtsingleapplication-2.6.1_p20130904.ebuild:
>   New snapshot from qt-solutions git repo wrt bug 489168. Install
>   QtSingleCoreApplication header file. Implement USE="X" to solve bug 491494.
> 
> 
> @Markos, please revert the workaround in qbittorrent and add a proper
> USE-dep.

I will fix 9999 for now and remove the workaround completely on the next version bump. Thanks for fixing it.