Bug 485677

Summary: qt-4.5-rc1: qhostaddress.h qpair-related issue
Product: [Fedora] Fedora Reporter: Eric Tanguy <eric.tanguy>
Component: qtAssignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: kevin, leigh123linux, rdieter, than
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-27 19:31:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
workaround undefined QPair none

Description Eric Tanguy 2009-02-16 07:42:32 UTC
Description of problem:
a package build fine for F-10 : http://koji.fedoraproject.org/koji/taskinfo?taskID=1128601 and the same package fail for rawhide : http://koji.fedoraproject.org/koji/taskinfo?taskID=1128665 
It could be due to the recent introduction of qt-4.5-rc1 in rawhide ?

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 leigh scott 2009-02-21 15:20:02 UTC
I am also having trouble building qbittorrent since the change to qt 4.5

https://bugs.launchpad.net/qbittorrent/+bug/332470

upstream seems to think it's a qt bug

Comment 2 Kevin Kofler 2009-02-22 00:25:36 UTC
That is a completely separate issue. It should be in a separate bug report.

But I don't think your issue is a bug in Qt. Something must be "#define"ing "subnet" as a macro, which is a bad thing to do.

Comment 3 Rex Dieter 2009-02-22 17:30:19 UTC
It's these 2 lines in qhostaddress.h (lines 122, 124):

    bool isInSubnet(const QPair<QHostAddress, int> &subnet) const;

    static QPair<QHostAddress, int> parseSubnet(const QString &subnet);

The problem seems to be the <QHostAddress, int> contructs by the looks of things.

A quick-n-dirty hack of commenting out those lines in qhostaddress.h allows qbittorrent to compile.


On the surface, those lines look wrong to me... a (sort of) recursive template?  but I'm far from being a master of c++-fu.

Comment 4 Rex Dieter 2009-02-22 17:38:13 UTC
Heh, looks like QPair is undefined, adding
#include <QPair>
to /usr/include/QtNetwork/qhostaddress.h
does the trick.

Comment 5 Rex Dieter 2009-02-22 17:39:58 UTC
Leigh, looks like adding to httpserver.cpp:
#include <QPair>
would be a workaround until we can get this fixed in qt properly.

Comment 6 Kevin Kofler 2009-02-22 17:45:13 UTC
This report was originally about the scidavis failure before the qbittorrent maintainer hijacked it for his completely different bug!

Comment 7 Kevin Kofler 2009-02-22 17:52:01 UTC
I just cloned this bug as bug 486866 for the original issue.

But next time please:
* do not hijack bug reports for unrelated issues!
* do not answer such hijackers (other than mentioning it's off topic as I did in comment #2)!
* clone the bug if you want to track it (but the reporter should be responsible for filing their own bug report)! (And I probably should have done that when I posted my comment #2.)
and especially:
* don't change the topic of the existing bug report to match the hijack!

Comment 8 Rex Dieter 2009-02-22 18:15:23 UTC
sorry, comment #1 didn't mention which app was at issue (for posterity:  reporter, please do so ; commenters (including me), please double-check, and make summary clear).

Comment 9 Rex Dieter 2009-02-22 19:46:14 UTC
Created attachment 332872 [details]
workaround undefined QPair

Comment 10 leigh scott 2009-02-22 23:12:09 UTC
(In reply to comment #6)
> This report was originally about the scidavis failure before the qbittorrent
> maintainer hijacked it for his completely different bug!



(In reply to comment #6)
> This report was originally about the scidavis failure before the qbittorrent
> maintainer hijacked it for his completely different bug!


Sorry if I hijacked it for a completely different bug, but I didn't know as both koji links are broken, and were when I posted.

The bug summary matched my problem so I posted it here.

Comment 11 leigh scott 2009-02-23 00:01:28 UTC
(In reply to comment #9)
> Created an attachment (id=332872) [details]
> workaround undefined QPair


> Heh, looks like QPair is undefined, adding
>#include <QPair>
>to /usr/include/QtNetwork/qhostaddress.h
>does the trick


Thanks Rex, this works a treat.

>Leigh, looks like adding to httpserver.cpp:
>#include <QPair>
>would be a workaround until we can get this fixed in qt properly.

This didn't work, I still got the same error.

Comment 12 Kevin Kofler 2009-02-23 00:04:29 UTC
Did you add it BEFORE the #include which drags in qhostaddress.h? The order matters.

Comment 13 leigh scott 2009-02-23 08:48:17 UTC
(In reply to comment #12)
> Did you add it BEFORE the #include which drags in qhostaddress.h? The order
> matters.

Yes I think so


--- qbittorrent-1.3.1/src/httpserver.cpp.orig 
+++ qbittorrent-1.3.1/src/httpserver.cpp 
@@ -18,7 +18,7 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-
+#include <QPair>
 #include "httpserver.h"
 #include "httpconnection.h"
 #include "eventmanager.h"

Comment 14 leigh scott 2009-02-23 10:08:57 UTC
Well I got there :) , I was patching the wrong file.


--- qbittorrent-1.3.1/src/httpserver.h.orig 
+++ qbittorrent-1.3.1/src/httpserver.h 
@@ -22,6 +22,7 @@
 #ifndef HTTPSERVER_H
 #define HTTPSERVER_H
 
+#include <QPair>
 #include <QTcpServer>
 #include <QByteArray>

Comment 15 leigh scott 2009-02-23 11:21:24 UTC
Well I finally got it to build @ Koji

http://koji.fedoraproject.org/koji/buildinfo?buildID=83808

I find it strange that I had to add a new build requires (glib2-devel)

Comment 16 Rex Dieter 2009-02-27 19:31:25 UTC
Should be fixed in qt-4.5.0-0.4.rc1 and newer