Skip to content

Commit f0e874d

Browse files
build(deps-dev): Use pipx to install version-constrained build tools; Bump minimum CMake version to 3.23 to support the latest ystdlib-cpp. (#1271)
Co-authored-by: kirkrodrigues <[email protected]>
1 parent 1d1cd18 commit f0e874d

File tree

29 files changed

+265
-269
lines changed

29 files changed

+265
-269
lines changed

.github/workflows/clp-core-build-macos.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ jobs:
6666
rm -f /usr/local/bin/pydoc3*
6767
rm -f /usr/local/bin/python3*
6868
69+
- name: "Remove preinstalled programs which will conflict with the pipx-installed packages"
70+
run: |
71+
if brew list --formula cmake >/dev/null 2>&1; then
72+
brew uninstall --force cmake
73+
fi
74+
6975
- name: "Install dependencies"
7076
run: "./components/core/tools/scripts/lib_install/macos/install-all.sh"
7177

components/core/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
cmake_minimum_required(VERSION 3.21)
1+
# ystdlib requires CMake v3.23 or higher
2+
cmake_minimum_required(VERSION 3.23)
23

34
# Toolchain setup must come before the first project() call in the entire CMake buildsystem.
45
# If CLP is not the top-level project, the following setup has no effect.

components/core/tools/docker-images/clp-env-base-centos-stream-9/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ WORKDIR /root
55
RUN mkdir -p ./tools/scripts/lib_install
66
ADD ./tools/scripts/lib_install ./tools/scripts/lib_install
77

8-
RUN ./tools/scripts/lib_install/centos-stream-9/install-all.sh
8+
# Set pipx environment vars so that the pipx scripts install into the global locations without
9+
# passing the `--global` flag.
10+
ENV PIPX_BIN_DIR=/usr/local/bin
11+
ENV PIPX_HOME=/opt/pipx
912

10-
RUN pip3 install --no-cache-dir uv
13+
RUN ./tools/scripts/lib_install/centos-stream-9/install-all.sh
1114

1215
# Remove cached files
1316
RUN dnf clean all \

components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /root
55
RUN mkdir -p ./tools/scripts/lib_install
66
COPY ./tools/scripts/lib_install ./tools/scripts/lib_install
77

8+
RUN pipx uninstall cmake
9+
RUN pipx uninstall uv
10+
811
RUN ./tools/scripts/lib_install/manylinux_2_28/install-all.sh
912

1013
# Remove cached files

components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /root
55
RUN mkdir -p ./tools/scripts/lib_install
66
COPY ./tools/scripts/lib_install ./tools/scripts/lib_install
77

8+
RUN pipx uninstall cmake
9+
RUN pipx uninstall uv
10+
811
RUN ./tools/scripts/lib_install/manylinux_2_28/install-all.sh
912

1013
# Remove cached files

components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /root
55
RUN mkdir -p ./tools/scripts/lib_install
66
COPY ./tools/scripts/lib_install ./tools/scripts/lib_install
77

8+
RUN pipx uninstall cmake
9+
RUN pipx uninstall uv
10+
811
RUN ./tools/scripts/lib_install/musllinux_1_2/install-all.sh
912

1013
# Remove cached files

components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /root
55
RUN mkdir -p ./tools/scripts/lib_install
66
COPY ./tools/scripts/lib_install ./tools/scripts/lib_install
77

8+
RUN pipx uninstall cmake
9+
RUN pipx uninstall uv
10+
811
RUN ./tools/scripts/lib_install/musllinux_1_2/install-all.sh
912

1013
# Remove cached files

components/core/tools/docker-images/clp-env-base-ubuntu-jammy/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ WORKDIR /root
55
RUN mkdir -p ./tools/scripts/lib_install
66
ADD ./tools/scripts/lib_install ./tools/scripts/lib_install
77

8-
RUN ./tools/scripts/lib_install/ubuntu-jammy/install-all.sh
8+
# Set pipx environment vars so that the pipx scripts install into the global locations without
9+
# passing the `--global` flag.
10+
ENV PIPX_BIN_DIR=/usr/local/bin
11+
ENV PIPX_HOME=/opt/pipx
912

10-
RUN pip3 install --no-cache-dir uv
13+
RUN ./tools/scripts/lib_install/ubuntu-jammy/install-all.sh
1114

1215
# Remove cached files
1316
RUN apt-get clean \
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#!/usr/bin/env bash
22

3-
# Exit on any error
4-
set -e
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
56

6-
# Error on undefined variable
7-
set -u
8-
9-
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
7+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
108

119
"${script_dir}/install-prebuilt-packages.sh"
1210
"${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: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#!/usr/bin/env bash
22

3-
# Exit on any error
4-
set -e
5-
6-
# Error on undefined variable
7-
set -u
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
86

97
dnf install -y \
10-
cmake \
118
diffutils \
129
gcc-c++ \
1310
git \
@@ -23,29 +20,10 @@ dnf install -y \
2320
python3-pip \
2421
unzip
2522

26-
# Determine architecture for `task` release to install
27-
rpm_arch=$(rpm --eval "%{_arch}")
28-
case "$rpm_arch" in
29-
"x86_64")
30-
task_pkg_arch="amd64"
31-
;;
32-
"aarch64")
33-
task_pkg_arch="arm64"
34-
;;
35-
*)
36-
echo "Error: Unsupported architecture - $rpm_arch"
37-
exit 1
38-
;;
39-
esac
23+
if ! command -v pipx >/dev/null 2>&1; then
24+
python3 -m pip install pipx
25+
fi
4026

41-
# Install `task`
42-
# NOTE: We lock `task` to version 3.44.0 to avoid https://github.com/y-scope/clp-ffi-js/issues/110
43-
task_pkg_path="$(mktemp -t --suffix ".rpm" task-pkg.XXXXXXXXXX)"
44-
curl \
45-
--fail \
46-
--location \
47-
--output "$task_pkg_path" \
48-
--show-error \
49-
"https://github.com/go-task/task/releases/download/v3.44.0/task_linux_${task_pkg_arch}.rpm"
50-
dnf install --assumeyes "$task_pkg_path"
51-
rm "$task_pkg_path"
27+
# Install remaining packages through pipx
28+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
29+
"${script_dir}/../pipx-packages/install-all.sh"

0 commit comments

Comments
 (0)