Skip to content

[FIX] -write_cwl no longer aborts TOPP tools in builds without TDL - #10459

Merged
timosachsenberg merged 2 commits into
developfrom
fix/write-cwl-crash-without-tdl
Oct 9, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
fix/write-cwl-crash-without-tdl

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In a build without CWL support (ENABLE_TDL=OFF, the default and what CI/nightlies use), every TOPP tool given -write_cwl or -write_nested_cwl crashed:

$ FileMerger -write_cwl out/
terminate called after throwing an instance of 'std::runtime_error'
  what():  TDL support is not available. Rebuild with -DENABLE_TDL=ON to enable this feature.
Aborted   (exit 134; an empty out/FileMerger.cwl is left behind)

Backtrace: ParamCWLFile::writeCWLToStream → ParamCWLFile::store → TOPPBase::handleWriteCommands_ → TOPPBase::main.

Root cause

ParamCWLFile threw std::runtime_error (and std::ios::failure for unwritable files), but TOPPBase::main only catches Exception::BaseException and its subclasses. The exception reached std::terminate. The file had already been opened, so an empty .cwl was left.

Changes

  • ParamCWLFile: new static bool isSupported(). Without TDL, store() throws Exception::NotImplemented before opening the file. An unwritable target throws Exception::UnableToCreateFile instead of std::ios::failure.
  • TOPPBase: if CWL is requested but not supported, it prints "Writing CWL files is not supported by this build of OpenMS. Rebuild OpenMS with -DENABLE_TDL=ON …" and returns ILLEGAL_PARAMETERS (6). Nothing is written.
  • Tests:
    • New ParamCWLFile_test, which covers both TDL and non-TDL builds.
    • TOPP_FileMerger_write_cwl_noTDL and TOPP_FileMerger_write_nested_cwl_noTDL, registered when ENABLE_TDL is OFF. They use check_exit_code.cmake to check the exact exit code and message. A new optional ABSENT_FILE check asserts that no file is left behind.
  • CHANGELOG entry.

Verification

  • The new TOPP test fails on the unfixed binary ("Expected exit code 6, got 'Subprocess aborted'") and passes after the fix.
  • Default build: ParamCWLFile_test, both new TOPP tests, TOPPWRITECTD_FileMerger and TOPP_FileMerger_cwl_filelist pass.
  • ENABLE_TDL=ON build: ParamCWLFile_test passes, FileMerger -write_cwl writes a valid CWL file, and an unwritable directory still gives exit 5.

🤖 Generated with Claude Code

https://claude.ai/code/session_017T36hh5UMDeyMRwLiBVkbi


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • When CWL support is unavailable, requesting standard or nested CWL output now reports an error and exits without creating an empty CWL file.
    • CWL file creation failures now produce a more specific error, and unsupported CWL-writing operations report a consistent error. CWL output requires a build with TDL support; builds without it no longer leave behind empty or partial output files.

Without ENABLE_TDL (the default), ParamCWLFile threw std::runtime_error
after opening the target file. TOPPBase only catches OpenMS exceptions,
so every TOPP tool given -write_cwl or -write_nested_cwl called
std::terminate (SIGABRT) and left an empty <Tool>.cwl behind.

- ParamCWLFile: add isSupported(); throw Exception::NotImplemented
  (before opening the file) and Exception::UnableToCreateFile instead of
  std exceptions.
- TOPPBase: report missing CWL support with a clear message and
  ILLEGAL_PARAMETERS before writing anything.
- Tests: ParamCWLFile_test, and TOPP_FileMerger_write*_cwl_noTDL checking
  the exact exit code, message, and that no file is created
  (check_exit_code.cmake gains ABSENT_FILE).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017T36hh5UMDeyMRwLiBVkbi
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 5e59e8c3-a655-4fa8-846e-d6ab983ed736
📥 Commits

Reviewing files that changed from the base of the PR and between af3ef01 and ee30c2d.

📒 Files selected for processing (2)
  • CHANGELOG
  • src/tests/topp/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

ParamCWLFile now reports whether CWL writing is supported and uses OpenMS exceptions for unsupported writing and file-creation failures. TOPPBase rejects both CWL-writing options when support is unavailable. Tests cover these behaviors and check that unsupported commands do not leave an output file.

Changes

CWL writing support

Layer / File(s) Summary
ParamCWLFile support and exceptions
src/openms/include/OpenMS/FORMAT/ParamCWLFile.h, src/openms/source/FORMAT/ParamCWLFile.cpp, src/tests/class_tests/openms/source/ParamCWLFile_test.cpp, src/tests/class_tests/openms/executables.cmake, CHANGELOG
ParamCWLFile adds isSupported() and uses Exception::NotImplemented when TDL support is unavailable. File-creation failures use Exception::UnableToCreateFile. Tests cover support status, file output, stream output, and exceptions.
TOPPBase rejection and CLI checks
src/openms_cli/source/APPLICATIONS/TOPPBase.cpp, src/tests/topp/CMakeLists.txt, src/tests/topp/check_exit_code.cmake
TOPPBase returns ILLEGAL_PARAMETERS for either CWL-writing option when support is unavailable. CLI tests check the diagnostic and confirm that no CWL file is created.

Suggested reviewers: jpfeuffer

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to ee30c

Builds without TDL now report a clear error for either CWL option without creating an output file. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main fix: preventing TOPP tools from aborting when -write_cwl is used without TDL support. It also covers the related unsupported-build behavior.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 checks the CWL gate,
TDL decides the writer’s state.
No empty file is left behind,
Clear exceptions tell what’s declined.
Tests follow each supported way,
Then hop along their merry way.

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

@timosachsenberg
timosachsenberg merged commit 3f74668 into develop Oct 9, 2026
32 checks passed
@timosachsenberg
timosachsenberg deleted the fix/write-cwl-crash-without-tdl branch October 9, 2026 03:09
timosachsenberg added a commit that referenced this pull request Oct 15, 2026
Combines the entries of the open CHANGELOG pull requests #10387, #10483,
#10511, #10535, #10555 and #10580 into one change on top of develop, and
covers #10252 and #10267, whose edits develop already carries.

- OpenMS Library: PeptDeepLibraryPredictor (#10380),
  OpenSwathLibraryPreparation (#10373), BedRModFile (#10529), FLASH
  averagine/cosine fix (#10543), WebAssembly-found fixes (#10558),
  MzMLSqliteHandler array length check (#10471), Percolator data race
  (#10474). #10471 and #10543 were each proposed by two of the PRs; they
  appear once.
- TOPP tools: OpenDIA as a new tool (#10373), qualified by the review on
  #10387 (peptidoform inference needs workflow:working_format sqlite), and
  the NucleicAcidSearchEngine options of #10526, #10529-#10532, moved from
  the top of the release block into the tool's section together with the
  NucleicAcidSearchEngine bullet that sat there outside any section.
- Restore the ProteomicsLFQ -feat_dir entry (#10481, #10486) and the three
  FileInfo entries (#10497, #10498, #10499) that the merge of #10470
  dropped, and remove the second copy of the -write_cwl entry it added
  (cited #10459, tab indentation replaced by spaces).
- Build System: ONNX Runtime versioned files and symlinks (#10465).
- 3.6.0: #10255 made WITH_WNETALIGN opt-in; it did not change the ONNX
  Runtime requirement (review on #10267).


Claude-Session: https://claude.ai/code/session_01QfTdEQjN4tBfS49WcriPYu

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