Skip to content

Enable Parquet support in pyopenms wheels build - #8422

Merged
timosachsenberg merged 7 commits into
developfrom
pyopenms_parquet
Dec 6, 2025
Merged

timosachsenberg merged 7 commits into
developfrom
pyopenms_parquet

Conversation

@poshul

@poshul poshul commented Dec 3, 2025 •

Copy link
Copy Markdown
Collaborator

Description

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

  • New Features

    • Enabled Parquet support across all platforms in CI builds.
    • Added an option to prefer static Arrow/Parquet libraries.
  • Chores

    • Improved dependency selection/resolution for Arrow/Parquet.
    • Expanded runtime library search paths to include lib64.
    • Pinned container and CI tooling targets (explicit amd64 container and concrete Qt version).

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

@coderabbitai

coderabbitai Bot commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR pins the devcontainer image to an explicit amd64 tag, enables Parquet builds across CI platforms, adds an ARROW_USE_STATIC CMake option, detects/selects Arrow/Parquet static vs shared targets, replaces hardcoded Arrow/Parquet targets with variables, and adds lib64 to PyOpenMS library lookup paths.

Changes

Cohort / File(s) Summary
Dev container
\.devcontainer/devcontainer.json
Changed image from ghcr.io/openms/contrib_manylinux_2_34:latest-${localArch} to ghcr.io/openms/contrib_manylinux_2_34:latest-amd64.
CI workflow
\.github/workflows/pyopenms-wheels\.yml
Enabled WITH_PARQUET: "ON" across build matrix and pinned Windows Qt installer to 6.8.3 with arch: win64_msvc2022_64.
CMake option
cmake/build_system_macros.cmake
Added ARROW_USE_STATIC option (default ON) to choose static Arrow/Parquet usage.
CMake find logic
cmake/cmake_findExternalLibs.cmake
When WITH_PARQUET is on, added logic to prioritize/select ${OPENMS_ARROW_TARGET} and ${OPENMS_PARQUET_TARGET} based on availability and ARROW_USE_STATIC, and emit status messages; errors if no suitable target found.
Build linkage updates
src/openms/CMakeLists.txt, src/tests/class_tests/openms/CMakeLists.txt
Replaced hardcoded Arrow::arrow_shared / Parquet::parquet_shared references with ${OPENMS_ARROW_TARGET} and ${OPENMS_PARQUET_TARGET} in private libraries and test linkages.
PyOpenMS post-build
src/pyOpenMS/CMakeLists.txt
Added ${OPENMS_CONTRIB_LIBS}/lib64 to LOOKUP_DIRS used by prepare_pyopenms_libs to find dependency libraries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check cmake_findExternalLibs.cmake selection logic for all combinations of available targets (static/shared) and ARROW_USE_STATIC to avoid missing-target errors.
  • Verify OPENMS_ARROW_TARGET / OPENMS_PARQUET_TARGET are defined before use in src/openms/CMakeLists.txt and test CMake files.
  • Confirm CI matrix changes and Qt pinning do not conflict with existing Windows runner expectations.
  • Ensure adding lib64 doesn't cause duplicate/conflicting library discovery on platforms using lib only.

Possibly related PRs

Poem

🐰
Hopping through CMake with delight,
I choose static or shared by night,
CI wakes to Parquet's cheer,
lib64 scouts far and near,
amd64 container — hold me tight! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the PR, which is to enable Parquet support in the pyOpenMS wheels build process.
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
  • Commit unit tests in branch pyopenms_parquet

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65aefca and a6a0cfa.

