Bug 266491 - devel/cmake-doc building issue - no Qt platform plugin could be initialized
Summary: devel/cmake-doc building issue - no Qt platform plugin could be initialized
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-19 06:40 UTC by Oclair
Modified: 2022-12-06 18:20 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oclair 2022-09-19 06:40:10 UTC
===>>> devel/cmake-doc 1/10

===>  Cleaning for cmake-doc-3.24.0
===>  License BSD3CLAUSE accepted by the user
===>   cmake-doc-3.24.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by cmake-doc-3.24.0 for building
===>  Extracting for cmake-doc-3.24.0
=> SHA256 Checksum OK for cmake-3.24.0.tar.gz.
===>  Patching for cmake-doc-3.24.0
===>   cmake-doc-3.24.0 depends on executable: sphinx-build - found
===>   cmake-doc-3.24.0 depends on file: /usr/local/bin/cmake - found
===>   cmake-doc-3.24.0 depends on executable: ninja - found
===>   cmake-doc-3.24.0 depends on file: /usr/local/lib/qt5/libQt5Help.so - found
===>  Configuring for cmake-doc-3.24.0
===>  Performing out-of-source build
/bin/mkdir -p /usr/ports/devel/cmake-doc/work/.build
-- Found Python: /usr/local/bin/python3.9 (found version "3.9.14") found components: Interpreter 
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_COMPILER
    CMAKE_CXX_FLAGS
    CMAKE_CXX_FLAGS_DEBUG
    CMAKE_CXX_FLAGS_RELEASE
    CMAKE_C_COMPILER
    CMAKE_C_FLAGS
    CMAKE_C_FLAGS_DEBUG
    CMAKE_C_FLAGS_RELEASE
    CMAKE_EXE_LINKER_FLAGS
    CMAKE_INSTALL_RPATH_USE_LINK_PATH
    CMAKE_MODULE_LINKER_FLAGS
    CMAKE_SHARED_LINKER_FLAGS
    CMAKE_VERBOSE_MAKEFILE
    THREADS_HAVE_PTHREAD_ARG


-- Build files have been written to: /usr/ports/devel/cmake-doc/work/.build
===>  Building for cmake-doc-3.24.0
[ 50% 1/2] cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b html /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Help /usr/ports/devel/cmake-doc/work/.build/html > build-html.log && /usr/local/bin/cmake -E echo "sphinx-build html: HTML documentation generated in file:///usr/ports/devel/cmake-doc/work/.build/html/index.html"
sphinx-build html: HTML documentation generated in file:///usr/ports/devel/cmake-doc/work/.build/html/index.html
[100% 2/2] cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b qthelp /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Help /usr/ports/devel/cmake-doc/work/.build/qthelp > build-qthelp.log && /usr/local/bin/cmake -DCSS_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/_static -P /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Utilities/Sphinx/apply_qthelp_css_workaround.cmake && /usr/local/bin/cmake -DQTHELP_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/ -P /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Utilities/Sphinx/fixup_qthelp_names.cmake && /usr/local/bin/python3.9 /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Utilities/Sphinx/create_identifiers.py /usr/ports/devel/cmake-doc/work/.build/qthelp/ && /usr/local/lib/qt5/bin/qhelpgenerator /usr/ports/devel/cmake-doc/work/.build/qthelp/CMake.qhcp
FAILED: doc_format_qthelp /usr/ports/devel/cmake-doc/work/.build/doc_format_qthelp 
cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b qthelp /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Help /usr/ports/devel/cmake-doc/work/.build/qthelp > build-qthelp.log && /usr/local/bin/cmake -DCSS_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/_static -P /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Utilities/Sphinx/apply_qthelp_css_workaround.cmake && /usr/local/bin/cmake -DQTHELP_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/ -P /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Utilities/Sphinx/fixup_qthelp_names.cmake && /usr/local/bin/python3.9 /usr/ports/devel/cmake-doc/work/cmake-3.24.0/Utilities/Sphinx/create_identifiers.py /usr/ports/devel/cmake-doc/work/.build/qthelp/ && /usr/local/lib/qt5/bin/qhelpgenerator /usr/ports/devel/cmake-doc/work/.build/qthelp/CMake.qhcp
qt.qpa.plugin: Could not find the Qt platform plugin "minimal" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

ninja: build stopped: subcommand failed.
*** Error code 1
Comment 1 Adriaan de Groot freebsd_committer freebsd_triage 2022-11-12 23:42:21 UTC
Can't reproduce. You are building in whatever host machine you have, so you seem to have a Qt platform plugin configured. I can't tell how to *un*configure it, in poudriere the build succeeds regardless of the value of QT_QPA_PLATFORM.
Comment 2 Oclair 2022-11-17 13:14:34 UTC
Hi, 

Thanks everyone for your contributions to FreeBSD.

The error appeared again, I bypassed it last time using pkg, but again portmaster has an issue building this "new" cmake port.

