Bug 243950

Summary: kdenetwork 4.4.5 fails to build
Product: [Applications] kget Reporter: angel.tsankov
Component: torrentAssignee: KGet authors <kget>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Build log (out-of-source)

Description angel.tsankov 2010-07-08 15:21:08 UTC
Version:           unspecified
OS:                Linux

Source files in kdenetwork 4.4.5 cannot find header files from the same package:

[  9%] Building CXX object kget/transfer-plugins/bittorrent/CMakeFiles/kcm_kget_bittorrentfactory.dir/btsettingswidget.o
/etc/pupm/home/kdenetwork/tmp.qVV/kdenetwork-4.4.5/kget/transfer-plugins/bittorrent/btsettingswidget.cpp:12:25: error: kget_export.h: No such file or directory
/etc/pupm/home/kdenetwork/tmp.qVV/kdenetwork-4.4.5/kget/transfer-plugins/bittorrent/btsettingswidget.cpp:20: error: expected constructor, destructor, or type conversion before 'BTSettingsWidget'
make[2]: *** [kget/transfer-plugins/bittorrent/CMakeFiles/kcm_kget_bittorrentfactory.dir/btsettingswidget.o] Error 1
make[1]: *** [kget/transfer-plugins/bittorrent/CMakeFiles/kcm_kget_bittorrentfactory.dir/all] Error 2
make: *** [all] Error 2

kget_export.h in located in /etc/pupm/home/kdenetwork/tmp.qVV/kdenetwork-4.4.5/kget/

Reproducible: Always




Happens with GCC 4.4.4.
Comment 1 Lukas Appelhans 2010-07-10 18:18:09 UTC
Mmh... can't reproduce this with gcc 4.5... Did you have any special configuration?

