Skip to content

Windows Installer: exclude sytem dlls - #8001

Merged
cbielow merged 9 commits into
OpenMS:developfrom
cbielow:fix_dll_install
Apr 26, 2025
Merged

cbielow merged 9 commits into
OpenMS:developfrom
cbielow:fix_dll_install

Conversation

@cbielow

@cbielow cbielow commented Apr 25, 2025 •

Copy link
Copy Markdown
Contributor

Description

augments #7995 by fixing the POST_EXCLUDE regex.

Works nicely locally. The resulting installer is way smaller, has only vcredist DLLs and works fine on a vanilla Win10 VM.

For documentation purposes, put this in package_nsis.cmake to list the actual dependencies:

install(CODE [[
  set(my_app_path "C:/dev/openms/build/bin/Release/TOPPView.exe")

  file(GET_RUNTIME_DEPENDENCIES
      RESOLVED_DEPENDENCIES_VAR  resolved_deps
      UNRESOLVED_DEPENDENCIES_VAR  unresolved_deps
      EXECUTABLES ${my_app_path}
  )

  # Log all resolved dependencies
  message(STATUS "Resolved runtime dependencies:")
  foreach(dep IN LISTS resolved_deps)
      message(STATUS "  ${dep}")
  endforeach()

  # Log unresolved dependencies (just in case)
  message(STATUS "Unresolved runtime dependencies:")
  foreach(dep IN LISTS unresolved_deps)
      message(STATUS "  ${dep}")
  endforeach()
]])

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

  • Chores
    • Improved handling of dependency exclusions during packaging, with clearer separation and documentation of exclusion patterns for different platforms. No changes to user-facing features.

@coderabbitai

coderabbitai Bot commented Apr 25, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This change updates the dependency exclusion logic in the CMake packaging script for OpenMS. It introduces two separate exclusion regex lists—one for pre-analysis and one for post-analysis—clarifying their purpose through comments. On Windows, the previous exclusion list is split to better match CMake's regex behavior and to distinguish between system DLLs and unresolved dependencies. For Apple and other platforms, similar renaming and adjustments are made. The installation command is updated to use the new variables, ensuring more precise and documented control over dependency exclusion during packaging.

Changes

File(s) Change Summary
cmake/package_general.cmake Refactored dependency exclusion logic: introduced PRE_EXCLUDE_REGEXES and POST_EXCLUDE_REGEXES, added explanatory comments, split and clarified exclusion patterns for Windows, Apple, and other platforms, and updated the install command to use the new variables.

Sequence Diagram(s)

sequenceDiagram
    participant CMake
    participant Script
    participant DependencyAnalyzer

    CMake->>Script: Run packaging script
    Script->>DependencyAnalyzer: Analyze dependencies (PRE_EXCLUDE_REGEXES applied)
    DependencyAnalyzer-->>Script: Return full dependency list
    Script->>Script: Filter dependencies (POST_EXCLUDE_REGEXES applied)
    Script->>CMake: Install filtered dependencies
Loading

Possibly related PRs

  • Installer dll fix #7995: Both PRs modify the Windows DLL exclusion lists in cmake/package_general.cmake to refine which system DLLs are excluded from packaging, with the main PR further splitting exclusions into pre- and post-analysis regexes and clarifying their usage.

Suggested reviewers

  • pjones

Poem

In CMake’s warren, exclusions abound,
Pre and post regexes now neatly surround.
System DLLs, take a hop to the side—
Only the right ones join this install ride.
With patterns precise and comments anew,
The packaging script hops smarter through! 🐇


📜 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 0dee064 and c3b2b4e.

📒 Files selected for processing (1)
  • cmake/package_general.cmake (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build-and-test (windows-2022, cl.exe, default)
  • GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
  • GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: build-and-test (macos-13, xcode, 14.2)
🔇 Additional comments (5)
cmake/package_general.cmake (5)

69-77: Well-documented distinction between dependency exclusion types

The added comments clearly explain the difference between PRE_EXCLUDE_REGEXES and POST_EXCLUDE_REGEXES, which significantly improves maintainability. This distinction is important as it affects both build performance (by preventing unnecessary dependency traversal) and final package content.


84-89: Clear organization of Windows PRE_EXCLUDE patterns

The PRE_EXCLUDE patterns are well structured with helpful comments explaining the purpose of each exclusion group. The note about lowercase pattern requirement is particularly valuable given CMake's case-sensitive regex matching.


90-96: Robust case-insensitive pattern for System32 exclusions

The POST_EXCLUDE pattern using character classes for case-insensitivity is a robust approach to handle variations in System32 path casing. This should effectively exclude all system DLLs regardless of how CMake reports their paths.


99-103: Appropriate platform-specific exclusion patterns

The renaming from EXCLUDE to PRE_EXCLUDE for Apple platforms and the separation of PRE_EXCLUDE and POST_EXCLUDE for other platforms is consistent with the Windows changes, maintaining a uniform approach across all platforms.


114-115: Updated install command with new variable names

The install command correctly uses the new PRE_EXCLUDE_REGEXES and POST_EXCLUDE_REGEXES variables, ensuring that the exclusion patterns are properly applied during the installation process.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cbielow
cbielow merged commit 7a29a78 into OpenMS:develop Apr 26, 2025
@cbielow cbielow changed the title Fix dll install Windows Installer: Fix exclude sytem dlls Jun 11, 2025
@cbielow cbielow changed the title Windows Installer: Fix exclude sytem dlls Windows Installer: exclude sytem dlls Jun 11, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 11, 2025
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.

2 participants