Repository navigation
Build the documentation without Qt and the GUI - #10229
Conversation
TOPPDocumenter is the only file outside the GUI and the GUI tests that
still includes Qt, and doc/CMakeLists.txt links the doc programs against
OpenMS_GUI only when WITH_GUI=ON:
if(WITH_GUI)
target_link_libraries(${i} OpenMS OpenMS_CLI OpenMS_GUI)
else()
target_link_libraries(${i} OpenMS OpenMS_CLI)
endif()
So it compiled only because OpenMS_GUI dragged Qt's include directories
in transitively. Configuring with WITH_GUI=OFF and building the doc
target fails outright:
TOPPDocumenter.cpp:19:10: fatal error: QtCore/QString: No such file or
directory
which contradicts Qt6 being required only for WITH_GUI=ON.
<QtCore/QString> and <QtCore/QStringList> were dead includes: no QString
or QStringList appears in the file. Only qputenv() was really used, for
the three environment variables that shape the help output of the tools
being documented. Replaced by a local setEnvVar() over setenv()/
_putenv_s(), since OpenMS has no environment-variable setter of its own.
Verified with WITH_GUI=OFF: TOPPDocumenter compiles, links, and ldd
reports no Qt library.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8LG3CyhNdDXdvVzw2bmX2
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe documenter replaces Qt environment-variable handling with a local platform-specific helper. ChangesEnvironment updates
Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to The documentation builder removes its Qt dependency while preserving environment configuration, with no identified merge-blocking production impact. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit sets the paths just right Comment |
Dropping Qt let TOPPDocumenter compile with WITH_GUI=OFF, but the
documentation build still failed one step later:
Errors occurred while generating the command line documentation for TOPPAS!
Errors occurred while generating the command line documentation for TOPPView!
main() adds both GUI tools to the list unconditionally, and generate()
runs every tool in the list to capture its help output. A WITH_GUI=OFF
build never produced those executables, so doc_param_internal failed and
the doc target never reached doxygen.
doc/CMakeLists.txt already defines WITH_GUI=1 for these programs exactly
when the GUI library is available ("let the doc progs decide how to
handle a missing OpenMS_GUI library"), so guard the two entries with it.
With both changes the full doc target completes in a WITH_GUI=OFF build
("The documentation has been successfully created").
Note that Doxygen_Warning_test does not pass in such a build: the tool
pages the GUI tools would have provided are absent, so \ref TOPP_TOPPAS,
TOPP_TOPPView, TOPP_INIFileEditor, TOPP_ExecutePipeline and
TOPP_ImageCreator in doc/doxygen/public/TOPP.doxygen and TOPPAS.doxygen
do not resolve, which is a separate matter from building the programs.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8LG3CyhNdDXdvVzw2bmX2
…10241) Doxygen_Warning_test fails in every WITH_GUI=OFF build, with eleven warnings of one kind: doc/doxygen/public/TOPP.doxygen:22: warning: unable to resolve reference to 'TOPP_TOPPView' for \ref command The TOPP tool list and the TOPPAS tutorial in doc/doxygen/public refer to five pages -- TOPP_TOPPView, TOPP_TOPPAS, TOPP_INIFileEditor, TOPP_ExecutePipeline and TOPP_ImageCreator -- that the GUI tools define in their own sources under src/openms_gui/source/VISUAL/APPLICATIONS/ GUITOOLS. Only src/openms_gui/CMakeLists.txt registers that directory for the documentation, and it is not configured without the GUI. #10229 made the doc target itself complete in such a build and left this as a separate matter. Registering the directory alone is not enough. Four of those pages include the command line help (TOPP_<tool>.cli), and two of them the INI documentation (TOPP_<tool>.html), that TOPPDocumenter produces by running the tool -- and a build without the GUI has no such tool to run. With only the directory added, the eleven unresolved references turn into six of warning: included file TOPP_TOPPView.cli is not found. So the pages are now registered whether or not the GUI is built, since what they describe does not depend on building it, and the one part that does is marked @if WITH_GUI. doc/CMakeLists.txt enables that section exactly when the GUI is built, through ENABLED_SECTIONS, which was empty; the labels already in use (TOPPCLASSES, INTERNAL, HIDDENSTUFF) stay disabled. Without the GUI the pages keep their description and screenshots and lose only the section there is nothing to fill with. Claude-Session: https://claude.ai/code/session_01Q8LG3CyhNdDXdvVzw2bmX2 Co-authored-by: Claude <[email protected]>
Description
Building the documentation with
WITH_GUI=OFFfails, which contradicts 3.6's "Qt6 is required only withWITH_GUI=ON". Two independent defects indoc/doxygen/parameters/TOPPDocumenter.cpp, both of which only ever bite in a non-GUI build.1. It includes Qt
doc/CMakeLists.txtlinks the doc programs againstOpenMS_GUIonly whenWITH_GUI=ON:So the file compiled only because
OpenMS_GUIdragged Qt's include directories in transitively. Without it:Two of the three Qt includes were dead:
<QtCore/QString>QStringanywhere in the file<QtCore/QStringList>QStringListanywhere in the file<QtCore/QProcess>qputenv(), three callsThe
qputenv()calls setCOLUMNS,TERMandSTTY, which shape the help output of the tools being documented. OpenMS has no environment-variable setter of its own (SystemSettingsonly reads paths and parameters), so this adds a small file-localsetEnvVar()oversetenv()/_putenv_s()rather than inventing a public API for one call site. If a shared helper is preferred,SystemSettingswould be the natural home — happy to move it.This file is the only one outside the GUI library and the GUI tests that still included Qt.
2. It documents GUI tools that were never built
Fixing the compile just moves the failure one step later:
main()adds both GUI tools to the list unconditionally, andgenerate()runs every tool in the list to capture its help output. AWITH_GUI=OFFbuild never produced those executables, sodoc_param_internalfails and thedoctarget never reaches doxygen.doc/CMakeLists.txtalready definesWITH_GUI=1for these programs exactly when the GUI library is available — "let the doc progs decide how to handle a missing OpenMS_GUI library" — so the two entries are guarded with it.Verification
Configured with
WITH_GUI=OFF, the configuration that was broken:TOPPDocumentercompiles and links;lddreports no Qt library.DefaultParamHandlerDocumenter, which never used Qt, is unaffected.doctarget completes: "The documentation has been successfully created."What this does not fix
Doxygen_Warning_teststill does not pass in aWITH_GUI=OFFbuild, for a reason outside these two defects: with the GUI tools undocumented there are no pages for them, so\ref TOPP_TOPPView,TOPP_TOPPAS,TOPP_INIFileEditor,TOPP_ExecutePipelineandTOPP_ImageCreatorindoc/doxygen/public/TOPP.doxygenandTOPPAS.doxygendo not resolve — 11 warnings. Making the documentation itself GUI-aware is a separate change; this PR is about the programs building and running. CI builds with the GUI, where those references resolve.Found while investigating a
Doxygen_Warning_testfailure on #10228, where the fulldoctarget could not be built locally in a non-GUI configuration. Independent of that PR.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q8LG3CyhNdDXdvVzw2bmX2