Bug 352674 - SQLite version of the system not aligned with embedded in Qt when using sqlcipher
Summary: SQLite version of the system not aligned with embedded in Qt when using sqlci...
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Stephane MANKOWSKI
URL: https://bugs.mageia.org/show_bug.cgi?...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-13 20:38 UTC by Nikita Krupenko
Modified: 2015-09-18 19:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Build without sqlite3 fail output (9.13 KB, text/plain)
2015-09-17 22:13 UTC, Nikita Krupenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Krupenko 2015-09-13 20:38:58 UTC
I installed Skrooge 2.0.95 in Mageia and I see the following error:
This application can not run correctly because the SQLite version of the system (3.8.10.2) is not aligned with the SQLite version embedded in Qt (3.8.11). You should rebuild Qt with the option -system-sqlite.

I opened report in Mageia bugtracker and both Qt and Skrooge has been rebuilt, but the problem persists.
I compiled Skrooge from git and found, that when I disable SKG_CIPHER, versions not conflict.
I found, that Skrooge compared not system sqlite, but system sqlcipher with version in Qt.
The sqlite3 in system is version 3.8.11.1, sqlcipher is 3.8.10.2 and it is the latest version available in sqlcipher git. But should it be compatible with sqlite3? Or system Qt should stick to sqlite version compatible with sqlcipher? Also, with Qt 5.5 bundled sqlite 3.8.8.2, 5.6 Alpha has 3.8.10.2.

Reproducible: Always
Comment 1 Stephane MANKOWSKI 2015-09-14 09:55:29 UTC
Do you have the same issue with the official last version (2.1.1) ?
You can download it here: https://skrooge.org/download
Comment 2 Nikita Krupenko 2015-09-14 10:01:57 UTC
Yes, as I said, I compiled from git, it has tag 2.1.1.
Comment 3 Stephane MANKOWSKI 2015-09-14 16:30:21 UTC
Hi,

In fact Skrooge compares the sqlite (or sqlcipher) version with the sqlite (or sqlcipher) version of the Qt driver.

In SQLCipher mode, the Qt driver is built by Skrooge.

In you case, the SQLCipher driver built by Skrooge doesn't have the same version as SQLCipher.
This is not normal.

I think this is because, when you build Skrooge, the sqlite.h file of sqlite is found before the sqlite.h file of sqlcipher.
Are you sure you installed libsqlcipher-dev? (To be sure remove libsqlite-dev too).
Comment 4 Stephane MANKOWSKI 2015-09-17 13:28:19 UTC
Do you still have the issue when you remove libsqlite-dev and install libsqlcipher-dev?
Comment 5 Nikita Krupenko 2015-09-17 22:13:57 UTC
Created attachment 94619 [details]
Build without sqlite3 fail output

I removed lib64sqlite3-devel and now build fails. Though lib64sqlcipher-devel installed.
I see, that it cannot find sqlite3.h. It is in /usr/include/sqlcipher/ and I don't see this path in the -I build flags too. In the /usr/lib64/pkgconfig/sqlcipher.pc I see, that it has the following include flags:
includedir=/usr/include
Cflags: -I${includedir}
Seems, there is wrong include dir. I edited this file to point to /usr/include/sqlcipher and build succeeded and I have not his warning about incompatible sqlite version.
I even installed lib64sqlite3-devel back and it builds and no error message too.
So the problem is with wrong include path in sqlcipher.pc. I'll post it to Mageia bugtracker.

May be this error message should be corrected, as it does not related to Qt build options?
And should really Qt be configured with -system-sqlite?

Also from skgbasemodeler/skgdocument.cpp:
QString message = i18nc("Error message", "This application can not run correctly because the SQLite version of the system (%1) is not aligned with the SQLite version embedded in Qt (%2). You should rebuild Qt with the option -system-sqlite.", sqliteQtVersion, sqliteSystemVersion);

May be sqliteQtVersion and sqliteSystemVersion should be swapped.
Comment 6 Stephane MANKOWSKI 2015-09-18 19:08:22 UTC
Git commit b9b4e6469100d517b7722554abccf601dd439db8 by Stephane Mankowski.
Committed on 18/09/2015 at 19:07.
Pushed by smankowski into branch 'master'.

SQLite version of the system not aligned with embedded in Qt when using sqlcipher

M  +1    -0    CHANGELOG
M  +13   -7    skgbasemodeler/CMakeLists.txt
M  +4    -1    skgbasemodeler/skgdocument.cpp

http://commits.kde.org/skrooge/b9b4e6469100d517b7722554abccf601dd439db8
Comment 7 Stephane MANKOWSKI 2015-09-18 19:09:30 UTC
Hi,

I did a correction.
If this doesn't work, reopen this incident.