Skip to content

Build the documentation without Qt and the GUI - #10229

Merged
timosachsenberg merged 2 commits into
developfrom
claude/toppdocumenter-drop-qt
Sep 22, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
claude/toppdocumenter-drop-qt

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Building the documentation with WITH_GUI=OFF fails, which contradicts 3.6's "Qt6 is required only with WITH_GUI=ON". Two independent defects in doc/doxygen/parameters/TOPPDocumenter.cpp, both of which only ever bite in a non-GUI build.

1. It includes Qt

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 the file compiled only because OpenMS_GUI dragged Qt's include directories in transitively. Without it:

doc/doxygen/parameters/TOPPDocumenter.cpp:19:10: fatal error: QtCore/QString: No such file or directory

Two of the three Qt includes were dead:

Include Used?
<QtCore/QString> no QString anywhere in the file
<QtCore/QStringList> no QStringList anywhere in the file
<QtCore/QProcess> only for qputenv(), three calls

The qputenv() calls set COLUMNS, TERM and STTY, which shape the help output of the tools being documented. OpenMS has no environment-variable setter of its own (SystemSettings only reads paths and parameters), so this adds a small file-local setEnvVar() over setenv() / _putenv_s() rather than inventing a public API for one call site. If a shared helper is preferred, SystemSettings would 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:

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 fails and the doc target never reaches 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 the two entries are guarded with it.

Verification

Configured with WITH_GUI=OFF, the configuration that was broken:

  • TOPPDocumenter compiles and links; ldd reports no Qt library.
  • DefaultParamHandlerDocumenter, which never used Qt, is unaffected.
  • The full doc target completes: "The documentation has been successfully created."

What this does not fix

Doxygen_Warning_test still does not pass in a WITH_GUI=OFF build, 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_ExecutePipeline and TOPP_ImageCreator in doc/doxygen/public/TOPP.doxygen and TOPPAS.doxygen do 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_test failure on #10228, where the full doc target could not be built locally in a non-GUI configuration. Independent of that PR.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q8LG3CyhNdDXdvVzw2bmX2

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
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 98b3a1b9-996e-45d0-a39e-7e123a80f66c

📥 Commits

Reviewing files that changed from the base of the PR and between 158b899 and 73e8cc4.

📒 Files selected for processing (1)
  • doc/doxygen/parameters/TOPPDocumenter.cpp

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The documenter replaces Qt environment-variable handling with a local platform-specific helper. generate continues to set COLUMNS, TERM, and STTY with the same values.

Changes

Environment updates

Layer / File(s) Summary
Environment helper and usage
doc/doxygen/parameters/TOPPDocumenter.cpp
The code replaces Qt-related includes with a standard C library include. A local setEnvVar helper uses _putenv_s on Windows and setenv elsewhere. generate uses the helper for COLUMNS=110, TERM=dumb, and STTY=/bin/true.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 73e8c

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: building TOPPDocumenter documentation without Qt or the GUI.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

A rabbit sets the paths just right
With quiet shells and values bright
Qt hops away from the scene
Standard calls keep things clean
The document blooms in steady light

Comment @coderabbitai help to get the list of available commands.

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
@timosachsenberg timosachsenberg changed the title Build TOPPDocumenter without Qt Build the documentation without Qt and the GUI Sep 22, 2026
@timosachsenberg
timosachsenberg merged commit fcace84 into develop Sep 22, 2026
33 checks passed
@timosachsenberg
timosachsenberg deleted the claude/toppdocumenter-drop-qt branch September 22, 2026 08:30
timosachsenberg added a commit that referenced this pull request Sep 23, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants