Skip to content

Get WITH_PARQUET=ON working in CI - #8370

Merged
timosachsenberg merged 4 commits into
developfrom
pjones-parquet
Nov 14, 2025
Merged

timosachsenberg merged 4 commits into
developfrom
pjones-parquet

Conversation

@pjones

@pjones pjones commented Nov 14, 2025 •

Copy link
Copy Markdown
Contributor

Description

This PR enables WITH_PARQUET on all platforms and resolves issues that prevented the CI builds from finishing successfully.

The primary issue was related to the CMAKE_PREFIX_PATH environment variable getting mangled during its travels from the CI YAML file, through CTest to CMake and finally to the CMakeCache.txt file. Once I fixed that problem, several past workarounds broke, which needed to be fixed as well.

Note: I tried just removing CMAKE_PREFIX_PATH from showing up in the CMakeCache.txt file but that didn't work. Some weird interaction between CTest and CMake prevented that variable from having a semicolon-separated list of paths.

Summary by CodeRabbit

  • New Features

    • Parquet support enabled in more build/test contexts.
  • Chores

    • Streamlined CI/setup across Windows, macOS, and Linux; improved tool installation and PATH handling.
    • Added environment capture before test runs to record and propagate build-related variables.
    • Broadened propagation of build-prefix outputs to improve library discovery during builds.

@coderabbitai

coderabbitai Bot commented Nov 14, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Restructures CI workflow and Windows conda handling, adds a new environment-capture script, and removes environment-driven CMake cache population. Also adds minor macOS dependency and injects environment-capture calls before ctest runs.

Changes

Cohort / File(s) Summary
Main CI workflow
.github/workflows/openms_ci_matrix_full.yml
Renamed/reformatted steps; replace explicit conda env activation with computed CONDA_ENV_PREFIX from conda info and append its bin/Library/bin to PATH; emit cmake_prefix/CONDA_ENV_PREFIX via GITHUB_OUTPUT; update CMAKE_PREFIX_PATH; enable WITH_PARQUET=ON; add capture-env.sh invocation before ctest.
PyOpenMS wheels CI
.github/workflows/pyopenms-wheels.yml
Inserted calls to bash OpenMS/tools/ci/capture-env.sh -v $GITHUB_WORKSPACE/OpenMS/bld/CMakeCache.txt before ctest executions across OS jobs.
Environment capture script
tools/ci/capture-env.sh
New Bash utility that writes a selected set of environment variables to a target file as VAR:STRING=value; supports verbose mode and creates destination directories.
CMake CI helper
tools/ci/cibuild.cmake
Removed environment-driven cache population logic (macros and runtime population of INITIAL_CACHE, VARS_TO_LOAD, OLD_VALUES, and generation of CMakeCache.txt from ENV).
macOS deps script
tools/ci/deps-macos.sh
Added bash to Homebrew dependency list; minor comment tweak.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub Actions
    participant Job as CI Job
    participant Shell as Shell
    participant Conda as Conda
    participant Script as capture-env.sh
    participant CTest as ctest

    GH->>Job: start job
    Job->>Shell: checkout, setup build tools
    Shell->>Conda: run conda setup (Windows only)
    Conda-->>Shell: output JSON (active_prefix)
    Shell->>Shell: compute CONDA_ENV_PREFIX (normalize paths)
    Shell->>Shell: append CONDA_ENV_PREFIX/bin and /Library/bin to PATH
    Shell->>Job: set GITHUB_OUTPUT cmake_prefix, CONDA_ENV_PREFIX
    Shell->>Script: run capture-env.sh -v <CMakeCache.txt>
    Script-->>Job: write environment snapshot
    Job->>CTest: run ctest (uses updated PATH & CMAKE_PREFIX_PATH)
    CTest-->>GH: report results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing focused review:
    • .github/workflows/openms_ci_matrix_full.yml Windows logic computing CONDA_ENV_PREFIX and PATH modifications.
    • Any steps consuming cmake_prefix / CONDA_ENV_PREFIX via GITHUB_OUTPUT and updated CMAKE_PREFIX_PATH.
    • tools/ci/cibuild.cmake removal of ENV-driven cache: ensure no downstream reliance remains.
    • tools/ci/capture-env.sh: verify vars_to_cache contents and file-format expectations.

Possibly related PRs

Suggested reviewers

  • poshul
  • timosachsenberg

Poem

🐰
I hopped through PATHs and conda trees,
I gathered envs with gentle ease,
I nudged cmake prefixes to align,
Tests will run now — one carrot at a time! 🥕

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 pull request title clearly and concisely summarizes the main objective: enabling WITH_PARQUET compilation flag in CI workflows across all platforms.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pjones-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 67d046a and 10fed3f.

📒 Files selected for processing (5)
  • .github/workflows/openms_ci_matrix_full.yml (6 hunks)
  • .github/workflows/pyopenms-wheels.yml (5 hunks)
  • tools/ci/capture-env.sh (1 hunks)
  • tools/ci/cibuild.cmake (0 hunks)
  • tools/ci/deps-macos.sh (2 hunks)
💤 Files with no reviewable changes (1)
  • tools/ci/cibuild.cmake
🧰 Additional context used
🧠 Learnings (1)
📚 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:

  • .github/workflows/openms_ci_matrix_full.yml
⏰ 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). (10)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-macos-arm
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: build-and-test (macos-26, xcode, 26.0)
  • 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 (windows-2022, cl.exe, 14.36)
  • GitHub Check: cppcheck-test
🔇 Additional comments (15)
tools/ci/deps-macos.sh (1)

53-54: LGTM - Dependencies added for Parquet and environment capture support.

The addition of apache-arrow and bash aligns with the PR objectives: Apache Arrow provides Parquet support, and Bash ensures the new capture-env.sh script functions reliably on macOS runners.

tools/ci/capture-env.sh (5)

1-6: LGTM - Proper shell configuration for robustness.

Shebang and error-handling options are correctly configured to ensure the script fails fast on errors.


8-48: LGTM - Well-curated environment variable capture list.

The vars_to_cache array comprehensively covers CMake configuration, compiler settings, feature flags, and Python configuration necessary for build reproducibility. The inclusion of CMAKE_PREFIX_PATH (line 15) directly addresses the PR's core issue.


54-90: LGTM - Robust file handling and variable expansion logic.

The write_file() function correctly uses indirect variable expansion (${!var:-}) with safe defaults, creates parent directories, and writes in CMake cache format. The format VAR:STRING=value is appropriate for cache integration.


93-119: LGTM - Idiomatic Bash argument parsing with proper validation.

The main() function correctly handles options (-h, -v) and validates that exactly one target file argument is provided, with clear error messaging.


121-122: LGTM - Correct script entry point.

Properly delegates to main() with all arguments preserved.

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

141-141: LGTM - Correct integration of environment capture calls.

The capture-env.sh invocations are properly placed before ctest runs across all build matrices (Windows, macOS ARM, macOS Intel). The verbose flag and CMakeCache.txt path are appropriate for CI logging and integration.

Also applies to: 285-285, 445-445


571-571: LGTM - Consistent environment capture integration across Linux builds.

Linux x86_64 and ARM builds correctly invoke capture-env.sh with identical parameters to Windows and macOS builds, ensuring consistent environment logging across all CI platforms.

Also applies to: 698-698

.github/workflows/openms_ci_matrix_full.yml (7)

226-262: LGTM - Robust Windows conda environment setup with proper path handling.

The refactored Windows conda setup correctly extracts CONDA_ENV_PREFIX from conda info --json, normalizes path separators for cross-platform compatibility, updates PATH appropriately, and outputs cmake_prefix for downstream CMAKE_PREFIX_PATH construction. Debug output aids troubleshooting.


273-327: LGTM - Platform-specific build tools setup with proper environment configuration.

The refactored "Set Up Build Tools" step correctly handles platform-specific requirements: Ubuntu uses system tools via deps script, Windows consolidates tool installation via choco with custom Eigen discovery path, and macOS properly adds Homebrew bin to PATH and includes libomp in cmake_prefix for CMake's find_package.


437-437: LGTM - Capture-env integration in main build workflow.

The environment capture is correctly placed after directory setup and before ctest execution, enabling reproducible build environment documentation.


458-458: LGTM - CMAKE_PREFIX_PATH construction uses established pattern.

The semicolon-separated concatenation of tool and conda prefixes matches the approach reviewed and approved in the previous comment cycle. CMake properly handles empty path elements.


471-471: LGTM - Parquet support enabled as intended by PR objectives.

