Skip to content

windlls - #8283

Merged
jpfeuffer merged 2 commits into
OpenMS:developfrom
jpfeuffer:windlls
Oct 11, 2025
Merged

windlls#8283
jpfeuffer merged 2 commits into
OpenMS:developfrom
jpfeuffer:windlls

Conversation

@jpfeuffer

@jpfeuffer jpfeuffer commented Oct 11, 2025 •

Copy link
Copy Markdown
Contributor
  • try with looking up all prefix paths during install dll finding. add arrow to vcpkg
  • todo

Summary by CodeRabbit

  • Bug Fixes

    • Improved runtime dependency discovery for macOS and Windows bundles, expanding search paths to reduce missing library/DLL issues and improve app stability during installation and first run.
  • Chores

    • Added Arrow library as a new dependency.

@coderabbitai

coderabbitai Bot commented Oct 11, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Introduces consolidated runtime dependency search directories in CMake for macOS/Windows by deriving paths from CMAKE_PREFIX_PATH and the OpenMS runtime dir, and switches install(RUNTIME_DEPENDENCY_SET) to use this list. Adds Apache Arrow to vcpkg.json dependencies. Adjusts comments and minor exclusion list notes without changing public APIs.

Changes

Cohort / File(s) Summary of changes
CMake runtime dependency resolution
cmake/package_general.cmake
Computes DEP_BIN_DIRS/DEP_LIB_DIRS from CMAKE_PREFIX_PATH, appends OpenMS runtime dir, and consolidates into RUNTIME_DEP_SEARCH_DIRS. Updates install(RUNTIME_DEPENDENCY_SET OPENMS_DEPS) to use these directories. Maintains platform-specific PRE_EXCLUDE/POST_EXCLUDE with minor comment adjustments, including a Windows vcruntime note.
Package dependencies
vcpkg.json
Adds "arrow" to the dependencies array (after "bzip2").

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as CMake Install
  participant Cfg as package_general.cmake
  participant Sys as System Paths
  participant Set as RUNTIME_DEPENDENCY_SET

  Dev->>Cfg: configure install()
  Cfg->>Sys: Derive DEP_BIN_DIRS/DEP_LIB_DIRS from CMAKE_PREFIX_PATH
  Cfg->>Cfg: Append OpenMS runtime dir to DEP_BIN_DIRS
  Cfg->>Cfg: Combine into RUNTIME_DEP_SEARCH_DIRS
  note over Cfg: Platform-specific PRE/POST_EXCLUDE rules applied
  Dev->>Set: install(RUNTIME_DEPENDENCY_SET OPENMS_DEPS<br/>DIRECTORIES=RUNTIME_DEP_SEARCH_DIRS)
  Set-->>Dev: Copy/resolve runtime deps from search dirs
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • poshul

Poem

In burrows of CMake, I hop and I seek,
New paths for DLLs—so tidy, so sleek.
An Arrow now joins our package parade,
Dependencies gathered, installers well-laid.
Thump-thump of paws on the build’s gentle ground,
Ship it, dear carrots—our binaries found! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title “windlls” is too vague and does not clearly convey the main changes in the pull request, which include enhancing runtime dependency search logic in CMake and adding the Arrow library to vcpkg dependencies. As a result, it does not provide enough context for reviewers to understand the purpose of the changes at a glance. Please provide a more descriptive title that highlights the key updates, for example “Enhance CMake DLL search paths and add Arrow dependency to vcpkg.”
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 6bd4230 and 719b545.

📒 Files selected for processing (2)
  • cmake/package_general.cmake (3 hunks)
  • vcpkg.json (1 hunks)
🔇 Additional comments (4)
vcpkg.json (1)

46-46: Verify Arrow dependency requirements.

The Apache Arrow dependency has been added without version constraints. Ensure this aligns with OpenMS compatibility requirements, as Arrow's API can change between major versions.

Run the following script to check Arrow availability and any known issues:

cmake/package_general.cmake (3)

46-54: Potential search order and generator expression issues.

This implementation has two concerns:

  1. Search order conflict: Line 50's comment states the runtime directory is the "primary source," but line 51 appends it last to DEP_BIN_DIRS, meaning it will be searched last, not first.

  2. Generator expression timing: $<TARGET_FILE_DIR:OpenMS> at line 51 is a generator expression that evaluates at generation time, but install(RUNTIME_DEPENDENCY_SET) at line 102 operates at install time. Generator expressions in DIRECTORIES may not expand correctly in this context.

Consider this alternative approach:

-# Also include our own runtime directory where dependencies were copied during build.
-# This serves as the primary source, with CMAKE_PREFIX_PATH directories as fallback.
-list(APPEND DEP_BIN_DIRS $<TARGET_FILE_DIR:OpenMS>)
+# Prepend our own runtime directory where dependencies were copied during build.
+# This serves as the primary source, with CMAKE_PREFIX_PATH directories as fallback.
+list(PREPEND DEP_BIN_DIRS "${CMAKE_BINARY_DIR}/${INSTALL_BIN_DIR}")
+list(PREPEND DEP_LIB_DIRS "${CMAKE_BINARY_DIR}/${INSTALL_LIB_DIR}")

This places the runtime directories first (matching the "primary source" comment) and uses standard CMake variables instead of generator expressions.

Additionally, verify the asymmetry: should the runtime directory be added to both DEP_BIN_DIRS and DEP_LIB_DIRS, or only to DEP_BIN_DIRS as currently implemented?


76-76: TODO: Clarify vcruntime DLL resolution strategy.

The TODO comment mentions that vcruntime140_1.dll sometimes cannot be resolved while vcruntime140.dll is found. Before adding it to the exclusion list, investigate whether this is:

  1. A missing dependency that should be included in the package
  2. A version-specific issue that needs different resolution logic
  3. A legitimate system DLL that should be excluded

Excluding a DLL that's actually needed could cause runtime failures on systems where it's not already installed.

Do you want me to research the relationship between vcruntime140.dll and vcruntime140_1.dll to provide guidance on the correct approach?


102-102: Verify DIRECTORIES variable is correctly populated.

The change to use RUNTIME_DEP_SEARCH_DIRS looks correct syntactically. However, this assumes the variable is properly constructed with valid paths at install time.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@jpfeuffer

Copy link
Copy Markdown
Contributor Author

I could not reproduce #8273 . Installs fine for me with vcpkg.

Might be an issue with the CMake config from libarrow on conda. Or a general CMake limitation of TARGET_RUNTIME_DLL with PRIVATE transitive dependencies: https://discourse.cmake.org/t/unexpected-behavior-of-target-runtime-dlls-when-mixing-static-shared-public-private-libraries/10352

Maybe this fix helps nonetheless by trying to look in the directories that CMake also looks into when trying to find the dlls originally.

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.

1 participant