Repository navigation
Get WITH_PARQUET=ON working in CI - #8370
Conversation
WalkthroughRestructures 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-09-03T12:58:20.032ZApplied to files:
⏰ 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)
🔇 Additional comments (15)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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-arrowaligns with the PR objective to enable Parquet support, andbashensures 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.txtbefore appending, or confirm thatcibuild.cmaketolerates 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+sedpipeline 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:
- The file either doesn't exist yet (and capture-env.sh creates it), or is pre-initialized by cmake/ctest.
- Calling
capture-env.shbefore ctest (line 438) ensures the cache is populated before CMake reads it.The
capture-env.shscript 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_prefixoutput 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 hascmake_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-arrowvia brew ✓- Linux/Ubuntu (deps-ubuntu.sh):
libarrow-devandlibparquet-devvia 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.
67d046a to
10fed3f
Compare
|
Looks good. Just some elaboration on why it did not work before. 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. |
|
Note: There might still be problems during creating installers, right? Is that next? |
Nope, this fixes that problem. |
I tried to get CMake to pick up I also tried having CTest pass |
Description
This PR enables
WITH_PARQUETon all platforms and resolves issues that prevented the CI builds from finishing successfully.The primary issue was related to the
CMAKE_PREFIX_PATHenvironment variable getting mangled during its travels from the CI YAML file, through CTest to CMake and finally to theCMakeCache.txtfile. Once I fixed that problem, several past workarounds broke, which needed to be fixed as well.Note: I tried just removing
CMAKE_PREFIX_PATHfrom showing up in theCMakeCache.txtfile 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
Chores