Bug 483652 - vcpkg build fails unless plugins are built statically
Summary: vcpkg build fails unless plugins are built statically
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: buildsystem (show other bugs)
Version: git (master)
Platform: Compiled Sources macOS
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-15 11:54 UTC by Jonathan Kimmitt
Modified: 2024-04-15 03:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kmymoney MacOS execution backtrace (125.88 KB, text/plain)
2024-03-15 11:54 UTC, Jonathan Kimmitt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Kimmitt 2024-03-15 11:54:55 UTC
Created attachment 167252 [details]
kmymoney MacOS execution backtrace

SUMMARY

NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1.  Install the manifest given in kmymoney git tree using "vcpkg install"
2.  Configure using "cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/jonathan/vcpkg/scripts/buildsystems/vcpkg.cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug"
3.  ninja
4. lldb bin/kmymoney.app/Contents/MacOS/kmymoney
5. run

OBSERVED RESULT
as per attached backtrace

EXPECTED RESULT
The main window appears

SOFTWARE/OS VERSIONS
macOS: 
Qt Version: 

ADDITIONAL INFORMATION
To compile I had to comment out certain lines that caused errors. This might be because it is expecting QT6 or some other version issue.

diff --git a/kmymoney/dialogs/kequitypriceupdatedlg.cpp b/kmymoney/dialogs/kequitypriceupdatedlg.cpp
index 6773525d2..2cb63044c 100644
--- a/kmymoney/dialogs/kequitypriceupdatedlg.cpp
+++ b/kmymoney/dialogs/kequitypriceupdatedlg.cpp
@@ -417,7 +417,7 @@ public:
         m_progressDelay.start();
 
         m_quote.setDateRange(ui->m_fromDate->date(), ui->m_toDate->date());
-        m_quote.setUseSingleQuoteSignal(true);
+       //FIXME!!        m_quote.setUseSingleQuoteSignal(true);
 
         m_abortUpdate = false;
         for (int row = 0; !m_abortUpdate && row < rows; ++row) {
diff --git a/kmymoney/plugins/xml/kcm_xmlstorage.cpp b/kmymoney/plugins/xml/kcm_xmlstorage.cpp
index a53d0a19b..50a524bbc 100644
--- a/kmymoney/plugins/xml/kcm_xmlstorage.cpp
+++ b/kmymoney/plugins/xml/kcm_xmlstorage.cpp
@@ -22,7 +22,9 @@
 // Project Includes
 
 #include "config-kmymoney.h"
+#ifdef ENABLE_GPG
 #include "kgpgfile.h"
+#endif
 #include "kmymoneysettings.h"
 
 #define RECOVER_KEY_ID      "0xD2B08440"
diff --git a/kmymoney/plugins/xml/kgpgkeyselectiondlg.cpp b/kmymoney/plugins/xml/kgpgkeyselectiondlg.cpp
index 263381a19..530ee1f5a 100644
--- a/kmymoney/plugins/xml/kgpgkeyselectiondlg.cpp
+++ b/kmymoney/plugins/xml/kgpgkeyselectiondlg.cpp
@@ -18,7 +18,9 @@
 // Project Includes
 
 #include "config-kmymoney.h"
+#ifdef ENABLE_GPG
 #include <kgpgfile.h>
+#endif
 #include <ui_kgpgkeyselectiondlg.h>
 
 class KGpgKeySelectionDlgPrivate
diff --git a/kmymoney/plugins/xml/xmlstorage.cpp b/kmymoney/plugins/xml/xmlstorage.cpp
index 492eaf9a7..b8372b5de 100644
--- a/kmymoney/plugins/xml/xmlstorage.cpp
+++ b/kmymoney/plugins/xml/xmlstorage.cpp
@@ -36,7 +36,9 @@
 
 #include "appinterface.h"
 #include "icons.h"
+#ifdef ENABLE_GPG
 #include "kgpgfile.h"
+#endif
 #include "kgpgkeyselectiondlg.h"
 #include "kmymoneyenums.h"
 #include "kmymoneysettings.h"
diff --git a/kmymoney/widgets/passstore.cpp b/kmymoney/widgets/passstore.cpp
index e60048c93..fd7c16eeb 100644
--- a/kmymoney/widgets/passstore.cpp
+++ b/kmymoney/widgets/passstore.cpp
@@ -24,7 +24,9 @@
 // Project Includes
 
 #include "icons.h"
+#ifdef ENABLE_GPG
 #include "kgpgfile.h"
+#endif
 
 using namespace Icons;
Comment 1 Thomas Baumgart 2024-03-16 08:54:52 UTC
I have no idea, why you experience this crash. Also not sure, if static linking is the way to go on MacOS. This seems to cause a lot of problems like

objc[30931]: Class KeyValueObserver is implemented in both /Users/jonathan/kmymoney/build.old/lib/libkmm_keychain.5.1.80.dylib (0x111738700) and /Users/jonathan/kmymoney/build.old/lib/libkmm_payeeidentifier.5.1.80.dylib (0x102f2c578). One of the two will be used. Which one is undefined.

The crash actually occurs when creating the first QWidget inside the Qt code. That is very strange and could be related to the way you build.

Also, I wonder why you need to comment out the inclusion of kgpgfile.h in case ENABLE_GPG is not defined. Can you explain that problem?

setUseSingleQuoteSignal() is a pretty new function. You may want to build alkimia also from the master source.
Comment 2 Jonathan Kimmitt 2024-03-16 09:11:09 UTC
build/kmymoney/misc/kmm_gpgfile_export.h seems to get created as a result of the build process. However it is needed to compile kgpgfile.h; if you don't have a successful build than you cannot bootstrap the process without commenting out the reference to kgpgfile.h. I suppose this is some dependency issue in make, however I lack sufficient familiarity with this tool.
Comment 3 Thomas Baumgart 2024-03-16 10:41:47 UTC
Git commit 276edc503931fdcbd9c6ba501900310fcc5ead83 by Thomas Baumgart.
Committed on 16/03/2024 at 10:32.
Pushed by tbaumgart into branch 'master'.

Fix building when GPG support is not available

M  +16   -18   kmymoney/misc/CMakeLists.txt
M  +2    -1    kmymoney/plugins/xml/xmlstorage.cpp

https://invent.kde.org/office/kmymoney/-/commit/276edc503931fdcbd9c6ba501900310fcc5ead83
Comment 4 Jonathan Kimmitt 2024-03-16 14:45:43 UTC
Thanks for the patch. It does not immediately seem to solve the problem of the lack of pre-existence of kmm_gpgfile_export.h. I have placed a copy from a previous build in kmymoney/mymoney/storage/kmm_gpgfile_export.h which seems to solve the problem of the App not building. As of now the file is used in the ninja build before it is generated. However in this location in prevents the new version from being generated in the build directory, which might be a bad thing. There is no recipe for encryption support in vcpkg at the moment that would provide a better solution. The overall objective of static linking for me is to reduce reliance on fragile .dynlib files such as provided in /opt/homebrew and make the Application image portable to other Macs.
Comment 5 Bug Janitor Service 2024-03-31 03:47:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2024-04-15 03:47:37 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!