Skip to content

[macOS] Pin CMake to 3.31.6 due to a backward compatibility issue for all macOS images.#12791

Merged
erik-bershel merged 2 commits intoactions:mainfrom
github-maccloud:macos-fix-cmake
Aug 19, 2025
Merged

[macOS] Pin CMake to 3.31.6 due to a backward compatibility issue for all macOS images.#12791
erik-bershel merged 2 commits intoactions:mainfrom
github-maccloud:macos-fix-cmake

Conversation

@sureshe456
Copy link
Copy Markdown
Contributor

Description

  1. Pin CMake to version 3.31.6 via custom Homebrew tap due to compatibility issue for all macOS images.

Related issue:

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

Copilot AI review requested due to automatic review settings August 19, 2025 11:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR pins CMake to version 3.31.6 across all macOS images to resolve backward compatibility issues with newer CMake versions. The implementation switches from installing a downloaded formula file directly to using a custom Homebrew tap for better package management.

  • Replaces direct formula file installation with a custom Homebrew tap approach
  • Maintains the same CMake version (3.31.6) and commit reference for consistency
  • Adds proper tap creation and formula management for the pinned CMake version

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cmake_rb_path="$cmake_formula_dir/cmake.rb"

echo "Downloading cmake.rb from $cmake_rb_link"
curl -fsSL "$cmake_rb_link" -o "$cmake_rb_path"
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The code removes the use of download_with_retry function and replaces it with a simple curl command. This removes the retry mechanism that was previously in place, which could make the installation less reliable in case of network issues.

Suggested change
curl -fsSL "$cmake_rb_link" -o "$cmake_rb_path"
curl -fsSL --retry 5 --retry-delay 5 "$cmake_rb_link" -o "$cmake_rb_path"

Copilot uses AI. Check for mistakes.
@erik-bershel erik-bershel merged commit da7977b into actions:main Aug 19, 2025
4 checks passed
@erik-bershel erik-bershel deleted the macos-fix-cmake branch August 19, 2025 15:13
@xavier2k6
Copy link
Copy Markdown
Contributor

Could latest CMake 3.31.8 not be used?

@erik-bershel
Copy link
Copy Markdown
Contributor

Hey @xavier2k6!

Unfortunately 3.31.6 is the latest available version in brew: https://github.com/Homebrew/homebrew-core/commits/0da738a3fdbb58b610a3918af076fd4ea6433e3a/Formula/c/cmake.rb
😢

@kintel
Copy link
Copy Markdown

kintel commented Aug 30, 2025

I feel that this fix breaks more than it fixes: Some Homebrew packages depend on CMake for building, and will try to install it. Since CMake now belongs to the local/pinned tap, brew will fail to install such packages:

Error: cmake is already installed from local/pinned!
Please `brew uninstall cmake` first."

With this change, we now have to brew uninstall cmake; brew untap local/pinned; brew install cmake to work around this.

Since all of Homebrew follows their main branch, it feels weird to make CMake an exception.

Ref. openscad/openscad#6143

@erik-bershel
Copy link
Copy Markdown
Contributor

Hey @kintel!

Good point. Please open an issue - we'll work on the options.

@kintel
Copy link
Copy Markdown

kintel commented Aug 30, 2025

Hey @kintel!

Good point. Please open an issue - we'll work on the options.

#12912

rollerozxa added a commit to rollerozxa/tensy that referenced this pull request Aug 30, 2025
jabraham17 added a commit to jabraham17/CVL that referenced this pull request Aug 31, 2025
Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
@ReenigneArcher
Copy link
Copy Markdown

due to a backward compatibility issue for all macOS images

What is the backward compatibility issue that this solves? It seems to me this causes far more issues than it solves.

The biggest issue is that no homebrew package that depends on cmake can be installed.

@ghost
Copy link
Copy Markdown

ghost commented Sep 1, 2025

due to a backward compatibility issue for all macOS images

What is the backward compatibility issue that this solves? It seems to me this causes far more issues than it solves.

The biggest issue is that no homebrew package that depends on cmake can be installed.

It will be fixed next week when cmake will be unpin.

@vkedwardli
Copy link
Copy Markdown

What is the backward compatibility issue that this solves?

I'm curious on this one also

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.

7 participants