Setting WITH_PARQUET: "ON" in the main build job environment enables the feature across all CI platforms. This change is now viable given the CMAKE_PREFIX_PATH fixes and Apache Arrow installation in upstream steps.


490-490: LGTM - Explicit Eigen3_DIR configuration for Windows package discovery.

Setting Eigen3_DIR to the choco-installed Eigen CMake path ensures reliable package discovery on Windows across different system configurations.


1-1000: LGTM - Comprehensive CI workflow refactoring supporting Parquet enablement.

The workflow correctly restructures Windows conda environment handling, implements environment capture via the new script across all platforms, and enables Parquet support. The changes directly address the PR objectives while maintaining backward compatibility for other platforms.


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: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b55e34 and 67d046a.

📒 Files selected for processing (4)
  • .github/workflows/openms_ci_matrix_full.yml (6 hunks)
  • tools/ci/capture-env.sh (1 hunks)
  • tools/ci/cibuild.cmake (0 hunks)
  • tools/ci/deps-macos.sh (2 hunks)
💤 Files with no reviewable changes (1)
  • tools/ci/cibuild.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). (15)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-macos
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • 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 (windows-2022, cl.exe, 14.36)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: build-and-test (macos-15-intel, xcode, 16.0.0)
  • 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 (macos-26, xcode, 26.0)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: build-and-test (macos-15-intel, xcode, 16.0.0)
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
🔇 Additional comments (6)
tools/ci/deps-macos.sh (1)

14-16: Well-motivated dependency additions.

The comment update accurately reflects the bash array workaround requirement. Adding apache-arrow aligns with the PR objective to enable Parquet support, and bash ensures the script's bash-specific syntax (variable indirection, array operations) works reliably on macOS runners.

Also applies to: 53-54

tools/ci/capture-env.sh (1)

1-122: Well-structured environment capture script.

The script cleanly handles variable indirection using bash parameter expansion (${!var:-}), properly formats output for CMake cache, and includes reasonable error handling. The variable list appears comprehensive for CI/build configuration. Verbose mode aids debugging.

One minor observation: the script assumes the target directory path's parent exists (or creates it), but the file itself may not exist—ensure callers understand they should initialize CMakeCache.txt before appending, or confirm that cibuild.cmake tolerates appending to a non-existent file.

.github/workflows/openms_ci_matrix_full.yml (4)

251-255: JSON extraction safely converts path separators for CMake.

The jq + sed pipeline correctly extracts the conda environment prefix and normalizes backslashes to forward slashes. This is important because CMake expects forward slashes even on Windows. Verify that this handles edge cases (e.g., paths with literal backslashes in directory names, though unlikely in practice).


436-438: Verify capture-env.sh CMakeCache.txt initialization and sequencing.

Line 437 appends environment variables to $GITHUB_WORKSPACE/OpenMS/bld/CMakeCache.txt. This assumes:

  1. The file either doesn't exist yet (and capture-env.sh creates it), or is pre-initialized by cmake/ctest.
  2. Calling capture-env.sh before ctest (line 438) ensures the cache is populated before CMake reads it.

The capture-env.sh script only appends lines; it removes the file if it exists (line 72), then recreates it. So sequencing is correct—environment variables are written first, then ctest runs. Verify that ctest/cibuild.cmake doesn't overwrite or truncate this file unexpectedly.


291-291: CMAKE_PREFIX_PATH outputs vary by platform—confirm empty values don't break concatenation.

The workflow sets cmake_prefix output differently per platform:

  • Ubuntu (line 291): echo "cmake_prefix=" >>$GITHUB_OUTPUT (empty)
  • Windows (line 311): echo "cmake_prefix=" >>"$GITHUB_OUTPUT" (empty before conda)
  • macOS (line 325): echo "cmake_prefix=$(brew --prefix);$(brew --prefix libomp)" >>"$GITHUB_OUTPUT" (populated)

When these are concatenated at line 458 with the conda output, verify that empty values don't create malformed semicolon-separated lists. For example, if Ubuntu has cmake_prefix="" and Windows conda has cmake_prefix="C:/path", the result should be ";C:/path" or just "C:/path", not a broken path.

Consider using conditional expansion in the env section to avoid empty prefixes:

CMAKE_PREFIX_PATH: "${{ steps.tools-prefix.outputs.cmake_prefix && (steps.tools-prefix.outputs.cmake_prefix + ';') || '' }}${{ steps.conda-setup.outputs.cmake_prefix }}"

