Skip to content

refactor:make-libsvm-dependency-private - #8557

Closed
Sahil-Shadwal wants to merge 1 commit into
OpenMS:developfrom
Sahil-Shadwal:refactor/make-libsvm-dependency-private
Closed

Sahil-Shadwal wants to merge 1 commit into
OpenMS:developfrom
Sahil-Shadwal:refactor/make-libsvm-dependency-private

Conversation

@Sahil-Shadwal

@Sahil-Shadwal Sahil-Shadwal commented Dec 24, 2025 •

Copy link
Copy Markdown

Description

This PR addresses issue #8547 by making the LibSVM dependency private in the CMake configuration.

Analysis: After reviewing all public headers, I found that LibSVM types are not exposed in OpenMS's public API. The only reference in public headers is a commented-out include in SimpleSVM.h. Since downstream users never interact with LibSVM types directly, it can safely be moved to private dependencies.

Changes:

  • Removed LibSVM::LibSVM from OPENMS_DEP_LIBRARIES (public dependencies)
  • Added LibSVM::LibSVM to OPENMS_DEP_PRIVATE_LIBRARIES (private dependencies)
  • Added explanatory comment following the existing pattern for Eigen3::Eigen

Note: Other dependencies like XercesC and Qt6 must remain public as their types appear in public API signatures (e.g., XMLHandler class, QObject inheritance).

Closes #8547

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.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

Advanced commands (admins / reviewer only)

Click to expand
  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

Summary by CodeRabbit

  • Chores
    • Adjusted build configuration for improved API encapsulation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

LibSVM is moved from the public dependency list to the private dependency list in the OpenMS CMakeLists.txt configuration, making LibSVM types private in the API surface instead of exposed to consuming projects.

Changes

Cohort / File(s) Summary
CMake Dependency Visibility
src/openms/CMakeLists.txt
LibSVM::LibSVM moved from OPENMS_DEP_LIBRARIES (public) to OPENMS_DEP_PRIVATE_LIBRARIES (private); privacy note comment added near private library setup

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

A library once exposed to the light,
Now tucked away, hidden from sight,
LibSVM whispers from behind the veil,
Where private dependencies tell their tale. 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: making the LibSVM dependency private in CMake configuration, which matches the code modifications shown.
Linked Issues check ✅ Passed The PR fulfills the investigation requirement from #8547 by analyzing LibSVM's public API exposure and moving it to private dependencies as appropriate.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #8547 objective of making dependencies private when their types are not exposed in public API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3a8a42 and a1b4dea.

📒 Files selected for processing (1)
  • src/openms/CMakeLists.txt
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

Use lowercase file extensions, except ML, XML, and mzData

Files:

  • src/openms/CMakeLists.txt
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Be aware of OpenMS dependencies and external libraries
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T17:04:02.774Z
Learning: Applies to **/*.{h,cpp,cxx,cc,hpp} : Add OPENMS_DLLAPI to all non-template exported classes, structs, functions, and variables; not on templates; include in friend operator declarations
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Be aware of OpenMS dependencies and external libraries

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-12-20T17:04:02.774Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T17:04:02.774Z
Learning: Applies to **/*.{h,cpp,cxx,cc,hpp} : Add OPENMS_DLLAPI to all non-template exported classes, structs, functions, and variables; not on templates; include in friend operator declarations

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use the established naming patterns for classes, methods, and variables

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use appropriate OpenMS containers and algorithms

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-12-20T17:04:02.774Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T17:04:02.774Z
Learning: Applies to src/tests/topp/CMakeLists.txt : Add TOPP tests in src/tests/topp/CMakeLists.txt

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Utilize OpenMS logging mechanisms

Applied to files:

  • src/openms/CMakeLists.txt
📚 Learning: 2025-08-14T10:19:54.371Z
Learnt from: jpfeuffer
Repo: OpenMS/OpenMS PR: 8167
File: src/topp/Digestor.cpp:200-226
Timestamp: 2025-08-14T10:19:54.371Z
Learning: In OpenMS (C++ bioinformatics framework), use boost random libraries instead of std library random distributions for cross-platform reproducible random number generation, as std library distributions are not reproducible across platforms.

Applied to files:

  • src/openms/CMakeLists.txt
🔇 Additional comments (2)
src/openms/CMakeLists.txt (2)

62-62: LGTM!

The comment clearly documents why LibSVM is a private dependency and follows the established pattern used for Eigen3::Eigen.


73-73: LGTM!

The addition of LibSVM::LibSVM to the private dependencies list is correctly implemented. Combined with its removal from the public dependencies, this properly transitions LibSVM to private linkage.

