Can't build plasma/plasma-login-manager

And now this module is failing to build, where it built fine previously:

# kde-builder running: 'ninja'
# from directory:  /home/mjq/kde/build/plasma-login-manager
# with environment:  /home/mjq/kde/build/plasma-login-manager/kde-builder.env
[0/2] Re-checking globbed directories...
[1/6] cd /home/mjq/kde/build/plasma-login-manager/src/frontend/kcm && /home/mjq/kde/usr/lib/libexec/kf6/kcmdesktopfilegenerator /home/mjq/kde/src/plasma-login-manager/src/frontend/kcm/kcm_plasmalogin.json /home/mjq/kde/build/plasma-login-manager/src/frontend/kcm/kcm_plasmalogin.desktop
[2/6] Generating ts...
[3/6] Generating mo...
[4/6] Building CXX object src/daemon/CMakeFiles/plasmalogin.dir/SocketServer.cpp.o
FAILED: [code=1] src/daemon/CMakeFiles/plasmalogin.dir/SocketServer.cpp.o 
/usr/bin/c++ -DPLASMALOGIN_VERSION=\"0.21.0\" -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/home/mjq/kde/build/plasma-login-manager/src/daemon -I/home/mjq/kde/src/plasma-login-manager/src/daemon -I/home/mjq/kde/build/plasma-login-manager/src/daemon/plasmalogin_autogen/include -I/home/mjq/kde/src/plasma-login-manager/src/common -I/home/mjq/kde/src/plasma-login-manager/src/auth -I/home/mjq/kde/build/plasma-login-manager/src/common -isystem /usr/include/qt6/QtDBus -isystem /usr/include/qt6 -isystem /usr/include/qt6/QtCore -isystem /usr/lib/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtNetwork -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /home/mjq/kde/usr/include/KF6/KConfig -isystem /home/mjq/kde/usr/include/KF6/KConfigCore -isystem /home/mjq/kde/usr/include/KF6/KConfigGui -isystem /usr/include/qt6/QtGui -pipe -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -fdiagnostics-color=always -O2 -g -DNDEBUG -std=gnu++20 -fvisibility=hidden -fvisibility-inlines-hidden -mno-direct-extern-access -MD -MT src/daemon/CMakeFiles/plasmalogin.dir/SocketServer.cpp.o -MF src/daemon/CMakeFiles/plasmalogin.dir/SocketServer.cpp.o.d -o src/daemon/CMakeFiles/plasmalogin.dir/SocketServer.cpp.o -c /home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp: In member function ‘bool PLASMALOGIN::SocketServer::start(const QString&)’:
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:53:11: error: invalid use of incomplete type ‘class QDebug’
   53 |     qDebug() << "Socket server starting...";
      |           ^
In file included from /usr/include/qt6/QtCore/qglobal.h:45,
                 from /usr/include/qt6/QtCore/qnamespace.h:12,
                 from /usr/include/qt6/QtCore/qobjectdefs.h:12,
                 from /usr/include/qt6/QtCore/qobject.h:10,
                 from /usr/include/qt6/QtCore/QObject:1,
                 from /home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.h:21,
                 from /home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:18:
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:64:18: error: invalid use of incomplete type ‘class QDebug’
   64 |         qCritical() << "Failed to start socket server.";
      |                  ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:71:11: error: invalid use of incomplete type ‘class QDebug’
   71 |     qDebug() << "Socket server started.";
      |           ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp: In member function ‘void PLASMALOGIN::SocketServer::stop()’:
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:88:11: error: invalid use of incomplete type ‘class QDebug’
   88 |     qDebug() << "Socket server stopping...";
      |           ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:95:11: error: invalid use of incomplete type ‘class QDebug’
   95 |     qDebug() << "Socket server stopped.";
      |           ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp: In member function ‘void PLASMALOGIN::SocketServer::readyRead()’:
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:130:19: error: invalid use of incomplete type ‘class QDebug’
  130 |             qDebug() << "Message received from greeter: Connect";
      |                   ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:140:19: error: invalid use of incomplete type ‘class QDebug’
  140 |             qDebug() << "Message received from greeter: Login";
      |                   ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
/home/mjq/kde/src/plasma-login-manager/src/daemon/SocketServer.cpp:152:21: error: invalid use of incomplete type ‘class QDebug’
  152 |             qWarning() << "Unknown message" << message;
      |                     ^
/usr/include/qt6/QtCore/qtypeinfo.h:15:7: note: forward declaration of ‘class QDebug’
   15 | class QDebug;
      |       ^~~~~~
ninja: build stopped: subcommand failed.

# exit code was: 256

The relevant part is:

SocketServer.cpp:53:11: error: invalid use of incomplete type ‘class QDebug’

This can be many things, but it usually translates to:

Hi you're trying to use a class that I can't find in any #include

The CI seems to be building fine, so it’s probably not an actual upstream code bug. It might be cache if it’s been a while that you haven’t built plasma-login-manager, see Basic troubleshooting | Developer

Oh my God, I really don’t know what the hell I am doing!?!?!?

I’ve deleted the entire kde directory and started again, and now I’m back at the broken third-party/wayland project that I thought was fixed! Aargh!!!

I don’t really understand why it is so difficult just to build plasma from source??

There’s some natural complexity to trying to build a project from git using the latest libraries also built from git. It can be rather overwhelming at first.

Wayland should have been fixed by the upstream MR by now, the fix was merged yesterday so it should build correctly now. In addition to the things mentioned in Can't build third-party/wayland, you can also skip building any problematic dependencies and make kde-builder just use your distribution packages for those projects.

If plasma-login-manager is the thing you are trying to build and contribute to, since the error you got seemed to be an actual source code issue, you can ask questions about the project and how to fix this on Matrix - KDE Community Wiki (unless some plasma-login developer shows up here).

1 Like

Thanks Herzenschein,

Do you know how I can tell kde-builder how to pull the code from a stable branch that is not changing, like a release branch? Just so I can read through the source and build without having to worry about any code changes being pulled in? That is, I want to run kde-builder workspace but just build the latest release version, not the development branch where things are changing.