Lukas
Comment 2 angel.tsankov 2010-07-12 09:22:30 UTC
Created attachment 48791 [details]
Build log (out-of-source)
Comment 3 angel.tsankov 2010-07-12 09:23:39 UTC
(In reply to comment #1)
> Mmh... can't reproduce this with gcc 4.5... Did you have any special
> configuration?

Well, I simply run:

wget ftp://ftp.kde.org/pub/kde/stable/4.4.5/src/kdenetwork-4.4.5.tar.bz2 &&
tar -xf kdenetwork-4.4.5.tar.bz2 &&
cd kdenetwork-4.4.5 &&
cmake -DCMAKE_INSTALL_PREFIX=/usr &&
make &&
make install

When I try an out-of-source build, I get the same result.  I have attached the complete build log of an out-of-source build (in kdenetwork-4.4.5/build).
Comment 4 angel.tsankov 2010-07-12 12:51:24 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Mmh... can't reproduce this with gcc 4.5... Did you have any special
> > configuration?
> 
> Well, I simply run:
> 
> wget ftp://ftp.kde.org/pub/kde/stable/4.4.5/src/kdenetwork-4.4.5.tar.bz2 &&
> tar -xf kdenetwork-4.4.5.tar.bz2 &&
> cd kdenetwork-4.4.5 &&
> cmake -DCMAKE_INSTALL_PREFIX=/usr &&
> make &&
> make install
> 
> When I try an out-of-source build, I get the same result.  I have attached the
> complete build log of an out-of-source build (in kdenetwork-4.4.5/build).

Here's the relevant part of the build log from "make VERBOSE=1' (run in /etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/build):

[ 12%] Building CXX object kget/transfer-plugins/bittorrent/CMakeFiles/kcm_kget_bittorrentfactory.dir/btsettingswidget.o
cd /etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/build/kget/transfer-plugins/bittorrent && /usr/bin/c++   -DMAKE_KCM_KGET_BITTORRENTFACTORY_LIB -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -DKDE_DEFAULT_DEBUG_AREA=5001 -DHAVE_NEPOMUK -DHAVE_QGPGME -DENABLE_EMBEDDED_TORRENT_SUPPORT -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden -fexceptions -UQT_NO_EXCEPTIONS -O2 -g -DNDEBUG -DQT_NO_DEBUG -fPIC -I/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/build/kget/transfer-plugins/bittorrent -I/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/kget/transfer-plugins/bittorrent -I/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5 -I/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/build -I/usr/include/KDE -I/opt/qt/qt/include/QtXmlPatterns -I/opt/qt/qt/include/QtXml -I/opt/qt/qt/include/QtWebKit -I/opt/qt/qt/include/QtUiTools -I/opt/qt/qt/include/QtTest -I/opt/qt/qt/include/QtSvg -I/opt/qt/qt/include/QtSql -I/opt/qt/qt/include/QtScriptTools -I/opt/qt/qt/include/QtScript -I/opt/qt/qt/include/QtOpenGL -I/opt/qt/qt/include/QtNetwork -I/opt/qt/qt/include/QtMultimedia -I/opt/qt/qt/include/QtHelp -I/opt/qt/qt/include/QtDesigner -I/opt/qt/qt/include/QtDBus -I/opt/qt/qt/include/QtAssistant -I/opt/qt/qt/include/Qt3Support -I/opt/qt/qt/include/QtGui -I/opt/qt/qt/include/QtCore -I/opt/qt/qt/include/Qt -I/opt/qt/qt/mkspecs/default -I/opt/qt/qt/include   -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o CMakeFiles/kcm_kget_bittorrentfactory.dir/btsettingswidget.o -c /etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/kget/transfer-plugins/bittorrent/btsettingswidget.cpp
/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/kget/transfer-plugins/bittorrent/btsettingswidget.cpp:12:25: error: kget_export.h: No such file or directory
/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/kget/transfer-plugins/bittorrent/btsettingswidget.cpp:20: error: expected constructor, destructor, or type conversion before 'BTSettingsWidget'
make[2]: *** [kget/transfer-plugins/bittorrent/CMakeFiles/kcm_kget_bittorrentfactory.dir/btsettingswidget.o] Error 1
make[2]: Leaving directory `/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/build'
make[1]: *** [kget/transfer-plugins/bittorrent/CMakeFiles/kcm_kget_bittorrentfactory.dir/all] Error 2
make[1]: Leaving directory `/etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/build'
make: *** [all] Error 2

kget_export.h is located in /etc/pupm/home/kdenetwork/tmp.9ZR/kdenetwork-4.4.5/kget but this path is not specified in any -I option to /usr/bin/c++.
Comment 5 Lukas Appelhans 2010-07-12 14:42:31 UTC
Can you try changing in btsettingswidget.cpp " #include "kget_export.h" " to " " #include <kget_export.h>" "? If it works, please tell me and I will put it into KDE SVN...

Lukas
Comment 6 angel.tsankov 2010-07-12 15:27:28 UTC
(In reply to comment #5)
> Can you try changing in btsettingswidget.cpp " #include "kget_export.h" " to "
> " #include <kget_export.h>" "? If it works, please tell me and I will put it
> into KDE SVN...

With <kget_export.h> it does not work, either.  However, it does work with "../../kget_export.h"  After this change, I found out that a lot of other changes are needed, too.  They are all related to the way files are included.  Here's a short shell script applying *some* of the needed changes:

sed 's|"\(kget_export.h\)"|"../../\1"|' -i\
  kget/transfer-plugins/bittorrent/btsettingswidget.cpp\
  kget/core/plugin/{plugin.h,transferfactory.h}\
  kget/core/transferdatasource.h
sed 's|<\(interfaces/trackerinterface.h\)>|"../libbtcore/\1"|' -i\
  kget/transfer-plugins/bittorrent/advanceddetails/trackermodel.h
sed 's|<\(btcore_export.h\)>|"../\1"|' -i\
  kget/transfer-plugins/bittorrent/libbtcore/btcore_export.h
sed 's|<\(util/constants.h\)>|"../libbtcore/\1"|' -i\
  kget/transfer-plugins/bittorrent/advanceddetails/webseedsmodel.h
sed 's|"\(core/plugin/transferfactory.h\)"|../../\1|' -i\
  kget/transfer-plugins/bittorrent/bttransferfactory.h
sed 's|"core/|"../|' -i\
  kget/core/plugin/transferfactory.h
sed 's|"core/|"|'\ -i\
  kget/core/scheduler.h
sed 's|"\(kget_export.h\)"|"../\1"|' -i\
  kget/core/{kget.h,transfergrouphandler.h}

Please note, that I have not yet run the above script and it may need some (minor) fixes; I have only tried compiling kdenetwork with the changes *implied* in the above script.

The information on the following page may be useful in tracking down this issue: http://gcc.gnu.org/onlinedocs/gcc-4.5.0/cpp/Include-Syntax.html#Include-Syntax
Comment 7 angel.tsankov 2010-07-12 15:36:23 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Can you try changing in btsettingswidget.cpp " #include "kget_export.h" " to "
> > " #include <kget_export.h>" "? If it works, please tell me and I will put it
> > into KDE SVN...
> 
> With <kget_export.h> it does not work, either.  However, it does work with
> "../../kget_export.h"  After this change, I found out that a lot of other
> changes are needed, too.  They are all related to the way files are included. 
> Here's a short shell script applying *some* of the needed changes:
> 
> sed 's|"\(kget_export.h\)"|"../../\1"|' -i\
>   kget/transfer-plugins/bittorrent/btsettingswidget.cpp\
>   kget/core/plugin/{plugin.h,transferfactory.h}\
>   kget/core/transferdatasource.h
> sed 's|<\(interfaces/trackerinterface.h\)>|"../libbtcore/\1"|' -i\
>   kget/transfer-plugins/bittorrent/advanceddetails/trackermodel.h
> sed 's|<\(btcore_export.h\)>|"../\1"|' -i\
>   kget/transfer-plugins/bittorrent/libbtcore/btcore_export.h
> sed 's|<\(util/constants.h\)>|"../libbtcore/\1"|' -i\
>   kget/transfer-plugins/bittorrent/advanceddetails/webseedsmodel.h
> sed 's|"\(core/plugin/transferfactory.h\)"|../../\1|' -i\
>   kget/transfer-plugins/bittorrent/bttransferfactory.h
> sed 's|"core/|"../|' -i\
>   kget/core/plugin/transferfactory.h
> sed 's|"core/|"|'\ -i\
>   kget/core/scheduler.h
> sed 's|"\(kget_export.h\)"|"../\1"|' -i\
>   kget/core/{kget.h,transfergrouphandler.h}
> 
> Please note, that I have not yet run the above script and it may need some
> (minor) fixes; I have only tried compiling kdenetwork with the changes
> *implied* in the above script.
> 
> The information on the following page may be useful in tracking down this
> issue:
> http://gcc.gnu.org/onlinedocs/gcc-4.5.0/cpp/Include-Syntax.html#Include-Syntax

I also checked that CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH and OBJC_INCLUDE_PATH are unset when I build kdenetwork.  These environment variables are documented here: http://gcc.gnu.org/onlinedocs/gcc-4.5.0/cpp/Environment-Variables.html#Environment-Variables.
Comment 8 Lukas Appelhans 2010-07-12 17:06:25 UTC
Well cmake should take care of them if they are needed...

I still wonder what is wrong as the CMakeLists.txt do have a:
include_directories(
    ../../
)
which is the path of kget_export.h...

Lukas
Comment 9 angel.tsankov 2010-07-12 18:13:12 UTC
(In reply to comment #8)
> Well cmake should take care of them if they are needed...
> 
> I still wonder what is wrong as the CMakeLists.txt do have a:
> include_directories(
>     ../../
> )
> which is the path of kget_export.h...

The following is an excerpt from kget/transfer-plugins/bittorrent/CMakeLists.txt:

if (GMP_FOUND AND QCA2_FOUND)
include_directories(
   ../../
   libbtcore
   ${QCA2_INCLUDE_DIR}
   ${GMP_INCLUDE_DIR}
)

Obviously, the specified paths (incl. ../../) will only be used if both GMP and QCA2 are installed.  On my system QCA2 was not installed...
Comment 10 Lukas Appelhans 2010-07-12 21:16:47 UTC
Well do you have libbtcore installed?

Btw, this error should be already fixed in 4.5 if what you describe is the cause of it... :)

Lukas
Comment 11 angel.tsankov 2010-07-12 21:41:06 UTC
(In reply to comment #10)
> Well do you have libbtcore installed?

No, I don't.
Comment 12 Lukas Appelhans 2010-07-12 22:05:37 UTC
Mmh yes, you're catching a corner-case of the CMakeLists.txt... if you install QCA2 and GMP it will work then :)

It is also already fixed in 4.5 and trunk...

Thanks for reporting anyway, I'm closing this... ok?

Lukas
Comment 13 angel.tsankov 2010-07-12 22:09:50 UTC
(In reply to comment #12)
> Mmh yes, you're catching a corner-case of the CMakeLists.txt... if you install
> QCA2 and GMP it will work then :)
> 
> It is also already fixed in 4.5 and trunk...
> 
> Thanks for reporting anyway, I'm closing this... ok?

If it is already fixed upstream, it's OK to close it.  Thanks for pointing me to CMakeLists.txt...