Skip to content

Commit b768fbd

Browse files
Bill-hbrhbrkirkrodriguesjunhaoliao
authored
build(core): Lock CMake version to < 4 across all platforms to avoid third-party library compilation issues. (#796)
Co-authored-by: Kirk Rodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Junhao Liao <junhao@junhao.ca>
1 parent c7d2072 commit b768fbd

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

components/core/tools/scripts/lib_install/centos-stream-9/install-all.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1010

1111
"${script_dir}/install-prebuilt-packages.sh"
1212
"${script_dir}/install-packages-from-source.sh"
13+
14+
# TODO: https://github.com/y-scope/clp/issues/795
15+
"${script_dir}/../check-cmake-version.sh"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# Exit on any error
4+
set -e
5+
6+
# Error on undefined variable
7+
set -u
8+
9+
# Get the installed cmake version string
10+
cmake_version=$(cmake -E capabilities | jq --raw-output ".version.string")
11+
cmake_major_version=$(cmake -E capabilities | jq --raw-output ".version.major")
12+
13+
# Check if version is 4.0 or higher
14+
if [[ "$cmake_major_version" -ge "4" ]]; then
15+
echo "CMake version $cmake_version is currently unsupported (>= 4.0)."
16+
exit 1
17+
fi

components/core/tools/scripts/lib_install/macos/install-all.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ set -e
77
set -u
88

99
brew update
10+
11+
# Install CMake v3.31.6 as ANTLR and yaml-cpp do not yet support CMake v4+.
12+
# See also: https://github.com/y-scope/clp/issues/795
13+
cmake_formula_path=/tmp/cmake.rb
14+
curl --fail --location --show-error \
15+
https://raw.githubusercontent.com/Homebrew/homebrew-core/b4e46db74e74a8c1650b38b1da222284ce1ec5ce/Formula/c/cmake.rb \
16+
--output "${cmake_formula_path}"
17+
brew install --formula "${cmake_formula_path}"
18+
1019
brew install \
1120
boost \
12-
cmake \
1321
coreutils \
1422
fmt \
1523
gcc \
@@ -32,3 +40,7 @@ brew install \
3240
if ! command -v pkg-config ; then
3341
brew install pkg-config
3442
fi
43+
44+
# TODO: https://github.com/y-scope/clp/issues/795
45+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
46+
"${script_dir}/../check-cmake-version.sh"

components/core/tools/scripts/lib_install/ubuntu-focal/install-all.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ set -u
88

99
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1010

11-
"$script_dir"/install-prebuilt-packages.sh
12-
"$script_dir"/install-packages-from-source.sh
11+
"${script_dir}/install-prebuilt-packages.sh"
12+
"${script_dir}/install-packages-from-source.sh"
13+
14+
# TODO: https://github.com/y-scope/clp/issues/795
15+
"${script_dir}/../check-cmake-version.sh"

components/core/tools/scripts/lib_install/ubuntu-jammy/install-all.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ set -u
88

99
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1010

11-
"$script_dir"/install-prebuilt-packages.sh
12-
"$script_dir"/install-packages-from-source.sh
11+
"${script_dir}/install-prebuilt-packages.sh"
12+
"${script_dir}/install-packages-from-source.sh"
13+
14+
# TODO: https://github.com/y-scope/clp/issues/795
15+
"${script_dir}/../check-cmake-version.sh"

0 commit comments

Comments
 (0)