Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#40583 - [qtcreator] [qt5-base] QtCreator with Qt 5.3.0-3 does not show output of the qDebug() function.

Attached to Project: Arch Linux
Opened by Alex (nylocx) - Wednesday, 28 May 2014, 12:45 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 20:26 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Andrea Scarpino (BaSh)
Sven-Hendrik Haase (Svenstaro)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 18
Private No

Details

Description:
Qt Creator 3.1.1-1 with current Qt 5.3.0-3 does not show output of the qDebug() function.

hunger in the #qtcreator IRC channel could confirm this behaivor and that it is fixed by using his self build Qt from current git stable branch.


As a simple test this code can be used:

#include <QApplication>
#include <QTimer>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
qDebug("Test 1,2,3");
QTimer::singleShot(1000, Qt::CoarseTimer, qApp, SLOT(quit()));
return a.exec();
}


----------------------------- OUTPUT -------------------------------

Starting /home/alex/projects/DebugTest-Qt_5-Debug/DebugTest...
/home/alex/projects/DebugTest-Qt_5-Debug/DebugTest exited with code 0

This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Saturday, 16 August 2014, 20:26 GMT
Reason for closing:  Fixed
Comment by Balázs Béla (balazsbela) - Saturday, 31 May 2014, 10:36 GMT
Seeing the same. When I switch to a kit containing the Qt 5.3 release downloaded from qt-project.org, qDebugs work again. qDebug-s don't appear in qtcreator's Application Output tab, but if we run the app from terminal, they work.
Comment by Andrea Scarpino (BaSh) - Saturday, 31 May 2014, 15:26 GMT
Could you be a bit more precise? Qt stable branch contains several commits since 5.3.0
Comment by Caroline A. (Caray28) - Tuesday, 03 June 2014, 07:59 GMT
Same here. No qDebug() (nor QWarning(), QCritical(), QFatal()) output in QtCreator application output tab since last update of qt5-base (5.2.1-4 -> 5.3.0-3)
QtCreator 3.1.1
Comment by Szymon M. Sabat (smsware) - Wednesday, 04 June 2014, 02:47 GMT
I need to mention that Qt Creator, after Qt 5.3 update, was still set to look for 5.2 kit. I thought that changing it manually would help as the same error (lack of QDebug()) happens when you set different version of Qt than you have installed (tested on Windows).
Comment by Alex (nylocx) - Wednesday, 04 June 2014, 14:21 GMT
Ok rebuilding the packages from ABS doesn't solve the problem I still have no output of qDebug in QtCreator.
Also changing the name (it was just the name that was wrong) in the kit settings of qtCreator did not solve anything.

While writing I just downloaded the binary builds from the qt project (http://download.qt-project.org/official_releases/qt/5.3/5.3.0/qt-opensource-linux-x64-5.3.0.run).
And it works fine with the qtCreator from stock arch repository!
So maybe its a GCC 4.9 problem?

I'm currently recompiling qt creator with gcc 4.9 to see if it makes any difference.

(Update)
No change with a rebuild of qtcreator.
Comment by Сковорода Никита (ChALkeR) - Saturday, 07 June 2014, 16:27 GMT
I observe the same behaviour.

Work-arounds:
1) In project settings, toggle the «run in terminal» checkbox. Each application would run in a terminal that shows the debug output. Not very pretty, but it works.
2) Just launch manually from terminal.
Comment by Alex (nylocx) - Saturday, 07 June 2014, 20:13 GMT
3) Download binary version from qt-project
wget http://download.qt-project.org/official_releases/qt/5.3/5.3.0/qt-opensource-linux-x64-5.3.0.run
chmod +x qt-opensource-linux-x64-5.3.0.run
./qt-opensource-linux-x64-5.3.0.run
Install qt
Add new Qt version in QtCreator and apply
Add new Kit in QtCreator using the new 5.3 version.
... Wait for a fix for this Problem ;)
Comment by Caroline A. (Caray28) - Sunday, 08 June 2014, 19:37 GMT
Alex, I followed your instructions but I still have no qDebug() output. Did I miss something ?

Thanks for your help, ChAlkeR also !
Comment by Alex (nylocx) - Tuesday, 10 June 2014, 06:33 GMT
Hi Caroline,
It's really strange I tested this on 5 different arch installs and it works everywhere. Are you sure you build your application with the new Kit? Maybe you could remove your shadowbuild directory or even your pro.user file and start over with the new Kit?
Comment by Caroline A. (Caray28) - Tuesday, 10 June 2014, 07:50 GMT
Oh, thanks a lot Alex ! Deleting the pro.user file did the trick ! :D
The qDebug() output is back now :)
Comment by mlpo (mlpo) - Wednesday, 25 June 2014, 01:30 GMT
Same problem here. Deleting the pro.user doesn't change anything…

QtCreator 3.1.1
qt5-base 5.3.0-3
Comment by Caroline A. (Caray28) - Wednesday, 25 June 2014, 19:35 GMT
After you followed Alex instructions, you may try to create a new project (specifying the use of the new kit of course) and then import your files, it may help ...
Comment by Andrea Scarpino (BaSh) - Wednesday, 25 June 2014, 21:27 GMT
qt5-base 5.3.1-1 is out, so this should be definitely fixed.
Comment by mlpo (mlpo) - Thursday, 26 June 2014, 03:49 GMT
Yes, it works using QtCreator with a new kit. Now wait for a fix :)
Comment by Alex (nylocx) - Thursday, 26 June 2014, 07:21 GMT
Andrea,
it should but it is not! Still the same with qtcreator 3.1.1-1 and qt5-base 5.3.1-1.
So it is somehow a combination of an arch compiled creator with an arch compiled qt5 version. If I have some spare time I will try the precompiled Qt Creator from qt-project.org and test it with the arch Qt builds to see if that makes any difference.

Edit:
I just checked with downloaded Qt Creator 3.1.2 form qt-project.org and I get no Debug output either so it definitley has something to do with the arch build environment as the build process is quiet straight forward I have absolutly no idea where this bug comes from.
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 26 June 2014, 23:53 GMT
I confirm it to still be broken.
Comment by Alex (nylocx) - Monday, 30 June 2014, 09:15 GMT
peppe fom #qt-labs helped me to figure that one out. It's a 'bug' in QtCreator that comes to light if Qt was configured with the journald flag as it is in the arch repository. So until there is an upstream fix for that there are a few possible workarounds.

1. Start Qt Creator from the command line with: QT_LOGGING_TO_CONSOLE=1 qtcreator
2. Export QT_LOGGING_TO_CONSOLE=1 to your environment (.bashrc/.zshrc/etc.)
3. Edit the qtcreator.desktop file to set the QT_LOGGING_TO_CONSOLE variable (This could be done by the maintainer of qtcreator in the arch repo so everyone will benefit)
4. Remove the journald line from the qt configure and recompile using abs and makepkg
5. Keep using the "old" workarounds e

I will add a request on the Qt bug tracker to set the QT_LOGGING_TO_CONSOLE variable internally by Qt Creator until than I hope everybody hit by this will find this bugreport, or the maintainer of Qt Creator will integrate the fix :P

Edit:
The upstream bug is https://bugreports.qt-project.org/browse/QTCREATORBUG-12564
Comment by Alex (nylocx) - Tuesday, 01 July 2014, 11:24 GMT
The upstream bug just got closed because the journald flag should only be used on embedded platforms not in desktop linux distributions. So I guess its up to the arch maintainers of Qt/QtCreator to make a decision how to handle this.
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 02 July 2014, 01:06 GMT
Well, I don't quite understand upstream reasoning here but we might want to follow. Andrea, what do you think?
Comment by Andrea Scarpino (BaSh) - Wednesday, 02 July 2014, 09:18 GMT
Sven please see the discussion in the upstream bug report.
I'd like if we keep logs in the journal; IMHO upstream is failing in providing reasons to avoid that.
Comment by Francois van der Ven (francoisvdv) - Friday, 25 July 2014, 19:48 GMT
Besides no output in Application Output, this bug somehow also prevents me from starting/debugging QML applications from within QtCreator! Using workaround 1 by Alex fixes this. :)
Comment by Andrea Scarpino (BaSh) - Saturday, 26 July 2014, 09:32 GMT
Sven,
do you think we can set "QT_LOGGING_TO_CONSOLE" in a wrapper script for Qt Creator binary or maybe just setting it in its .desktop file?

From what I understood upstream suggests to disable journald from Qt build, but that's because Qt Creator doesn't yet recognize if journald is enabled or not. I also understood that they will implement this in Qt Creator next release (maybe major one). What do you think?
Comment by Сковорода Никита (ChALkeR) - Saturday, 26 July 2014, 09:39 GMT
.desktop-based fix is a bad idea.

In KDE, try calling krunner (Alt-F2), type «qtcreator».
The first alternative (default action) is to just launch /usr/bin/qtcreator, qtcreator.desktop is on the second place.
Comment by bo wen shi (sbwtw) - Thursday, 31 July 2014, 08:12 GMT
Alex,
i try your step 1, 2, 3 but qDebug() still not work.
but, if i running in terminal it works.

im using qt creator 3.1.2 based on qt 5.3.1 gcc 4.9.0 64bit.
Comment by Alex (nylocx) - Thursday, 31 July 2014, 08:33 GMT
Sorry, no idea why this should not work. QT_LOGGING_TO_CONSOLE should definitely work. I have tested it many times now. Maybe you have a typo in your commands?
Comment by bo wen shi (sbwtw) - Thursday, 31 July 2014, 09:12 GMT
thanks Alex, i resolve this problem.
im using xfce4-terminal but in qtcreator - option - enviroment - system terminal is /usr/bin/xterm -e
i change it to /usr/bin xfce4-terminal -x
then, add QT_LOGGING_TO_CONSOLE=1
its work perfect now :)
Comment by Peter (protake) - Friday, 15 August 2014, 15:33 GMT
Will this ever be fixed? It's a really annoying error I just spent an hour on finding a solution until I landed here...
Adding "QT_LOGGING_TO_CONSOLE=1" to /etc/enviroment solved it for me.
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 14:53 GMT
Please test rel -2 for me guys.
Comment by Alex (nylocx) - Saturday, 16 August 2014, 16:36 GMT
Version from testing works for me.
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 16:58 GMT
It shouldn't, it's broken. I just noticed. Pushing new version now. Testing version can't even launch.
Comment by Alex (nylocx) - Saturday, 16 August 2014, 20:08 GMT
Sorry was my fault had a local install which was in path before system qtcreator.
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 20:13 GMT
Well, does the new extra version work or not?
Comment by Evgeny Grablyk (age) - Saturday, 16 August 2014, 20:24 GMT
extra/qtcreator 3.1.2-3 works for me -- I can see qDebug() output in the application output pane. Thank you.
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 20:26 GMT
Cool, closing.

Loading...