Note: Portmaster is not depreciated, has been for years one of the official suggested methods to build software on FreeBSD.  

# freebsd-version
12.3-RELEASE-p7

Have a nice day,
Jason

BEGIN--

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_COMPILER
    CMAKE_CXX_FLAGS
    CMAKE_CXX_FLAGS_DEBUG
    CMAKE_CXX_FLAGS_RELEASE
    CMAKE_C_COMPILER
    CMAKE_C_FLAGS
    CMAKE_C_FLAGS_DEBUG
    CMAKE_C_FLAGS_RELEASE
    CMAKE_EXE_LINKER_FLAGS
    CMAKE_INSTALL_RPATH_USE_LINK_PATH
    CMAKE_MODULE_LINKER_FLAGS
    CMAKE_SHARED_LINKER_FLAGS
    CMAKE_VERBOSE_MAKEFILE
    FETCHCONTENT_FULLY_DISCONNECTED
    THREADS_HAVE_PTHREAD_ARG


-- Build files have been written to: /usr/ports/devel/cmake-doc/work/.build
===>  Building for cmake-doc-3.24.3
[ 50% 1/2] cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b html /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Help /usr/ports/devel/cmake-doc/work/.build/html > build-html.log && /usr/local/bin/cmake -E echo "sphinx-build html: HTML documentation generated in file:///usr/ports/devel/cmake-doc/work/.build/html/index.html"
sphinx-build html: HTML documentation generated in file:///usr/ports/devel/cmake-doc/work/.build/html/index.html
[100% 2/2] cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b qthelp /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Help /usr/ports/devel/cmake-doc/work/.build/qthelp > build-qthelp.log && /usr/local/bin/cmake -DCSS_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/_static -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/apply_qthelp_css_workaround.cmake && /usr/local/bin/cmake -DQTHELP_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/ -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/fixup_qthelp_names.cmake && /usr/local/bin/python3.9 /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/create_identifiers.py /usr/ports/devel/cmake-doc/work/.build/qthelp/ && /usr/local/lib/qt5/bin/qhelpgenerator /usr/ports/devel/cmake-doc/work/.build/qthelp/CMake.qhcp
FAILED: doc_format_qthelp /usr/ports/devel/cmake-doc/work/.build/doc_format_qthelp 
cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b qthelp /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Help /usr/ports/devel/cmake-doc/work/.build/qthelp > build-qthelp.log && /usr/local/bin/cmake -DCSS_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/_static -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/apply_qthelp_css_workaround.cmake && /usr/local/bin/cmake -DQTHELP_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/ -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/fixup_qthelp_names.cmake && /usr/local/bin/python3.9 /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/create_identifiers.py /usr/ports/devel/cmake-doc/work/.build/qthelp/ && /usr/local/lib/qt5/bin/qhelpgenerator /usr/ports/devel/cmake-doc/work/.build/qthelp/CMake.qhcp
qt.qpa.plugin: Could not find the Qt platform plugin "minimal" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/cmake-doc

===>>> make build failed for devel/cmake-doc
===>>> Aborting update

