francescmm / GitQlient

GitQlient: Multi-platform Git client written with Qt.
https://www.francescmm.com
GNU Lesser General Public License v2.1
843 stars 84 forks source link

[BUG] QLogger.h:209:28: error: 'Recursive' is not a member of 'QMutex' #261

Closed tim77 closed 1 year ago

tim77 commented 1 year ago

Describe the bug Failed to build with Qmake since v1.6.0:

g++ -c -pipe -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DVER=\"\" -DSHA_VER=\"\" -DDEBUG -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x051200 -DQT_USE_QSTRINGBUILDER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Isrc/AuxiliarCustomWidgets -Isrc/aux_widgets -Isrc/big_widgets -Isrc/branches -Isrc/commits -Isrc/config -Isrc/diff -Isrc/git -Isrc/cache -Isrc/history -Isrc/git_server -Isrc/QLogger -Isrc/QPinnableTabWidget -Isrc/jenkins -Isrc/terminal -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o main.o src/main.cpp
In file included from src/main.cpp:7:
src/QLogger/QLogger.h:209:28: error: 'Recursive' is not a member of 'QMutex'
  209 |    QMutex mMutex { QMutex::Recursive };
      |                            ^~~~~~~~~

Desktop (please complete the following information):

Additional context Previous version compiles fine with the same build flags.

francescmm commented 1 year ago

Hey @tim77, what version of Qt do you use to generate the RPM?

tim77 commented 1 year ago

Qt-5.15.7.

francescmm commented 1 year ago

That's interesting, since I'm compiling locally and in GitHub actions with 5.15.2 and I'm not getting any issues with that.

I've checked and the code seems alright in Qt 5.15.7 too.

I think I have a Fedora install somewhere, so I might try it, but definitely worth it a double check on the version or flags that could cause that... :confused:

tim77 commented 1 year ago

Yeah, i think this could due Fedora build flags [1]. I'll try to dig it as soon as i can, but i believe you find before.

Adding to and overriding or filtering parts of these flags is permitted if there’s a good reason to do so; the rationale for doing so must be documented in the specfile.

[1]:

CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection'
band-a-prend commented 1 year ago

I have the same issue on Gentoo Linux (while packaging) when trying to build with Qt 5.15.7 and GCC 11.3.0

x86_64-pc-linux-gnu-g++ -c -march=native -O2 -pipe -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DVER=\"\" -DSHA_VER=\"\" -DDEBUG -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x051200 -DQT_USE_QSTRINGBUILDER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Isrc/AuxiliarCustomWidgets -Isrc/aux_widgets -Isrc/big_widgets -Isrc/branches -Isrc/commits -Isrc/config -Isrc/diff -Isrc/git -Isrc/cache -Isrc/history -Isrc/git_server -Isrc/QLogger -Isrc/QPinnableTabWidget -Isrc/jenkins -Isrc/terminal -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtCore -I. -I/usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o ClickableFrame.o src/AuxiliarCustomWidgets/ClickableFrame.cpp
In file included from src/main.cpp:7:
src/QLogger/QLogger.h:209:28: error: ‘Recursive’ is not a member of ‘QMutex’
  209 |    QMutex mMutex { QMutex::Recursive };
      |                            ^~~~~~~~~
make: *** [Makefile:1944: main.o] Error 1
band-a-prend commented 1 year ago

I revert part of changes of https://github.com/francescmm/GitQlient/commit/78f45be01cb65595091b9dccb51f221301791782 with

sed -i -e "s/QT_DISABLE_DEPRECATED_BEFORE=0x051200/QT_DISABLE_DEPRECATED_BEFORE=0x050900/" 
``"${MY_PN}".pro

and all seems works

band-a-prend commented 1 year ago

Does 0x051200 mean restriction of <=5.12.0 version? This macros uses hexadecimal representation and 0x051200 returns 5.18.0.

francescmm commented 1 year ago

That is correct @band-a-prend @tim77, I should use 0x050F00, but I'll revert back to 0x050900. I don't know why I cannot see it locally... :confused:

I'll create a patch version ASAP!

francescmm commented 1 year ago

This commit should cover it

tim77 commented 1 year ago

I'll try 1.6.1 version soon. There is one new issue with update and tarball is still 1.6.0: image

francescmm commented 1 year ago

Oh... I forgot to update the patch version in the files with the rush... I'll re-do the version!

band-a-prend commented 1 year ago

@francescmm I noticed that cmake support was added.
Does the cmake is prefered build system for future releases?

P.S.
I have some additional issues with dark theme and hope to create report soon (when could to create screenshots). Shortly the wizard of open new repo has light background and white text. The same issue is in the Settings of opened repo on several tabs (3rd and 4th). The issue is similar to https://github.com/francescmm/GitQlient/issues/208

francescmm commented 1 year ago

@francescmm I noticed that cmake support was added. Does the cmake is prefered build system for future releases?

For future releases it will be, but I want to be able to test it everywhere.

P.S. I have some additional issues with dark theme and hope to create report soon (when could to create screenshots). Shortly the wizard of open new repo has light background and white text. The same issue is in the Settings of opened repo on several tabs (3rd and 4th).

Please assign the issue to me as soon as it's created. I'm using dark theme in my day to day so I'm more than interested on it.

tim77 commented 1 year ago

1.6.1 built successfully for Fedora and EPEL and currently on Testing.

francescmm commented 1 year ago

I'll consider the issue fixed, then! Thanks for the build, @tim77 !