mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.52k stars 1.28k forks source link

Building with qdebug=0 fails #8999

Closed mixxxbot closed 2 years ago

mixxxbot commented 2 years ago

Reported by: gerion-entrup Date: 2017-12-11T13:29:42Z Status: Fix Released Importance: Low Launchpad Issue: lp1737546 Attachments: mixxx.build.log


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.

mixxxbot commented 2 years ago

Commented by: gerion-entrup Date: 2017-12-11T13:29:42Z Attachments: mixxx.build.log

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2017-12-11T16:47:35Z


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

mixxxbot commented 2 years ago

Commented by: gerion-entrup Date: 2017-12-13T19:21:25Z


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.

mixxxbot commented 2 years ago

Commented by: gerion-entrup Date: 2017-12-13T19:54:25Z


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 to be used as:
qDebug() << "foobar";
so the while loop and therefore the whole line is optimized out.

See https://github.com/qt/qtbase/blob/5.10/src/corelib/global/qlogging.h#L168

mixxxbot commented 2 years ago

Commented by: gerion-entrup Date: 2017-12-13T20:15:50Z


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).

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2017-12-13T20:25:28Z


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 ;)
mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2017-12-13T20:33:59Z


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.

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2017-12-13T20:38:50Z


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

mixxxbot commented 2 years ago

Commented by: daschuer Date: 2017-12-13T20:54:33Z


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

mixxxbot commented 2 years ago

Commented by: uklotzde Date: 2018-08-18T18:20:07Z


https://github.com/mixxxdj/mixxx/pull/1786

mixxxbot commented 2 years ago

Issue closed with status Fix Released.