===>>> Update for devel/cmake-doc failed
===>>> Aborting update
Comment 3 Oclair 2022-11-17 13:16:31 UTC
(In reply to Adriaan de Groot from comment #1)

/usr/ports/devel/cmake-doc # make config
===> No options to configure
Comment 4 Oclair 2022-11-17 13:19:01 UTC
This issue is not related to portmaster as it simply does not build on my machine, please feel free to reach out to track this issue.

Kind Regards,
Jason


make in the port 
BEGIN---  

/usr/ports/devel/cmake-doc # make config
===> No options to configure
root@mtl:/usr/ports/devel/cmake-doc # make 
===>  Building for cmake-doc-3.24.3
[ 50% 1/2] cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b html /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Help /usr/ports/devel/cmake-doc/work/.build/html > build-html.log && /usr/local/bin/cmake -E echo "sphinx-build html: HTML documentation generated in file:///usr/ports/devel/cmake-doc/work/.build/html/index.html"
sphinx-build html: HTML documentation generated in file:///usr/ports/devel/cmake-doc/work/.build/html/index.html
[100% 2/2] cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b qthelp /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Help /usr/ports/devel/cmake-doc/work/.build/qthelp > build-qthelp.log && /usr/local/bin/cmake -DCSS_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/_static -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/apply_qthelp_css_workaround.cmake && /usr/local/bin/cmake -DQTHELP_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/ -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/fixup_qthelp_names.cmake && /usr/local/bin/python3.9 /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/create_identifiers.py /usr/ports/devel/cmake-doc/work/.build/qthelp/ && /usr/local/lib/qt5/bin/qhelpgenerator /usr/ports/devel/cmake-doc/work/.build/qthelp/CMake.qhcp
FAILED: doc_format_qthelp /usr/ports/devel/cmake-doc/work/.build/doc_format_qthelp 
cd /usr/ports/devel/cmake-doc/work/.build && /usr/local/bin/sphinx-build -c /usr/ports/devel/cmake-doc/work/.build -d /usr/ports/devel/cmake-doc/work/.build/doctrees -b qthelp /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Help /usr/ports/devel/cmake-doc/work/.build/qthelp > build-qthelp.log && /usr/local/bin/cmake -DCSS_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/_static -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/apply_qthelp_css_workaround.cmake && /usr/local/bin/cmake -DQTHELP_DIR=/usr/ports/devel/cmake-doc/work/.build/qthelp/ -P /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/fixup_qthelp_names.cmake && /usr/local/bin/python3.9 /usr/ports/devel/cmake-doc/work/cmake-3.24.3/Utilities/Sphinx/create_identifiers.py /usr/ports/devel/cmake-doc/work/.build/qthelp/ && /usr/local/lib/qt5/bin/qhelpgenerator /usr/ports/devel/cmake-doc/work/.build/qthelp/CMake.qhcp
qt.qpa.plugin: Could not find the Qt platform plugin "minimal" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/cmake-doc
Comment 5 Oclair 2022-11-17 13:46:05 UTC
qhelpgenerator.core over here: Password TB3SswkGk6  https://hera.iolcus.net/s/EYZ3EPDKLoMfiJM


contents of work/.build/build-qthelp.log

Running Sphinx v4.5.0
loading translations [en]... done
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [qthelp]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.

You can now run "qcollectiongenerator" with the .qhcp project file in qthelp, like this:
$ qcollectiongenerator qthelp/CMake.qhcp
To view the help file:
$ assistant -collectionFile qthelp/CMake.qhc




contents of work/.build/build-html.log 

Running Sphinx v4.5.0
loading translations [en]... done
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.

The HTML pages are in html.




contents of work/.build/.ninja_log 

# ninja log v5
1       197535  0       doc_format_html d7862197f661ee63
1       197535  0       /usr/ports/devel/cmake-doc/work/.build/doc_format_html  d7862197f661ee63
2       2690    0       doc_format_html d7862197f661ee63
2       2690    0       /usr/ports/devel/cmake-doc/work/.build/doc_format_html  d7862197f661ee63
Comment 6 Adriaan de Groot freebsd_committer freebsd_triage 2022-12-06 13:51:51 UTC
This is mostly a problem with the build environment (and partly a problem with a totally different package): the error message tells you that your platform plugin is set to "minimal", and the plugin-search-path is empty. The problem is it doesn't find the plugin.

Now, an empty plugin path is not necessarily an issue: there are fallbacks. You can experiment by setting these two variables (to a platform name, and to a :-separated list of paths).

QT_QPA_PLATFORM
QT_QPA_PLATFORM_PLUGIN_PATH

As an example, setting the PLATFORM to "bogus" and the PATH to "/tmp" and then running a Qt application will get you a meaningful error message. Setting that  PATH variable explicitly to "", or leaving it unset, will get you a message that more closely resembles your problem.

Normally, the "minimal" plugin lives in /usr/local/lib/qt5/plugins/platforms/libqminimal.so -- take a look in that directory which plugins you **do** have.

As for the totally different package problem: if you built x11-toolkits/qt5-gui with the option X11=OFF, then you probably don't have a libqminimal.so (that looks like a bug in that port). Probably no platform plugins at all. This will make any kind of qt application with a GUI fail, since all of them are going to try to load *some* platform plugin.
Comment 7 Adriaan de Groot freebsd_committer freebsd_triage 2022-12-06 18:17:34 UTC
x11-toolkits/qt5-gui now installs the minimal platform plugin always (the "X11 OFF" option is a big bogus there, but that's PR #266398)
Comment 8 Adriaan de Groot freebsd_committer freebsd_triage 2022-12-06 18:20:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=934e8c6541b2c9233e2df5901d466ce8fc23e668

commit 934e8c6541b2c9233e2df5901d466ce8fc23e668
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2022-12-06 14:08:19 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2022-12-06 18:12:10 +0000

    x11-toolkits/qt5-gui: minimal plugin independent of option X11

    The "minimal" plugin is always needed (or just **one** of
    the plugins, but this will do) to allow QtGui applications
    to function. Turning off X11 turned them all off (I supposed
    "if you're not using X11, you must install the Wayland bits
    instead" would work, but that's hard to express in ports).

    So remove the plist-sub from the minimal plugin -- there is
    enough X11 pulled in regardless of the X11 option, that
    the plugin builds (and links against X11 libraries, so
    the option is a lie).

    The linked PR is not for this port, but demonstrates a problem:
    if X11 is turned off, there is no platform plugins at all,
    and then there is no way to run Qt-Gui applications (even with
    minimal / no graphics). For "command-line" Qt-Gui applications
    like qhelpgenerator, that is a problem.

    PR:             266491

 x11-toolkits/qt5-gui/Makefile  | 1 +
 x11-toolkits/qt5-gui/pkg-plist | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)