SUMMARY Qt installed by craft fails to find/load the mime database, if I use qt installed through the online installer it works. STEPS TO REPRODUCE 1. Set up craft and install qtbase 2. In Qt Creator create new qt widgets application 3. add QMimeDatabase db; qDebug() << db.allMimeTypes(); to main function 4. run OBSERVED RESULT QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of <internal MIME data>: Premature end of document.: () EXPECTED RESULT Mime types database is loaded and all types are printed SOFTWARE/OS VERSIONS Windows: 10 Pro Version: 20H2 OS build: 19042.630 Experience: Windows Feature Experience Pack 120.2212.31.0 Qt Version: 5.15.1 ADDITIONAL INFORMATION I have a freedesktop.org.xml and kde5.xml in C:\CraftRoot\bin\data\mime\packages. QT Creator is installed through chocolatey since craft fails to install it. ------- QT Kit ------- C++ compiler: C:\CraftRoot\mingw64\bin\g++.exe C compiler: C:\CraftRoot\mingw64\bin\gcc.exe gdb: C:\CraftRoot\mingw64\bin\gdb.exe CMake: C:\CraftRoot\dev-utils\cmake-base\bin\cmake.exe qmake:C:\CraftRoot\bin\qmake.exe Environment PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\;C:\CraftRoot\mingw64\bin QT_ASSUME_STDERR_HAS_CONSOLE=1 CMake config CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
I can confirm this bug is also affecting us in Kdenlive and breaks several core parts of the application. This issue appeared in Qt 5.15.1's Craft version build on the 5th of november. Previous builds of Qt 5.15.1 in Craft did not have this issue.
Hello, On my side my test app does find the mime database only if the exe is in CraftRoot/bin, in which there is a data/mime folder holding interesting data. From the error message, this appens if qt has been built with "mimetype_database" option, which maybe is not enabled in qt installer version (https://codereview.qt-project.org/c/qt/qtbase/+/263548/26/src/corelib/mimetypes/qmimeprovider.cpp)
I can confirm this bug as well, it's affecting KStars KNewStuff download in Windows 10. This is causing a lot of grief for our end users. I filed a bug report here: https://bugs.kde.org/show_bug.cgi?id=434033
Vincent THANK YOU! I copied the mime folder from CraftRoot/bin/data to KStars and it worked!
I find out that KStars recipe was blacklisting mime directory. I removed that and now will test again.
A possibly relevant merge request was started @ https://invent.kde.org/packaging/craft-blueprints-kde/-/merge_requests/253
Git commit 21bcc9ddec7a0f306f3de4876fd5c2513982dc0c by Hannah von Reth. Committed on 04/11/2021 at 17:31. Pushed by vonreth into branch 'master'. Fix build in mimedb A bug in the generation script dropped all \r from the compressed resource, corrupting the blob. A +11 -0 libs/qt5/qtbase/.qt-5.15.2/fixe_compressed_mime_data_win.diff M +1 -1 libs/qt5/qtbase/qtbase.py https://invent.kde.org/packaging/craft-blueprints-kde/commit/21bcc9ddec7a0f306f3de4876fd5c2513982dc0c