Or validate in a shell step before ctest that CMAKE_PREFIX_PATH is well-formed (no leading/trailing/double semicolons).

Also applies to: 311-311, 325-325


471-471: All platforms have arrow/parquet dependencies properly covered.

Verification confirms:

  • Windows (line 247): conda install libarrow libparquet ✓
  • macOS (deps-macos.sh): apache-arrow via brew ✓
  • Linux/Ubuntu (deps-ubuntu.sh): libarrow-dev and libparquet-dev via apt ✓

All five matrix configurations (windows-2022, macos-15-intel, macos-26, ubuntu-22.04, ubuntu-22.04-arm) have required dependencies installed before the build, and WITH_PARQUET: "ON" at line 471 is properly configured in CMakeLists.txt with appropriate CMake target linking.

When using CMake/CTest to write out a `CMakeCache.txt` file,
environment variables injected into a string variable, which is then
written to a file via CMake, results in the value of those variables
being mangled.

For example, CMake list variables such as `CMAKE_PREFIX_PATH` have
their semicolon separators removed, resulting in an invalid list and
errors downstream about missing libraries.

I'm not sure it's wise to do this in the first place, but I kept this
cache initialization system and fixed the issue by moving it out into
a shell script.
Set `WITH_PARQUET` default value back to `ON`.

This is mostly a refactor to make the Conda steps more universal.
That is, for other operating systems and possibly other libraries that
we might need in the future.
Primary change: Only export the Qt path once.  This didn't work in the
past but was hidden by the "mangled CMake variables" bug.  This fixed
that bug.

But, I couldn't help but clean up this section so that items are
properly grouped together (e.g., choco installs).  Like all other
sections, `echo` statements that affect the following steps are put at
the end of the run block.
@jpfeuffer

Copy link
Copy Markdown
Contributor

Looks good. Just some elaboration on why it did not work before.
I removed CMAKE_PREFIX_PATH from the cache such that CMake solely reads it from the environment (I am still not sure what CMake does if it now sees the CMAKE_PREFIX_PATH in the environment AND in the cache.
The problem is, that CMake expects them in different list formats depending on how you specify them. In the environment it assumes it is is a PATH-like variable and separated by the OS path separator. As a cache variable or when passed to CMake via -D, it expects it as a CMake lists (always separated by semicolon).

In theory I don't care how it is done if it is correct but keep in mind that in theory you now have CMAKE_PREFIX_PATH in both the shell environment as well as in the CMakeCache. It looks like the cache rightfully gets preference so fine with me.

@jpfeuffer

Copy link
Copy Markdown
Contributor

Note: There might still be problems during creating installers, right? Is that next?

@pjones

pjones commented Nov 14, 2025

Copy link
Copy Markdown
Contributor Author

Note: There might still be problems during creating installers, right? Is that next?

Nope, this fixes that problem.

@pjones

pjones commented Nov 14, 2025

Copy link
Copy Markdown
Contributor Author

Looks good. Just some elaboration on why it did not work before. I removed CMAKE_PREFIX_PATH from the cache such that CMake solely reads it from the environment (I am still not sure what CMake does if it now sees the CMAKE_PREFIX_PATH in the environment AND in the cache. The problem is, that CMake expects them in different list formats depending on how you specify them. In the environment it assumes it is is a PATH-like variable and separated by the OS path separator. As a cache variable or when passed to CMake via -D, it expects it as a CMake lists (always separated by semicolon).

In theory I don't care how it is done if it is correct but keep in mind that in theory you now have CMAKE_PREFIX_PATH in both the shell environment as well as in the CMakeCache. It looks like the cache rightfully gets preference so fine with me.

@jpfeuffer

I tried to get CMake to pick up CMAKE_PREFIX_PATH from the environment and it was still messed up some how. I think it may have something to do with CTest shelling out to CMake, but I'm not sure. Perhaps it has something to do with the path separator, but that should be a semicolon too on Windows.

I also tried having CTest pass -DCMAKE_PREFIX_PATH=$ENV{CMAKE_PREFIX_PATH} but that also failed. The semicolons were stripped out and what was left was an invalid path. I don't really know what the problem is but once I moved it out of CTest/CMake everything started working as expected.

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.

3 participants