Repository navigation
fix: remove BUILD_WITH_INSTALL_RPATH so dev builds find libOpenMS.so - #8892
Conversation
BUILD_WITH_INSTALL_RPATH replaced CMake's default build-tree RPATH (absolute path to build/lib/) with the install RPATH ($ORIGIN/../lib/). That relative path resolves correctly for installed executables in bin/ but not for nanobind modules in pyOpenMS/pyopenms/, causing "libOpenMS.so: cannot open shared object file" on import. Removing this property lets CMake embed the build-tree library path at build time while still applying INSTALL_RPATH during cmake --install. Wheel builds are unaffected (they use the PYOPENMS_PREPARE_WHEEL_REPAIR code path which never set this property). Fixes #8891 Co-Authored-By: Claude Opus 4.6 <[email protected]>
📝 WalkthroughWalkthroughThe CMake logic in Changes
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
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 |
|
i dont think this will fix it and will break other workflows. libOpenMS is clearly copied into the pyopenms build tree. And stupid AI is lying since we set the RPATH to ORIGIN not ORIGIN/../lib Without further information I would not touch the CMake setup. |
|
Note you are not testing macos dev wheels in CI |
Evidence1. RPATH before the fix includes
|
|
not in CI: well claude, then make it dependent on NO_DEPENDENCIES instead of destroying the workflows for others. macOS has a completely interpretation of RPATHs. I would only allow it if claude was also running it on all platforms. |
When NO_DEPENDENCIES=ON (the default), libOpenMS.so is not copied into the pyopenms package directory. BUILD_WITH_INSTALL_RPATH replaces CMake's build-tree RPATH with the install RPATH ($ORIGIN/../lib/:$ORIGIN/), neither of which resolves to the actual build/lib/ directory. Make BUILD_WITH_INSTALL_RPATH conditional on NO_DEPENDENCIES=OFF, where the libraries are co-located and $ORIGIN/ works. When NO_DEPENDENCIES=ON, let CMake use its default build-tree RPATH (absolute path to build/lib/). Fixes #8891 Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/pyOpenMS/CMakeLists.txt (1)
246-250:⚠️ Potential issue | 🟡 MinorUpdate workflow comment to match actual configuration.
The comment on line 311 of
.github/workflows/pyopenms-wheels-cibuildwheel.ymlstates "NO_DEPENDENCIES=OFF enables legacy library copying for macOS" butNO_DEPENDENCIESis not explicitly set in theCIBW_ENVIRONMENTblock, so the workflow uses the defaultNO_DEPENDENCIES=ONfrompyproject.toml. The comment should be clarified to reflect that wheel builds intentionally useNO_DEPENDENCIES=ONwith wheel repair tools, not the legacy library copying mechanism.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pyOpenMS/CMakeLists.txt` around lines 246 - 250, Update the workflow comment in .github/workflows/pyopenms-wheels-cibuildwheel.yml to accurately reflect the actual configuration: note that NO_DEPENDENCIES is not set in the CIBW_ENVIRONMENT block so the workflow inherits the default NO_DEPENDENCIES=ON from pyproject.toml, and that wheel builds rely on cibuildwheel/repair-wheel tools (wheel repair) rather than the legacy library copying mechanism; adjust the comment text accordingly to mention NO_DEPENDENCIES=ON and the use of wheel repair tools instead of saying "NO_DEPENDENCIES=OFF enables legacy library copying for macOS".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/pyOpenMS/CMakeLists.txt`:
- Around line 246-250: Update the workflow comment in
.github/workflows/pyopenms-wheels-cibuildwheel.yml to accurately reflect the
actual configuration: note that NO_DEPENDENCIES is not set in the
CIBW_ENVIRONMENT block so the workflow inherits the default NO_DEPENDENCIES=ON
from pyproject.toml, and that wheel builds rely on cibuildwheel/repair-wheel
tools (wheel repair) rather than the legacy library copying mechanism; adjust
the comment text accordingly to mention NO_DEPENDENCIES=ON and the use of wheel
repair tools instead of saying "NO_DEPENDENCIES=OFF enables legacy library
copying for macOS".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 40c6ac8a-dd09-4522-b284-6c57551312d8
📒 Files selected for processing (1)
src/pyOpenMS/CMakeLists.txt
Add missing changelog entries for changes merged in the past 7 days: - PyOpenMS: PeptideAndProteinQuant.getPeptideResults/getProteinResults exposed (#8543) - PyOpenMS BREAKING: zero-copy _mv methods renamed to _view (#8857) - TOPP BREAKING: FeatureFinderMultiplex/MultiplexResolver parameter missed_cleavages renamed to max_nr_labelled_aas (#8911) - TOPP: MaRaClusterAdapter annotates consensus spectra with native IDs and cluster metadata (#8864) - TOPP: MetaboliteAdductDecharger adds multimer detection (#8888) - OpenMS Library BREAKING: ChromatogramPeak::IntensityType changed double -> float (#8857) - Build: CMake 4.x compat fix for Windows packaging (#8880) - Build: Fix pyOpenMS dev build RPATH (#8892) - Build: Correctly locate locally installed nanobind (#8874) Co-authored-by: Copilot <[email protected]>
Add missing changelog entries for changes merged in the past 7 days: - PyOpenMS: PeptideAndProteinQuant.getPeptideResults/getProteinResults exposed (#8543) - PyOpenMS BREAKING: zero-copy _mv methods renamed to _view (#8857) - TOPP BREAKING: FeatureFinderMultiplex/MultiplexResolver parameter missed_cleavages renamed to max_nr_labelled_aas (#8911) - TOPP: MaRaClusterAdapter annotates consensus spectra with native IDs and cluster metadata (#8864) - TOPP: MetaboliteAdductDecharger adds multimer detection (#8888) - OpenMS Library BREAKING: ChromatogramPeak::IntensityType changed double -> float (#8857) - Build: CMake 4.x compat fix for Windows packaging (#8880) - Build: Fix pyOpenMS dev build RPATH (#8892) - Build: Correctly locate locally installed nanobind (#8874) Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Summary
BUILD_WITH_INSTALL_RPATH 1from the non-wheel-repair RPATH code path insrc/pyOpenMS/CMakeLists.txtbuild/lib/) with the install RPATH ($ORIGIN/../lib/), which resolves tobuild/pyOpenMS/lib/— a directory that doesn't existINSTALL_RPATHduringcmake --installBefore: nanobind modules had RUNPATH
$ORIGIN/../lib/:$ORIGIN/→libOpenMS.sonot found → import failsAfter: nanobind modules have RUNPATH
/abs/path/to/build/lib/→libOpenMS.sofound → import worksWheel builds are unaffected — they use the
PYOPENMS_PREPARE_WHEEL_REPAIR=ONcode path which never set this property.Fixes #8891
Test plan
import pyopenmssucceeds withoutLD_LIBRARY_PATHfrom build tree🤖 Generated with Claude Code
Summary by CodeRabbit