Comment thread src/openms/CMakeLists.txt
#------------------------------------------------------------------------------
# all the dependency libraries are linked into libOpenMS.so
set(OPENMS_DEP_LIBRARIES Evergreen LibSVM::LibSVM XercesC::XercesC Qt6::Core Qt6::Network)
set(OPENMS_DEP_LIBRARIES Evergreen XercesC::XercesC Qt6::Core Qt6::Network)

@coderabbitai coderabbitai Bot Dec 24, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for LibSVM usage in public OpenMS headers
# Expected: No LibSVM includes or types in public API headers (except commented-out code)

echo "=== Searching for LibSVM includes in public headers ==="
rg -n --type=cpp --type=c -g '*.h' -g '*.hpp' 'include.*[<"].*svm\.h[>"]' src/openms/include/OpenMS/

echo -e "\n=== Searching for LibSVM types (svm_model, svm_node, svm_parameter, svm_problem) in public headers ==="
rg -n --type=cpp --type=c -g '*.h' -g '*.hpp' '\bsvm_(model|node|parameter|problem)\b' src/openms/include/OpenMS/

echo -e "\n=== Checking SimpleSVM.h specifically ==="
fd -e h -e hpp SimpleSVM --exec cat {}

Repository: OpenMS/OpenMS

Length of output: 6669


LibSVM types ARE exposed in the public API; removal from public dependencies is incorrect.

The verification script reveals that svm_model is directly exposed in src/openms/include/OpenMS/FEATUREFINDER/FeatureFindingMetabo.h (line 20 forward declaration, line 308 member variable). Despite the commented-out include in SimpleSVM.h, downstream projects that use FeatureFindingMetabo.h depend on LibSVM for the svm_model type. Removing LibSVM from public dependencies while keeping it exposed in a public header creates a broken configuration where the type is declared but the library is not linked.

Either:

  1. Move FeatureFindingMetabo.h to internal headers and provide a public interface wrapper, or
  2. Keep LibSVM as a public dependency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai How about making FeatureFindingMetabo use the SimpleSVM wrapper which wraps around libsvm?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Examine SimpleSVM header to understand the wrapper interface
echo "=== SimpleSVM.h ==="
fd -e h -e hpp SimpleSVM src/openms/include --exec cat {}

echo -e "\n=== SimpleSVM.cpp implementation ==="
fd -e cpp SimpleSVM src/openms/source --exec cat {}

Length of output: 29825


🏁 Script executed:

#!/bin/bash
# Examine FeatureFindingMetabo's usage of svm_model in detail
echo "=== FeatureFindingMetabo.h content (focusing on svm_model usage) ==="
cat src/openms/include/OpenMS/FEATUREFINDER/FeatureFindingMetabo.h | grep -n -A5 -B5 'svm_model'

echo -e "\n=== FeatureFindingMetabo.cpp usage of svm_model ==="
fd -e cpp FeatureFindingMetabo src/openms/source --exec rg -n -C5 'svm_model' {}

Length of output: 773


🏁 Script executed:

#!/bin/bash
# Check how svm_model is used throughout FeatureFindingMetabo implementation
echo "=== Full search for LibSVM usage in FeatureFindingMetabo source files ==="
fd -e cpp FeatureFindingMetabo src/openms/source --exec rg -n 'svm_' {}

Length of output: 1152


@jpfeuffer That's an excellent suggestion! Using SimpleSVM as a wrapper would be the right architectural approach since it already properly encapsulates LibSVM types using the Pimpl pattern. However, SimpleSVM would need to be extended first to support FeatureFindingMetabo's use case.

Current gap:

FeatureFindingMetabo loads pre-trained SVM models from files and performs predictions:

  • svm_load_model() to load a model from disk (line 464 in FeatureFindingMetabo.cpp)
  • svm_predict() for prediction without probability estimates (line 445)
  • Manual model lifecycle management

SimpleSVM currently only supports:

  • Training new models via setup()
  • Prediction with probability estimates via predict()
  • No model serialization/deserialization from files

Required SimpleSVM enhancements:

  1. Model loading/saving API:

    void loadModel(const String& filepath);
    void saveModel(const String& filepath) const;
  2. Prediction without probabilities (or confirm existing predict() works for this use case)

  3. Model lifecycle management within SimpleSVM to handle loaded models

Recommendation:

This refactoring would properly encapsulate LibSVM and allow it to become a private dependency. Would you like me to create a GitHub issue to track this enhancement? Once SimpleSVM supports model loading, FeatureFindingMetabo could be refactored to use it, and then LibSVM can be made private.

For now, LibSVM must remain a public dependency until this refactoring is completed.


