Skip to content

Update install-cmake powershell script #3142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 16, 2025
Merged

Conversation

networkfusion
Copy link
Member

@networkfusion networkfusion commented Apr 4, 2025

Description

The original script expected any cmake version above 3.23.0 but there are issues with cmake versions 4.x.x (in our environment).
This change ensures that the version is set to the expected 3.31.6 (latest) version (when installed in a local environment).

Motivation and Context

Fix and pin install of cmake version install in a local environment.
We are yet to handle the major release changes: https://cmake.org/cmake/help/latest/release/4.0.html

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

  • Bug Fixes

    • Improved version check logic for CMake installation.
    • Corrected a typographical error in the installation status message.
  • Chores

    • Updated the expected CMake version to 3.31.6.

Copy link

coderabbitai bot commented Apr 4, 2025

Walkthrough

The pull request updates the install-scripts/install-cmake.ps1 script. Comments within the script have been revised to indicate that it installs the expected CMake version. The default version variable has been updated from "3.23.0" to "3.31.6". Additionally, the conditional logic was modified by changing the version check from -ge to -eq, so that the script now skips installation only if the installed version exactly matches the expected version. A typo in the skip message was corrected, and the embedded signature block was replaced.

Changes

Files Change Summary
install-scripts/install-cmake.ps1 - Updated script comment to "This PS installs the expected CMake version."
- Changed default version from "3.23.0" to "3.31.6".
- Modified conditional check from -ge to -eq.
- Fixed typo in skip message ("Skipping instal" → "Skipping install").
- Replaced embedded signature block.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Script as install-cmake.ps1
    participant CMake as Installed CMake

    User->>Script: Run install-cmake.ps1
    Script->>CMake: Retrieve installed version
    alt Installed version == expected version
      Script->>Script: Log "Skipping install of CMake"
    else Installed version != expected version
      Script->>Script: Proceed with CMake installation
    end
Loading

Possibly related PRs


📜 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 2a3b171 and 0ad12df.

📒 Files selected for processing (1)
  • install-scripts/install-cmake.ps1 (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • install-scripts/install-cmake.ps1

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

@networkfusion networkfusion requested a review from josesimoes April 4, 2025 22:39
Copy link

@coderabbitai coderabbitai bot left a comment

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 75ce2fd and 605acb6.

📒 Files selected for processing (1)
  • install-scripts/install-cmake.ps1 (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
🔇 Additional comments (4)
install-scripts/install-cmake.ps1 (4)

4-4: LGTM: Comment clarification is appropriate.

Updated comment now more accurately describes what the script does by specifying it installs the "expected" CMake version rather than just "CMake".


6-7: Updated version reflects the latest stable 3.x.x release.

The version has been updated from 3.23.0 to 3.31.0, which aligns with the PR objective to restrict installation to versions less than 4.x.x.


13-18: Logical change to prevent installation of 4.x.x versions.

The condition now correctly skips installation if the installed version is less than or equal to the expected version (3.31.0), which prevents installation of potentially problematic 4.x.x versions. Any installed version above 3.31.0 will be replaced with 3.31.0.


15-15: Fixed typo in the message.

Corrected "instal" to "install" in the message.

@networkfusion
Copy link
Member Author

networkfusion commented Apr 4, 2025

Although, in the longer term, we should also note https://cmake.org/cmake/help/latest/release/4.0.html - #3143

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
install-scripts/install-cmake.ps1 (1)

13-13: Logic change inverts the version check condition.

The change from -ge (greater than or equal) to -le (less than or equal) is significant. This now ensures that the script skips installation if the installed version is less than or equal to the expected version, effectively preventing installation of newer versions (like 4.x.x).

While this change addresses the immediate need to prevent CMake 4.x.x installations, consider if a more explicit version check might be clearer:

-    if($cmake.Version -le $version)
+    if($cmake.Version -le $version -and $cmake.Version.Major -lt 4)

This would make the intention to avoid version 4.x.x more explicit in the code.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 273e1f8 and 84e4c1d.

📒 Files selected for processing (1)
  • install-scripts/install-cmake.ps1 (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
🔇 Additional comments (3)
install-scripts/install-cmake.ps1 (3)

4-7: Comment updates clearly reflect the script's purpose.

The updated comments now accurately describe the script's purpose and version expectations, making it clearer to users that this script installs a specific expected version of CMake rather than any version.


15-15: Fixed typo in message.

The correction from "instal" to "install" improves the message clarity.


6-7: Version update to 3.31.6 is appropriate.

The updated version number (3.31.6) is still within the 3.x.x range, which aligns with the PR objective to avoid 4.x.x versions. This update provides users with a more recent compatible version.

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for updating this.

@josesimoes
Copy link
Member

Holding off the merge until we have a new code sign cert to update the signature.

@networkfusion
Copy link
Member Author

Holding off the merge until we have a new code sign cert to update the signature.

I am guessing this is un-blocked now...

@josesimoes
Copy link
Member

Correct. Script signed.

@josesimoes josesimoes merged commit 0a94972 into main Apr 16, 2025
4 checks passed
@josesimoes josesimoes deleted the networkfusion/cmake-patch branch April 16, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants