Skip to content

Commit f5843d4

Browse files
authored
ci: pin cmake to 3.31.6 (#2691)
## Summary: Currently all Hermes slices in PR are failing to build (but build locally). ``` 2025-09-17T00:55:31.8097360Z CMake Error at CMakeLists.txt:42 (cmake_policy): 2025-09-17T00:55:31.8097720Z Policy CMP0026 may not be set to OLD behavior because this version of CMake 2025-09-17T00:55:31.8098290Z no longer supports it. The policy was introduced in CMake version 3.0.0, 2025-09-17T00:55:31.8098600Z and use of NEW behavior is now required. 2025-09-17T00:55:31.8098750Z 2025-09-17T00:55:31.8098940Z Please either update your CMakeLists.txt files to conform to the new 2025-09-17T00:55:31.8099330Z behavior or use an older version of CMake that still supports the old 2025-09-17T00:55:31.8099700Z behavior. Run cmake --help-policy CMP0026 for more information. 2025-09-17T00:55:31.8099900Z 2025-09-17T00:55:31.8099900Z 2025-09-17T00:55:31.8101310Z CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. 2025-09-17T00:55:31.8101980Z CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage 2025-09-17T00:55:31.8102350Z CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage ``` This is because GitHub Actions recently updated the macOS images to cmake 4 (actions/runner-images#12934). Per their comment, use their example script to pin to a lower version ## Test Plan: CI should pass
1 parent 18a6c74 commit f5843d4

File tree

1 file changed

+26
-1
lines changed
  • .github/actions/microsoft-setup-toolchain

1 file changed

+26
-1
lines changed

.github/actions/microsoft-setup-toolchain/action.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,31 @@ inputs:
2222
runs:
2323
using: composite
2424
steps:
25+
- name: Pin cmake version
26+
if: ${{ inputs.platform == 'macos' || inputs.platform == 'ios' || inputs.platform == 'visionos' }}
27+
run: |
28+
brew uninstall cmake
29+
# Copied from https://github.com/actions/runner-images/pull/12791
30+
# Pin cmake to 3.31.6 due to a backward compatibility issue
31+
# https://github.com/actions/runner-images/issues/11926
32+
cmake_commit="b4e46db74e74a8c1650b38b1da222284ce1ec5ce"
33+
tap_name="local/pinned"
34+
35+
echo "Creating local tap (no git)..."
36+
brew tap-new --no-git "$tap_name" >/dev/null
37+
38+
cmake_formula_dir="$(brew --repo "$tap_name")/Formula"
39+
mkdir -p "$cmake_formula_dir"
40+
41+
cmake_rb_link="https://raw.githubusercontent.com/Homebrew/homebrew-core/$cmake_commit/Formula/c/cmake.rb"
42+
cmake_rb_path="$cmake_formula_dir/cmake.rb"
43+
44+
echo "Downloading cmake.rb from $cmake_rb_link"
45+
curl -fsSL "$cmake_rb_link" -o "$cmake_rb_path"
46+
47+
echo "Installing cmake 3.31.6 from custom tap..."
48+
brew install "$tap_name/cmake"
49+
shell: bash
2550
- name: Set up Ccache
2651
id: setup-ccache
2752
if: ${{ inputs.platform == 'ios' || inputs.platform == 'macos' || inputs.platform == 'visionos' }}
@@ -79,4 +104,4 @@ runs:
79104
uses: actions/cache@v4
80105
with:
81106
path: .ccache
82-
key: ${{ runner.os }}-${{ inputs.cache-key-prefix }}-ccache-${{ steps.setup-ccache.outputs.cache-key }}
107+
key: ${{ runner.os }}-${{ inputs.cache-key-prefix }}-ccache-${{ steps.setup-ccache.outputs.cache-key }}

0 commit comments

Comments
 (0)