📒 Files selected for processing (2)
  • cmake/build_system_macros.cmake (1 hunks)
  • cmake/cmake_findExternalLibs.cmake (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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:

  • cmake/cmake_findExternalLibs.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
  • GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
  • GitHub Check: build-and-test (ubuntu-22.04-arm, g++, 11)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: cppcheck-test
🔇 Additional comments (2)
cmake/build_system_macros.cmake (1)

13-16: Static-linking toggle for Arrow/Parquet is consistent with Boost pattern

Defining ARROW_USE_STATIC alongside BOOST_USE_STATIC is clean and keeps all global “prefer static” options centralized. This gives you the requested knob to switch between static and shared Arrow/Parquet without complicating callers. Based on learnings, this keeps external dependency configuration explicit and discoverable.

cmake/cmake_findExternalLibs.cmake (1)

170-197: Arrow/Parquet static-vs-shared selection is correctly implemented

The target selection logic for OPENMS_ARROW_TARGET / OPENMS_PARQUET_TARGET is sound:

  • With both variants present, ARROW_USE_STATIC cleanly decides between static vs. shared.
  • If only one variant exists, you gracefully fall back to it regardless of preference.
  • A hard error when neither target is present is appropriate for a REQUIRED dependency.
  • The status messages make diagnosing configuration issues easier and provide clear visibility into which external variant is actually used.

The imported target names (Arrow::arrow_static, Arrow::arrow_shared, Parquet::parquet_static, Parquet::parquet_shared) match the official CMake exports from Apache Arrow and Parquet packages, so the logic will correctly resolve the targets.

One optional consideration for future maintenance:

Reduce duplication (optional)
The Arrow/Parquet blocks are nearly identical. A small helper macro like select_lib_variant(<out-var> <static-target> <shared-target> <prefer-static-boolean>) would remove repetition and make future extensions less error-prone.


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.

@poshul
poshul marked this pull request as ready for review December 5, 2025 10:55

@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: 0

🧹 Nitpick comments (3)
.devcontainer/devcontainer.json (1)

3-3: Pinning devcontainer image to amd64 is reasonable

Switching to ghcr.io/openms/contrib_manylinux_2_34:latest-amd64 aligns the devcontainer with the manylinux image used in CI and makes builds more reproducible. The only trade‑off is that non‑amd64 hosts will need emulation, which is acceptable if CI parity is the priority.

cmake/cmake_findExternalLibs.cmake (1)

165-185: Arrow/Parquet target indirection is solid; consider whether “prefer static” should be platform‑specific

The new OPENMS_ARROW_TARGET / OPENMS_PARQUET_TARGET selection logic cleanly abstracts away whether Arrow/Parquet were built as static or shared libraries by preferring *_static imported targets when present and otherwise falling back to *_shared. This fits well with how the rest of the PR consumes these variables.

One thing to double‑check is whether preferring static when both static and shared targets exist is desired on all platforms (e.g. for manylinux wheels vs. system installs), or whether you’d rather keep shared on Linux/macOS and reserve static primarily for Windows/contrib scenarios.

src/openms/CMakeLists.txt (1)

61-76: Consider using semicolon for clarity in generator expression list

The current syntax uses a space to separate the two targets in the generator expression:

$<$<BOOL:${WITH_PARQUET}>:${OPENMS_ARROW_TARGET} ${OPENMS_PARQUET_TARGET}>

While this functions correctly—CMake's target_link_libraries() accepts both space-separated and semicolon-separated lists—using a semicolon is more explicit and conventional for CMake lists:

 set(OPENMS_DEP_PRIVATE_LIBRARIES
   $<$<BOOL:${WITH_HDF5}>:HDF5::HDF5>
-  $<$<BOOL:${WITH_PARQUET}>:${OPENMS_ARROW_TARGET} ${OPENMS_PARQUET_TARGET}>
+  $<$<BOOL:${WITH_PARQUET}>:${OPENMS_ARROW_TARGET};${OPENMS_PARQUET_TARGET}>
   ${LPTARGET}

This change improves readability and aligns with CMake conventions for list syntax within generator expressions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e92c1b and 65aefca.

📒 Files selected for processing (6)
  • .devcontainer/devcontainer.json (1 hunks)
  • .github/workflows/pyopenms-wheels.yml (6 hunks)
  • cmake/cmake_findExternalLibs.cmake (1 hunks)
  • src/openms/CMakeLists.txt (1 hunks)
  • src/pyOpenMS/CMakeLists.txt (1 hunks)
  • src/tests/class_tests/openms/CMakeLists.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📚 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:

  • cmake/cmake_findExternalLibs.cmake
  • src/openms/CMakeLists.txt
  • src/pyOpenMS/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/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/CMakeLists.txt
📚 Learning: 2025-09-03T12:58:20.032Z
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.

Applied to files:

  • src/pyOpenMS/CMakeLists.txt
  • src/tests/class_tests/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/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality

Applied to files:

  • src/tests/class_tests/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/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`

Applied to files:

  • src/tests/class_tests/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/tests/class_tests/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 OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/tests/class_tests/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/tests/class_tests/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/tests/class_tests/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} : Be mindful of memory usage when processing large datasets

Applied to files:

  • src/tests/class_tests/openms/CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
  • GitHub Check: build-win
🔇 Additional comments (4)
src/pyOpenMS/CMakeLists.txt (1)

366-369: Including ${OPENMS_CONTRIB_LIBS}/lib64 in LOOKUP_DIRS is correct

Extending LOOKUP_DIRS with ${OPENMS_CONTRIB_LIBS}/lib64 ensures dependencies built into a lib64 tree are picked up during pyopenms_copy_deps.cmake, and the \; escaping keeps the whole list as a single -DLOOKUP_DIRS=... argument. This looks correct and consistent with the existing pattern.

.github/workflows/pyopenms-wheels.yml (2)

49-55: Qt pinning on Windows improves reproducibility; verify version/arch availability

Using jurplel/install-qt-action@v4 with version: '6.8.3' and arch: 'win64_msvc2022_64' should give you a stable, deterministic Qt setup matching the VS 2022 toolchain. Please just confirm that this exact version/arch combo is available in the Qt online repos used by the action on windows-latest, otherwise the step will start failing.


169-169: Enabling WITH_PARQUET in all wheel build jobs is consistent with CMake configuration

Adding WITH_PARQUET: "ON" to the Windows, macOS (arm/intel), manylinux, and manylinux‑arm jobs keeps CI in sync with the new Parquet/Arrow CMake wiring so that every wheel variant is built with Parquet support. As a follow‑up, it would be good to spot‑check at least one wheel per platform (auditwheel show / otool -L / ldd on _pyopenms*.so) to ensure Arrow/Parquet DSOs are bundled or statically linked as intended and that imports don’t fail on a clean machine.

Also applies to: 320-320, 481-481, 606-606, 734-734

src/tests/class_tests/openms/CMakeLists.txt (1)

75-83: Tests correctly track Arrow/Parquet target selection

Linking Arrow_test and QuantmsIO_test against ${OPENMS_ARROW_TARGET} and ${OPENMS_PARQUET_TARGET} keeps the tests in lock‑step with whatever Arrow/Parquet variant (static vs shared) CMake discovered for the main library. This should avoid mismatches across platforms or contrib/system installs.


# Determine if Arrow was built as static or shared and set appropriate targets
if(TARGET Arrow::arrow_static)
set(OPENMS_ARROW_TARGET Arrow::arrow_static)

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.

We definitely need a way to make it accept shared libs if both are present! I think I'd prefer the same logic that we use for Boost with
BOOST_USE_STATIC

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.

Is this a blocker?

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.

No but it's also just three lines. Or one line for copilot.

@timosachsenberg

Copy link
Copy Markdown
Contributor

@copilot We definitely need a way to make it accept shared libs if both are present! I think I'd prefer the same logic that we use for Boost with
BOOST_USE_STATIC

Copilot AI commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

@timosachsenberg I've opened a new pull request, #8434, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Add ARROW_USE_STATIC option to control Arrow/Parquet static vs shared library preference

Co-authored-by: timosachsenberg <[email protected]>

* Move ARROW_USE_STATIC option to build_system_macros.cmake for consistency with BOOST_USE_STATIC

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[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.

4 participants