Create a konsoleprivate_core static library
This new cmake target will hold classes that do not depend on other konsole classes, so we can start to untangle the source code. next: export profile as a static library
This (or one of the subsequent commits) has broken building konsole on the OBS:
/libQt5Network.so.5.15.0 /usr/lib/libQt5Widgets.so.5.15.0 /usr/lib/libQt5Gui.so.5.15.0 /usr/lib/libQt5Core.so.5.15.0 [ 291s] /usr/lib/gcc/i586-suse-linux/10/../../../../i586-suse-linux/bin/ld: /tmp/konsolepart.so.k1EWfK.ltrans4.ltrans.o: in function `Konsole::ProfileManager::deleteProfile(QExplicitlySharedDataPointer<Konsole::Profile>)': [ 291s] /home/abuild/rpmbuild/BUILD/konsole-20.11.70git.20200728T171329~74764db4/src/profile/ProfileManager.cpp:477: undefined reference to `KonsoleDebug()'
@lbeltrame that code is defined in CMake:
176:ecm_qt_declare_logging_category(konsoleprivate_SRCS HEADER konsoledebug.h IDENTIFIER KonsoleDebug CATEGORY_NAME org.kde.konsole)
and konsoleprivate_SRCS is added to the konsoleprivate library sources. Locally konsole builds for me, can you test with obs if you change this KonsoleDebug definition to konsoleprivate_core things build?
I don't change the cmake default linker flags.
Can you try setting
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions" -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions" -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions"
I'm guessing it will fail to build for you too. It is likely that the default linker flags don't catch this undefined reference.
Also, from a quick chat on IRC with @fvogt discussing this issue, it looks like there is indeed some linking problem:
[12:21] konsoleprofile only links against konsoleprivate_core, but the references are in konsoleprivate
Profile should not link against konsoleprivate, but the KonsoleDebug should be moved to konsole_core, I'm creating a patch for this.
AFAICT that would only fix
undefined reference to `KonsoleDebug()'but none of the others.
The issue is that
konsoleprivatebut does not link against it.
@fvogt that was the original one the comment from @lbeltrame, I tougth it was the only one. the issue is that konsole used to be a single library and it's a tangled mess impossible to reason about, that's why I'm starting to separate the libraries. It indeed fails to link against it currently, that's not a reason to just throw away the start of the separation and link. I'm trying again with another patch, keeping things separated.