🧠 Learnings used
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Be aware of OpenMS dependencies and external libraries

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use appropriate OpenMS containers and algorithms

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T17:04:02.774Z
Learning: Applies to src/tests/topp/CMakeLists.txt : Add TOPP tests in src/tests/topp/CMakeLists.txt

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Utilize OpenMS logging mechanisms

Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.

Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Consider algorithmic complexity for data processing operations

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Be mindful of memory usage when processing large datasets

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai Yes, please create an issue for it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Create GitHub issue for SimpleSVM enhancement to support model loading/saving

gh issue create \
  --repo OpenMS/OpenMS \
  --title "Enhance SimpleSVM wrapper to support model loading and saving" \
  --body "## Context

In PR #8557, we attempted to make LibSVM a private dependency. However, \`svm_model\` is currently exposed in the public header \`FeatureFindingMetabo.h\`, which prevents LibSVM from being made private.

Discussion: https://github.com/OpenMS/OpenMS/pull/8557#discussion_r2644831521

## Proposed Solution

Refactor \`FeatureFindingMetabo\` to use the \`SimpleSVM\` wrapper instead of directly using LibSVM types. This requires enhancing \`SimpleSVM\` to support model serialization and deserialization.

## Required SimpleSVM Enhancements

Currently, \`SimpleSVM\` only supports:
- Training new models via \`setup()\`
- Prediction with probability estimates via \`predict()\`

\`FeatureFindingMetabo\` needs:
- Loading pre-trained SVM models from files
- Prediction without probability estimates (or confirmation that existing API supports this)
- Proper model lifecycle management

## Expected Outcome

Once \`SimpleSVM\` supports model loading/saving, \`FeatureFindingMetabo\` can be refactored to use it, properly encapsulating LibSVM and allowing it to become a private dependency as intended in PR #8557.

---
Requested by: @jpfeuffer
Related PR: #8557" \
  --assignee jpfeuffer

Length of output: 44


@jpfeuffer I've created issue #8558 to track the SimpleSVM enhancement: #8558

The issue outlines the required functionality (model loading/saving, prediction support) and explains how this will enable FeatureFindingMetabo to use SimpleSVM instead of directly exposing LibSVM types, ultimately allowing LibSVM to become a private dependency as intended in this PR.


🧠 Learnings used
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Be aware of OpenMS dependencies and external libraries

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use appropriate OpenMS containers and algorithms

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Utilize OpenMS logging mechanisms

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T17:04:02.774Z
Learning: Applies to src/tests/topp/CMakeLists.txt : Add TOPP tests in src/tests/topp/CMakeLists.txt

Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Consider algorithmic complexity for data processing operations

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Be mindful of memory usage when processing large datasets

Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

@timosachsenberg

Copy link
Copy Markdown
Contributor

did you build and test it?

@Sahil-Shadwal

Sahil-Shadwal commented Dec 25, 2025 •

Copy link
Copy Markdown
Author

Description

This PR addresses issue #8547 by making the LibSVM dependency private in the CMake configuration.

Analysis: After reviewing all public headers, I found that LibSVM types are not exposed in OpenMS's public API. The only reference in public headers is a commented-out include in SimpleSVM.h. Since downstream users never interact with LibSVM types directly, it can safely be moved to private dependencies.

Changes:

  • Removed LibSVM::LibSVM from OPENMS_DEP_LIBRARIES (public dependencies)
  • Added LibSVM::LibSVM to OPENMS_DEP_PRIVATE_LIBRARIES (private dependencies)
  • Added explanatory comment following the existing pattern for Eigen3::Eigen

Note: Other dependencies like XercesC and Qt6 must remain public as their types appear in public API signatures (e.g., XMLHandler class, QObject inheritance).

Closes #8547

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.)

How can I get additional information on failed tests during CI

Click to expand
If your PR is failing you can check out

Advanced commands (admins / reviewer only)

Click to expand

  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

Summary by CodeRabbit

  • Chores

    • Adjusted build configuration for improved API encapsulation.

✏️ Tip: You can customize this high-level summary in your review settings.

To be honest, I relied on static analysis (grepping for includes) and missed the forward declaration in FeatureFindingMetabo.h. I didn't perform a full local build, which would have caught the linker error.

CodeRabbit's analysis is correct. LibSVM must remain a public dependency until FeatureFindingMetabo is refactored to use SimpleSVM as discussed in issue #8558. Should i revert the changes.

@timosachsenberg

Copy link
Copy Markdown
Contributor

@Sahil-Shadwal sorry this is not acceptable. Builds and tests are mandatory before opening a PR. How should relying on static analysis even work for a language as C++?

@Sahil-Shadwal
Sahil-Shadwal deleted the refactor/make-libsvm-dependency-private branch December 28, 2025 11:11
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.

Check if some cmake dependencies could be made private

3 participants