Building with qdebug=0 fails

Bug #1737546 reported by Gerion Entrup
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
Unassigned

Bug Description

I'm currently trying to package Mixxx HEAD in Gentoo. Unfortunately I don't get it compiled.

The compilation fails with:
```
In file included from src/analyzer/analyzerqueue.cpp:22:0:
src/util/logger.h: In member function 'QDebug mixxx::Logger::trace() const':
src/util/logger.h:27:20: error: expected primary-expression before 'while'
         return log(qDebug());
                    ^~~~~
src/util/logger.h: In member function 'QDebug mixxx::Logger::debug() const':
src/util/logger.h:50:20: error: expected primary-expression before 'while'
         return log(qDebug());
                    ^~~~~
scons: *** [lin64_build/analyzer/analyzerqueue.o] Error 1
```

I have attached the full build log. If you need further information, please say so. If you have a patch I can try it.

I tried with GCC 5.4.0 and GCC 6.4.0. My installed QT version is 5.9.3.

Revision history for this message
Gerion Entrup (gerion-entrup) wrote :
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

No build issues with GCC 7.2.1 and Qt 5.9.1 (Fedora 27)

Revision history for this message
Gerion Entrup (gerion-entrup) wrote :

Can you show the compiler command for src/analyzer/analyzerwaveform.cpp? Maybe there is an error somewhere.

Also, I don't get the error message. In src/util/logger.h is no 'while' at all.

Revision history for this message
Gerion Entrup (gerion-entrup) wrote :
Download full text (3.3 KiB)

Got a better error message:
---------
x86_64-pc-linux-gnu-g++ -o lin64_build/analyzer/analyzerwaveform.o -c -O2 -std=c++11 -std=c++11 -pipe -Wall -Wextra -g -fPIC -pthread -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -Dx86_64 -DMIXXX_BUILD_DEBUG -D__LINUX__ -D__UNIX__ -DSETTINGS_PATH=\".mixxx/\" -DSETTINGS_FILE=\"mixxx.cfg\" -DUNIX_SHARE_PATH=\"/usr/share/mixxx\" -DUNIX_LIB_PATH=\"/usr/lib64/mixxx\" -D__PORTAUDIO__ -DQT_TABLET_SUPPORT -DQT_SHARED -DQT_DISABLE_DEPRECATED_BEFORE -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_XML_LIB -DQT_SVG_LIB -DQT_SQL_LIB -DQT_SCRIPT_LIB -DQT_NETWORK_LIB -DQT_WIDGETS_LIB -D__SNDFILE__ -DSFC_SUPPORTS_SET_COMPRESSION_LEVEL -D__MAD__ -D__HID__ -D__BULK__ -D__VINYLCONTROL__ -D__BROADCAST__ -D__OPUS__ -DQT_NO_DEBUG_OUTPUT -D__VAMP__ -Dkiss_fft_scalar=double -DHAVE_FFTW3 -D__SQLITE3__ -D__BATTERY__ -D__FFMPEGFILE__ -Ilin64_build -Isrc -I/usr/include/soundtouch -Ilib/replaygain -Ilib/libebur128-1.2.3/ebur128 -I/usr/include/qt5/Qt5DBus -I/usr/include/qt5/QtOpenGL -I/usr/include/qt5 -I/usr/include/qt5/QtXml -I/usr/include/qt5/QtSvg -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtScript -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtTest -I/usr/include/qt5/QtScriptTools -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtConcurrent -I/usr/include/qt5/QtDBus -I/usr/include/qt5/QtCore -Ilib/gtest-1.7.0/include -Ilib/fidlib-0.9.10 -I/usr/include/taglib -Ilib/qtscript-bytearray -Ilib/reverb -Ilib/portaudio -I/usr/include/hidapi -I/usr/include/libusb-1.0 -Ilib/xwax -Ilib/scratchlib -I/usr/include/opus -I/usr/include/libupower-glib -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include src/analyzer/analyzerwaveform.cpp
In file included from /usr/include/qt5/QtCore/qglobal.h:1154:0,
                 from /usr/include/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt5/QtGui/qimage.h:43,
                 from /usr/include/qt5/QtGui/QImage:1,
                 from src/analyzer/analyzerwaveform.h:4,
                 from src/analyzer/analyzerwaveform.cpp:1:
src/util/logger.h: In member function 'QDebug mixxx::Logger::trace() const':
/usr/include/qt5/QtCore/qlogging.h:164:28: error: expected primary-expression before 'while'
 #define QT_NO_QDEBUG_MACRO while (false) QMessageLogger().noDebug
                            ^
/usr/include/qt5/QtCore/qlogging.h:168:18: note: in expansion of macro 'QT_NO_QDEBUG_MACRO'
 # define qDebug QT_NO_QDEBUG_MACRO
                  ^~~~~~~~~~~~~~~~~~
src/util/logger.h:27:20: note: in expansion of macro 'qDebug'
         return log(qDebug());
                    ^~~~~~
src/util/logger.h: In member function 'QDebug mixxx::Logger::debug() const':
/usr/include/qt5/QtCore/qlogging.h:164:28: error: expected primary-expression before 'while'
 #define QT_NO_QDEBUG_MACRO while (false) QMessageLogger().noDebug
                            ^
/usr/include/qt5/QtCore/qlogging.h:168:18: note: in expansion of macro 'QT_NO_QDEBUG_MACRO'
 # define qDebug QT_NO_QDEBUG_MACRO
                  ^~~~~~~~~~~~~~~~~~
src/util/logger.h:50:20: note: in expansion of macro 'qDebug'
         return log(qDebug());
----------

It seems, that qDebug() is only meant...

Read more...

Revision history for this message
Gerion Entrup (gerion-entrup) wrote :

With
```
scons -j4 prefix=/usr qtdir=/usr/lib64/qt5 faad=1 ffmpeg=1 hid=1 hifieq=1 m4a=1 mad=1 optimize=native qdebug=1 qt5=1 shoutcast=1 vinylcontrol=1 wv=1
```
it builds as expected (qdebug=1 was the critical part, as it sets QT_NO_DEBUG_OUTPUT).

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Please compile with qdebug=1 as a workaround.

The setting qdebug=0 currently doesn't seem to work for various reasons. I just noticed this, but you were faster than me ;)

Changed in mixxx:
status: New → Confirmed
summary: - Mixxx HEAD fails to compile on Gentoo
+ Building with qdebug=0 fails
Changed in mixxx:
importance: Undecided → Low
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

We should discuss if qdebug=0 is a viable option at all. Log output can be controlled at runtime by specifying a minimum log level. Completely disabling logging at compile time is IMHO a very bad idea.

Does anyone know what the use case for qdebug=0 was? It is not documented in features.py.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Btw, thank you very much for reporting and helping to analyze this issue! Looks like no one ever tried to explicitly disable QDebug logging.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

The original use case was to remove debug output in production builds.
But it turns out that this was a "very bad idea" so we have just always enabled it.

Related:
https://bugs.launchpad.net/mixxx/+bug/1439017

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Changed in mixxx:
assignee: nobody → Uwe Klotz (uklotzde)
milestone: none → 2.2.0
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Confirmed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8999

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.