Bug 502777

Summary: Amarok build doesn't fail without mysqld library
Product: [Applications] amarok Reporter: Christophe Marin <christophe>
Component: generalAssignee: Amarok Bugs <amarok-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: tuomas
Priority: NOR    
Version First Reported In: 3.2.81   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: database error report

Description Christophe Marin 2025-04-14 08:08:43 UTC
Created attachment 180246 [details]
database error report

That's something I noticed in our unstable amarok package tracking git master, and the issue is still present in 3.3 beta:

# rpm -qv qt6-sql-mysql 
qt6-sql-mysql-6.9.0-151.1.x86_64

# mariadb --version
mariadb from 11.7.2-MariaDB, client 15.2 for Linux (x86_64) using  EditLine wrapper

# amarok --version
amarok 3.2.81
QThreadStorage: entry 9 destroyed before end of thread 0x55749ee005d0
QThreadStorage: entry 4 destroyed before end of thread 0x55749ee005d0
QThreadStorage: entry 3 destroyed before end of thread 0x55749ee005d0

# rm ~/.config/amarokrc                    
# rm ~/.cache/amarok -r
# rm ~/.local/share/amarok -r

On startup, amarok reports a database error, see screenshot
Comment 1 Christophe Marin 2025-04-14 08:10:45 UTC
# rpm -ql amarok |grep mysql   
/usr/lib64/qt6/plugins/amarok_collection-mysqlcollection.so
/usr/lib64/qt6/plugins/amarok_storage-mysqlserverstorage.so

It seems amarok is unable to find its mysql plugin:

# amarok --debug
amarok: BEGIN: void App::continueInit()
amarok:   BEGIN: virtual int App::newInstance()
amarok:     BEGIN: void App::handleCliArgs(const QString&)
amarok:     END__: void App::handleCliArgs(const QString&) [Took: 0s]
amarok:   END__: virtual int App::newInstance() [Took: 0s]
amarok:   BEGIN: EngineController::EngineController()
amarok:   END__: EngineController::EngineController() [Took: 0s]
amarok:   BEGIN: void EngineController::initializePhonon()
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)
amarok:     BEGIN: void EqualizerController::initialize(const Phonon::Path&)
amarok:       [EqualizerController] Established Phonon equalizer effect with 11 parameters.
amarok:       BEGIN: void EqualizerController::eqUpdate()
amarok:       END__: void EqualizerController::eqUpdate() [Took: 0s]
amarok:     END__: void EqualizerController::initialize(const Phonon::Path&) [Took: 0s]
WARNING: Phonon::createPath: Cannot connect  Phonon::MediaObject ( no objectName ) to  Phonon::AudioDataOutput ( no objectName ).
amarok:     [EngineController] Tick Interval (actual):  100
amarok:   END__: void EngineController::initializePhonon() [Took: 0.013s]
amarok:   BEGIN: CollectionManager::CollectionManager()
amarok:   END__: CollectionManager::CollectionManager() [Took: 0s]
amarok:   BEGIN: MainWindow::MainWindow()
amarok:     BEGIN: Plugins::PluginManager::PluginManager(QObject*)
amarok:       BEGIN: void Plugins::PluginManager::checkPluginEnabledStates()
amarok:         [PluginManager] found plugin: "amarok_collection-audiocdcollection" enabled: true
amarok:         [PluginManager] found plugin: "amarok_collection-daapcollection" enabled: false
amarok:         [PluginManager] found plugin: "amarok_collection-ipodcollection" enabled: true
amarok:         [PluginManager] found plugin: "amarok_collection-mtpcollection" enabled: true
amarok:         [PluginManager] Plugin "amarok_collection-mysqlcollection" is vital
amarok:         [PluginManager] found plugin: "amarok_collection-mysqlcollection" enabled: true
amarok:         [PluginManager] found plugin: "amarok_collection-playdarcollection" enabled: false
amarok:         [PluginManager] found plugin: "amarok_collection-umscollection" enabled: true
amarok:         [PluginManager] found plugin: "amarok_importer-amarok" enabled: true
amarok:         [PluginManager] found plugin: "amarok_importer-banshee" enabled: true
amarok:         [PluginManager] found plugin: "amarok_importer-clementine" enabled: true
amarok:         [PluginManager] found plugin: "amarok_importer-fastforward" enabled: true
amarok:         [PluginManager] found plugin: "amarok_importer-itunes" enabled: true
amarok:         [PluginManager] found plugin: "amarok_importer-rhythmbox" enabled: true
amarok:         [PluginManager] found plugin: "amarok_service_ampache" enabled: false
amarok:         [PluginManager] found plugin: "amarok_service_magnatunestore" enabled: false
amarok:         [PluginManager] found plugin: "amarok_service_opmldirectory" enabled: true
amarok:         [PluginManager] Plugin "amarok_storage-mysqlserverstorage" is vital
amarok:         [PluginManager] found plugin: "amarok_storage-mysqlserverstorage" enabled: true
amarok:         [PluginManager] 17 plugins in total
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-audiocdcollection"
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-daapcollection"
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-ipodcollection"
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-mtpcollection"
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-mysqlcollection"
amarok:         [PluginManager] Plugin "amarok_collection-mysqlcollection" is vital
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-playdarcollection"
amarok:         BEGIN: Collections::PlaydarCollectionFactory::PlaydarCollectionFactory()
amarok:         END__: Collections::PlaydarCollectionFactory::PlaydarCollectionFactory() [Took: 0s]
amarok:         [PluginManager] Creating factory for plugin: "amarok_collection-umscollection"
amarok:         [PluginManager] Creating factory for plugin: "amarok_importer-amarok"
amarok:         [PluginManager] Creating factory for plugin: "amarok_importer-banshee"
amarok:         [PluginManager] Creating factory for plugin: "amarok_importer-clementine"
amarok:         [PluginManager] Creating factory for plugin: "amarok_importer-fastforward"
amarok:         [PluginManager] Creating factory for plugin: "amarok_importer-itunes"
amarok:         [PluginManager] Creating factory for plugin: "amarok_importer-rhythmbox"
amarok:         [PluginManager] Creating factory for plugin: "amarok_service_ampache"
amarok:         [PluginManager] Creating factory for plugin: "amarok_service_magnatunestore"
amarok:         [PluginManager] Creating factory for plugin: "amarok_service_opmldirectory"
amarok:         [PluginManager] Creating factory for plugin: "amarok_storage-mysqlserverstorage"
amarok:         [PluginManager] Plugin "amarok_storage-mysqlserverstorage" is vital
Comment 2 Christophe Marin 2025-04-15 08:04:20 UTC
The root cause is amarok's FindMySQLe.cmake and how it's used.

The application is (still) unable to work correctly if the libmysqld library isn't present at build time, but the build system doesn't stop the build
Comment 3 Tuomas Nurmi 2025-04-15 17:01:40 UTC
Thank you for the report and pinpointing the issue! I'll try to have a look at the related CMake parts at some point.
Comment 4 Tuomas Nurmi 2025-06-29 20:23:46 UTC
Git commit f3da0003bbf9ecd88b9c2793b1796fd64a65fa88 by Tuomas Nurmi.
Committed on 29/06/2025 at 20:22.
Pushed by nurmi into branch 'master'.

Hard require embedded database by default

It is possible to build and successfully use Amarok with external database only,
but that is probably very rare usecase. Anyhow, I added a -DWITHOUT_EMBEDDED_DB
CMake path to still achieve this if one really knows what they're doing.

M  +6    -4    CMakeLists.txt
M  +1    -0    ChangeLog

https://invent.kde.org/multimedia/amarok/-/commit/f3da0003bbf9ecd88b9c2793b1796fd64a65fa88