Opened 9 years ago

Last modified 6 months ago

#49296 new enhancement

kdelibs4::FindMySQL.cmake

Reported by: RJVB (René Bertin) Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: mkae (Marko Käning), cooljeanius (Eric Gallager)
Port: kdelibs4

Description

Building a new Calligra version I ran into an issue with the cmake macro for finding the MySQL libraries when one has port:mariadb installed instead of a "regular" mysql port -- and that's actually the default with port:akonadi.

I'm attaching a patch that adds support for the mysql libraries provided by MariaDB (and underlines once more that too much sandboxing/compartmentalisation has undesirable implications). The patch will require a corresponding post-patch in the kdelibs Portfile, of course:

post-patch {
    reinplace "s|%PREFIX%|${prefix}|g" \
        ${worksrcpath}/cmake/modules/FindMySQL.cmake
}

Attachments (2)

patch-cmake-modules-FindMySQL.cmake.diff (1.0 KB) - added by RJVB (René Bertin) 9 years ago.
kde4-1.1.diff (1.9 KB) - added by RJVB (René Bertin) 9 years ago.

Download all attachments as: .zip

Change History (12)

Changed 9 years ago by RJVB (René Bertin)

Changed 9 years ago by RJVB (René Bertin)

Attachment: kde4-1.1.diff added

comment:1 Changed 9 years ago by RJVB (René Bertin)

I spoke a tad too soon (Calligra takes a "while" to build); the KDE4 portgroup had to be edited too.

I'm not sure whether it should define the executables, or whether those should be left unset and resolved by the user doing a port select. The definitions seem clearly unnecessary: I don't have ${prefix}/bin/mysql_config5 nor ${prefix}/libexec/mysqld, and yet everything always worked as far as I can tell.

comment:2 Changed 9 years ago by mf2k (Frank Schima)

Cc: nicos@… removed
Owner: changed from macports-tickets@… to nicos@…

comment:3 Changed 9 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:4 Changed 9 years ago by NicosPavlov

I fully agree on the paths which are completely obsolete in the PortGroup. I removed them in r142093.

On the other hand, I am not sure about the changes in FindMySQL. First, if they are performed, they should be more general than just for the two ports included (mysql5 and mariadb). Each SQL port and its variants (such as mysql55, mysql56, mariadb55, percona56, ...) create their own subdirectories, which should be taken into account. I am also not that sure about the usefulness of that script. Akonadi, for example, is defining its own variants (as most ports using MySQL and its derivatives) and own paths anyway. I'll have to look into it a bit more to see how used it is.

comment:5 Changed 9 years ago by RJVB (René Bertin)

Evidently my patches to FindMySQL have a bit the character of an example. They show how to address the situation in a way that makes things build in my set-up and in what may or may not be the most common set-ups. I haven't even tried to check all possible alternatives that could be added. I agree it should be done, but I'm not convinced it's necessary to be exhaustive immediately (= one could wait for further reports).

Meanwhile, FindMySLQ *is* used by Calligra's cmake files. Akonadi might actually not be using libraries from the SQL port, but only the executable?

comment:6 Changed 9 years ago by NicosPavlov

Thinking more about it, I realised this would not be a suitable approach, as ports still need to specifically indicate which SQL port they are using, typically through variants. Therefore, just introducing all the paths would not fulfil that goal.

A good example of what can be done is in fact provided in the amarok port, which uses its own local patched FindMySQL script, where variants indicate which SQL port is to be used. A similar approach might be the best for Calligra too.

comment:7 Changed 9 years ago by RJVB (René Bertin)

This depends on whether it is supposed to be possible to install different sql ports.

comment:8 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:9 Changed 6 months ago by barracuda156

Is this related?

Akonadi Server Self-Test Report
===============================

Test 1:  SUCCESS
--------

Database driver found.
Details: The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration and was found on your system.

File '/Users/svacchanda/.config/akonadi/akonadiserverrc' could not be opened

Test 2:  SUCCESS
--------

Akonadi is not running as root
Details: Akonadi is not running as a root/administrator user, which is the recommended setup for a secure system.

Test 3:  ERROR
--------

MySQL server not found.
Details: You have currently configured Akonadi to use the MySQL server ''.
Make sure you have the MySQL server installed, set the correct path and ensure you have the necessary read and execution rights on the server executable. The server executable is typically called 'mysqld'; its location varies depending on the distribution.

Test 4:  ERROR
--------

Executing the MySQL server failed.
Details: Executing the MySQL server '' failed with the following error message: ''

Test 5:  SUCCESS
--------

No current MySQL error log found.
Details: The MySQL server did not report any errors during this startup. The log can be found in '/Users/svacchanda/.local/share/akonadi/db_data/mysql.err'.

Test 6:  ERROR
--------

MySQL server default configuration not found.
Details: The default configuration for the MySQL server was not found or was not readable. Check your Akonadi installation is complete and you have all required access rights.

Test 7:  SKIP
--------

MySQL server custom configuration not available.
Details: The custom configuration for the MySQL server was not found but is optional.

Test 8:  ERROR
--------

MySQL server configuration not found or not readable.
Details: The MySQL server configuration was not found or is not readable.

Test 9:  SUCCESS
--------

akonadictl found and usable
Details: The program '/opt/local/bin/akonadictl' to control the Akonadi server was found and could be executed successfully.
Result:
akonadictl(24289) malloc: *** error for object 0x820700: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fd68: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fcd0: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fd1c: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fc08: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fae0: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fa00: non-page-aligned, non-allocated pointer being freed
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81fa70: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x81f938: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x820640: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x8207c0: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x8207cc: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
akonadictl(24289) malloc: *** error for object 0x8207e8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
Akonadi 1.13.0 (revision: c733429f4)


Test 10:  ERROR
--------

Akonadi control process not registered at D-Bus.
Details: The Akonadi control process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 11:  ERROR
--------

Akonadi server process not registered at D-Bus.
Details: The Akonadi server process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 12:  SKIP
--------

Protocol version check not possible.
Details: Without a connection to the server it is not possible to check if the protocol version meets the requirements.

Test 13:  ERROR
--------

No resource agents found.
Details: No resource agents have been found, Akonadi is not usable without at least one. This usually means that no resource agents are installed or that there is a setup problem. The following paths have been searched: ''. The XDG_DATA_DIRS environment variable is set to ''; make sure this includes all paths where Akonadi agents are installed.

Directory list is empty.

Environment variable XDG_DATA_DIRS is set to ''

Test 14:  SUCCESS
--------

No current Akonadi server error log found.
Details: The Akonadi server did not report any errors during its current startup.

Test 15:  SUCCESS
--------

No previous Akonadi server error log found.
Details: The Akonadi server did not report any errors during its previous startup.

Test 16:  ERROR
--------

Current Akonadi control error log found.
Details: The Akonadi control process reported errors during its current startup. The log can be found in <a href='/Users/svacchanda/.local/share/akonadi/akonadi_control.error'>/Users/svacchanda/.local/share/akonadi/akonadi_control.error</a>.

File content of '/Users/svacchanda/.local/share/akonadi/akonadi_control.error':
ProcessControl: Application akonadiserver stopped unexpectedly ( "No such file or directory" ) 


Test 17:  ERROR
--------

Previous Akonadi control error log found.
Details: The Akonadi control process reported errors during its previous startup. The log can be found in <a href='/Users/svacchanda/.local/share/akonadi/akonadi_control.error.old'>/Users/svacchanda/.local/share/akonadi/akonadi_control.error.old</a>.

File content of '/Users/svacchanda/.local/share/akonadi/akonadi_control.error.old':
ProcessControl: Application akonadiserver stopped unexpectedly ( "No such file or directory" ) 

comment:10 Changed 6 months ago by RJVB (René Bertin)

With KDE you always need to keep an eye out for applications that were built as a bundle and installed in a place where their dependents don't know how to find them. I cannot remember if and what we did about this to port:akonadi; my copy doesn't have any patchfiles and I'm not at my Mac.

You do have a session d-bus and kded4 running, don't you?

Note: See TracTickets for help on using tickets.