From 8c8121393a0aea78eb171bfe65bbf670e437a96f Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Thu, 5 Dec 2024 09:27:23 +0100 Subject: [PATCH 01/11] fix: py3.12 install deps --- .github/workflows/weekly-pip-audit.yaml | 2 +- Makefile | 2 +- script/make_utils/setup_os_deps.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/weekly-pip-audit.yaml b/.github/workflows/weekly-pip-audit.yaml index f57d438ea..8b8bbf429 100644 --- a/.github/workflows/weekly-pip-audit.yaml +++ b/.github/workflows/weekly-pip-audit.yaml @@ -61,7 +61,7 @@ jobs: which pip3 python -m pip install --upgrade pip - python -m pip install poetry==1.7.1 + python -m pip install poetry==1.8.4 make setup_env - name: Run pip-audit diff --git a/Makefile b/Makefile index 2d9a24d95..50e38c9fb 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ CONCRETE_PACKAGE_PATH=$(SRC_DIR)/concrete COUNT?=1 RANDOMLY_SEED?=$$RANDOM PYTEST_OPTIONS:= -POETRY_VERSION:=1.7.1 +POETRY_VERSION:=1.8.4 APIDOCS_OUTPUT?="./docs/references/api" OPEN_PR="true" diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index c297089af..785dadff3 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -145,7 +145,7 @@ if [[ "${OS_NAME}" == "Linux" ]]; then (pipx install poetry && pipx ensurepath) || \ (\ python3 -m pip install --no-cache-dir --upgrade pip && \ - python3 -m pip install --no-cache-dir --ignore-installed poetry==1.7.1 \ + python3 -m pip install --no-cache-dir --ignore-installed poetry==1.8.4 \ ); echo "PATH=$PATH:/home/dev_user/.local/bin/" >> ~/.bashrc elif [[ "${OS_NAME}" == "Darwin" ]]; then @@ -157,7 +157,7 @@ elif [[ "${OS_NAME}" == "Darwin" ]]; then brew install curl git git-lfs gitleaks graphviz jq make pandoc shellcheck openssl libomp actionlint unzip gh rsync python3 -m pip install -U pip - python3 -m pip install poetry==1.7.1 + python3 -m pip install poetry==1.8.4 echo "Make is currently installed as gmake" echo 'If you need to use it as "make", you can add a "gnubin" directory to your PATH from your bashrc like:' From 297794e5d1631f5a1ed84252b3d016536e516085 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Thu, 5 Dec 2024 09:48:18 +0100 Subject: [PATCH 02/11] fix: update ubuntu in CI --- .github/workflows/continuous-integration.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index efdb22d98..568441513 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -99,7 +99,7 @@ env: jobs: commit-checks: name: Commit Checks - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: commits_ok: ${{ steps.commit-conformance.outcome == 'success' }} steps: @@ -156,7 +156,7 @@ jobs: needs: [commit-checks] # We skip the CI in cases of pushing to internal main (because all pushes to main internal are now from the bot) if: ${{ !( github.repository != 'zama-ai/concrete-ml' && github.event_name == 'push' && github.ref == 'refs/heads/main' ) }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 5 outputs: linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }} @@ -295,7 +295,7 @@ jobs: start-runner-linux: needs: [commit-checks, matrix-preparation] name: Start EC2 runner (Linux) - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 15 outputs: label-38: ${{ steps.start-ec2-runner-38.outputs.label }} @@ -1025,7 +1025,7 @@ jobs: linux-build-status: name: Build Status (Linux) needs: [build-linux] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 2 if: success() || failure() steps: @@ -1045,7 +1045,7 @@ jobs: stop-runner-linux: name: Stop EC2 runner (Linux) needs: [build-linux, start-runner-linux] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 2 if: ${{ always() && (needs.start-runner-linux.result != 'skipped') }} steps: @@ -1186,7 +1186,7 @@ jobs: decide-slack-report: name: Decide Slack report - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: send_slack_report: ${{ steps.set-decision.outputs.send_slack_report }} steps: @@ -1211,7 +1211,7 @@ jobs: # if the job should be run or not in an previous job and store it in its output slack-report: name: Slack report - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: | always() && needs.matrix-preparation.result != 'skipped' @@ -1310,7 +1310,7 @@ jobs: stop-ec2-failure-slack-alert: name: Stop EC2 failure Slack alert - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: | always() && needs.matrix-preparation.result != 'skipped' From c826489b1313899ae9d717bb972d7e37eed4debf Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Thu, 5 Dec 2024 10:14:13 +0100 Subject: [PATCH 03/11] fix: update CI to ubuntu 24 --- .github/workflows/continuous-integration.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 568441513..37dbf7991 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -99,7 +99,7 @@ env: jobs: commit-checks: name: Commit Checks - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 outputs: commits_ok: ${{ steps.commit-conformance.outcome == 'success' }} steps: @@ -156,7 +156,7 @@ jobs: needs: [commit-checks] # We skip the CI in cases of pushing to internal main (because all pushes to main internal are now from the bot) if: ${{ !( github.repository != 'zama-ai/concrete-ml' && github.event_name == 'push' && github.ref == 'refs/heads/main' ) }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 timeout-minutes: 5 outputs: linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }} @@ -295,7 +295,7 @@ jobs: start-runner-linux: needs: [commit-checks, matrix-preparation] name: Start EC2 runner (Linux) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 timeout-minutes: 15 outputs: label-38: ${{ steps.start-ec2-runner-38.outputs.label }} @@ -1025,7 +1025,7 @@ jobs: linux-build-status: name: Build Status (Linux) needs: [build-linux] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 timeout-minutes: 2 if: success() || failure() steps: @@ -1045,7 +1045,7 @@ jobs: stop-runner-linux: name: Stop EC2 runner (Linux) needs: [build-linux, start-runner-linux] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 timeout-minutes: 2 if: ${{ always() && (needs.start-runner-linux.result != 'skipped') }} steps: @@ -1186,7 +1186,7 @@ jobs: decide-slack-report: name: Decide Slack report - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 outputs: send_slack_report: ${{ steps.set-decision.outputs.send_slack_report }} steps: @@ -1211,7 +1211,7 @@ jobs: # if the job should be run or not in an previous job and store it in its output slack-report: name: Slack report - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 if: | always() && needs.matrix-preparation.result != 'skipped' @@ -1310,7 +1310,7 @@ jobs: stop-ec2-failure-slack-alert: name: Stop EC2 failure Slack alert - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.10 if: | always() && needs.matrix-preparation.result != 'skipped' From d88fc90b740191461b0a77be233523fe54a441c1 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Thu, 5 Dec 2024 13:56:49 +0100 Subject: [PATCH 04/11] fix: update CI to ubuntu 24 --- .github/workflows/continuous-integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 37dbf7991..3781f916f 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -33,7 +33,7 @@ on: default: "3.8" manual_call: - description: "Do not uncheck this" + description: "Do not uncheck this!" type: boolean required: false default: true From d63ef5e81dee165bbca786a5182ff4d85593372f Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Thu, 5 Dec 2024 13:58:16 +0100 Subject: [PATCH 05/11] fix: update CI to ubuntu 24 --- .github/workflows/continuous-integration.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 3781f916f..f2e3cdc6c 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -99,7 +99,7 @@ env: jobs: commit-checks: name: Commit Checks - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest outputs: commits_ok: ${{ steps.commit-conformance.outcome == 'success' }} steps: @@ -156,7 +156,7 @@ jobs: needs: [commit-checks] # We skip the CI in cases of pushing to internal main (because all pushes to main internal are now from the bot) if: ${{ !( github.repository != 'zama-ai/concrete-ml' && github.event_name == 'push' && github.ref == 'refs/heads/main' ) }} - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest timeout-minutes: 5 outputs: linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }} @@ -295,7 +295,7 @@ jobs: start-runner-linux: needs: [commit-checks, matrix-preparation] name: Start EC2 runner (Linux) - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest timeout-minutes: 15 outputs: label-38: ${{ steps.start-ec2-runner-38.outputs.label }} @@ -1025,7 +1025,7 @@ jobs: linux-build-status: name: Build Status (Linux) needs: [build-linux] - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest timeout-minutes: 2 if: success() || failure() steps: @@ -1045,7 +1045,7 @@ jobs: stop-runner-linux: name: Stop EC2 runner (Linux) needs: [build-linux, start-runner-linux] - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest timeout-minutes: 2 if: ${{ always() && (needs.start-runner-linux.result != 'skipped') }} steps: @@ -1186,7 +1186,7 @@ jobs: decide-slack-report: name: Decide Slack report - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest outputs: send_slack_report: ${{ steps.set-decision.outputs.send_slack_report }} steps: @@ -1211,7 +1211,7 @@ jobs: # if the job should be run or not in an previous job and store it in its output slack-report: name: Slack report - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest if: | always() && needs.matrix-preparation.result != 'skipped' @@ -1310,7 +1310,7 @@ jobs: stop-ec2-failure-slack-alert: name: Stop EC2 failure Slack alert - runs-on: ubuntu-24.10 + runs-on: ubuntu-latest if: | always() && needs.matrix-preparation.result != 'skipped' From c9e944c0071ca94e35647cd45d1b31c50b398402 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Fri, 6 Dec 2024 09:29:53 +0100 Subject: [PATCH 06/11] fix: newer poetry, fix coverage, tests, cmake for py312 --- .github/workflows/continuous-integration.yaml | 16 ++++++++-------- .github/workflows/prepare_release.yaml | 2 +- .github/workflows/update_licenses.yaml | 2 +- script/make_utils/setup_os_deps.sh | 8 ++++++++ src/concrete/ml/sklearn/base.py | 2 +- src/concrete/ml/sklearn/glm.py | 2 +- tests/torch/test_compile_torch.py | 1 - 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index f2e3cdc6c..9e37001b0 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -99,7 +99,7 @@ env: jobs: commit-checks: name: Commit Checks - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: commits_ok: ${{ steps.commit-conformance.outcome == 'success' }} steps: @@ -156,7 +156,7 @@ jobs: needs: [commit-checks] # We skip the CI in cases of pushing to internal main (because all pushes to main internal are now from the bot) if: ${{ !( github.repository != 'zama-ai/concrete-ml' && github.event_name == 'push' && github.ref == 'refs/heads/main' ) }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 5 outputs: linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }} @@ -295,7 +295,7 @@ jobs: start-runner-linux: needs: [commit-checks, matrix-preparation] name: Start EC2 runner (Linux) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 15 outputs: label-38: ${{ steps.start-ec2-runner-38.outputs.label }} @@ -1025,7 +1025,7 @@ jobs: linux-build-status: name: Build Status (Linux) needs: [build-linux] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 2 if: success() || failure() steps: @@ -1045,7 +1045,7 @@ jobs: stop-runner-linux: name: Stop EC2 runner (Linux) needs: [build-linux, start-runner-linux] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 2 if: ${{ always() && (needs.start-runner-linux.result != 'skipped') }} steps: @@ -1186,7 +1186,7 @@ jobs: decide-slack-report: name: Decide Slack report - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: send_slack_report: ${{ steps.set-decision.outputs.send_slack_report }} steps: @@ -1211,7 +1211,7 @@ jobs: # if the job should be run or not in an previous job and store it in its output slack-report: name: Slack report - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: | always() && needs.matrix-preparation.result != 'skipped' @@ -1310,7 +1310,7 @@ jobs: stop-ec2-failure-slack-alert: name: Stop EC2 failure Slack alert - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: | always() && needs.matrix-preparation.result != 'skipped' diff --git a/.github/workflows/prepare_release.yaml b/.github/workflows/prepare_release.yaml index 0dd1b12ef..e36773b7d 100644 --- a/.github/workflows/prepare_release.yaml +++ b/.github/workflows/prepare_release.yaml @@ -61,7 +61,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install poetry==1.7.1 + python -m pip install poetry==1.8.4 make setup_env # Make sure that the workflow has been triggered from a release branch if this is a patch diff --git a/.github/workflows/update_licenses.yaml b/.github/workflows/update_licenses.yaml index 3eb4b55e1..55e646b68 100644 --- a/.github/workflows/update_licenses.yaml +++ b/.github/workflows/update_licenses.yaml @@ -85,7 +85,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install poetry==1.7.1 + python -m pip install poetry==1.8.4 make setup_env - name: Update licenses diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index 785dadff3..2305400bc 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -140,6 +140,14 @@ if [[ "${OS_NAME}" == "Linux" ]]; then fi eval "${SETUP_CMD}" + wget https://github.com/Kitware/CMake/releases/download/v3.31.2/cmake-3.31.2.tar.gz + tar xzvf cmake-3.31.2.tar.gz + cd cmake-3.31.2 + ./bootstrap + make -j$(nproc) + sudo make install + cd ../ + # Install poetry, either with pipx for ubuntu >= 23 # or through regular pip for older ubuntu (pipx install poetry && pipx ensurepath) || \ diff --git a/src/concrete/ml/sklearn/base.py b/src/concrete/ml/sklearn/base.py index fa692b2ec..0e21f1053 100644 --- a/src/concrete/ml/sklearn/base.py +++ b/src/concrete/ml/sklearn/base.py @@ -1591,7 +1591,7 @@ def get_sklearn_params(self, deep: bool = True) -> dict: params.pop("n_bits", None) if "1.1." in sklearn.__version__: - params.pop("monotonic_cst", None) + params.pop("monotonic_cst", None) # pragma: no cover return params diff --git a/src/concrete/ml/sklearn/glm.py b/src/concrete/ml/sklearn/glm.py index cd034f43e..ecdbcf56a 100644 --- a/src/concrete/ml/sklearn/glm.py +++ b/src/concrete/ml/sklearn/glm.py @@ -146,7 +146,7 @@ def get_sklearn_params(self, deep: bool = True) -> dict: params.pop("n_bits", None) # Remove sklearn 1.4 parameter when using sklearn 1.1 if "1.1." in sklearn.__version__: - params.pop("solver", None) + params.pop("solver", None) # pragma: no cover return params diff --git a/tests/torch/test_compile_torch.py b/tests/torch/test_compile_torch.py index 202def064..4abc0f5c9 100644 --- a/tests/torch/test_compile_torch.py +++ b/tests/torch/test_compile_torch.py @@ -863,7 +863,6 @@ def test_pretrained_mnist_qat( quantized_numpy_module = compile_onnx_model( onnx_model, inputset, - import_qat=True, configuration=default_configuration, n_bits=n_bits, verbose=verbose, From 72493099f8f159bf8f2514f1f6367de7e1b71a12 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Fri, 6 Dec 2024 13:36:33 +0100 Subject: [PATCH 07/11] fix: install cmake --- script/make_utils/setup_os_deps.sh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index 2305400bc..0783798a5 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -89,6 +89,20 @@ linux_install_github_cli () { ${SUDO_BIN:+$SUDO_BIN} dpkg -i /home/dev_user/gh_${GH_CLI_VERSION}_linux_amd64.deb } +linux_install_cmake () { + export OLD_DIR=$(pwd) + cd /tmp + wget https://github.com/Kitware/CMake/releases/download/v3.31.2/cmake-3.31.2.tar.gz + tar xzf cmake-3.31.2.tar.gz + cd cmake-3.31.2 || return + ./bootstrap + make -j8 + sudo make install + cd ../ + rm -rf cmake-3.31.2 + cd "${OLD_DIR}" +} + OS_NAME=$(uname) if [[ "${OS_NAME}" == "Linux" ]]; then @@ -126,27 +140,21 @@ if [[ "${OS_NAME}" == "Linux" ]]; then jq \ make \ rsync \ - cmake \ unzip \ pandoc \ openssl \ shellcheck \ + libssl-dev \ texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-xetex lmodern \ wget pipx && ${CLEAR_APT_LISTS:+$CLEAR_APT_LISTS} \ linux_install_gitleaks && \ linux_install_actionlint && \ - linux_install_github_cli" + linux_install_github_cli && \ + linux_install_cmake" fi eval "${SETUP_CMD}" - wget https://github.com/Kitware/CMake/releases/download/v3.31.2/cmake-3.31.2.tar.gz - tar xzvf cmake-3.31.2.tar.gz - cd cmake-3.31.2 - ./bootstrap - make -j$(nproc) - sudo make install - cd ../ # Install poetry, either with pipx for ubuntu >= 23 # or through regular pip for older ubuntu From 3bb1077b9a98a80f1da8e3203139a2bd45341210 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Fri, 6 Dec 2024 14:00:27 +0100 Subject: [PATCH 08/11] fix: shellcheck --- script/make_utils/setup_os_deps.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index 0783798a5..fadd3e8d8 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -90,17 +90,17 @@ linux_install_github_cli () { } linux_install_cmake () { - export OLD_DIR=$(pwd) - cd /tmp + OLD_DIR=$(pwd) + cd /tmp || return wget https://github.com/Kitware/CMake/releases/download/v3.31.2/cmake-3.31.2.tar.gz tar xzf cmake-3.31.2.tar.gz cd cmake-3.31.2 || return ./bootstrap make -j8 sudo make install - cd ../ + cd ../ || return rm -rf cmake-3.31.2 - cd "${OLD_DIR}" + cd "${OLD_DIR}" || return } OS_NAME=$(uname) From 339841b1926323d763079deb6de14a82c2eda02e Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Fri, 6 Dec 2024 14:20:21 +0100 Subject: [PATCH 09/11] fix: pcc --- src/concrete/ml/sklearn/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concrete/ml/sklearn/base.py b/src/concrete/ml/sklearn/base.py index 0e21f1053..1390160d0 100644 --- a/src/concrete/ml/sklearn/base.py +++ b/src/concrete/ml/sklearn/base.py @@ -1591,7 +1591,7 @@ def get_sklearn_params(self, deep: bool = True) -> dict: params.pop("n_bits", None) if "1.1." in sklearn.__version__: - params.pop("monotonic_cst", None) # pragma: no cover + params.pop("monotonic_cst", None) # pragma: no cover return params From 7ca68a8179d3f3a68802de73bd46cba14bd906a0 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Fri, 6 Dec 2024 15:05:29 +0100 Subject: [PATCH 10/11] fix: install cmake --- script/make_utils/setup_os_deps.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index fadd3e8d8..897ba9494 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -90,17 +90,17 @@ linux_install_github_cli () { } linux_install_cmake () { - OLD_DIR=$(pwd) - cd /tmp || return - wget https://github.com/Kitware/CMake/releases/download/v3.31.2/cmake-3.31.2.tar.gz - tar xzf cmake-3.31.2.tar.gz - cd cmake-3.31.2 || return - ./bootstrap - make -j8 - sudo make install - cd ../ || return - rm -rf cmake-3.31.2 - cd "${OLD_DIR}" || return + sudo apt-get update + sudo apt-get -y install ca-certificates gpg wget + test -f /usr/share/doc/kitware-archive-keyring/copyright || + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null + sudo apt-get update + test -f /usr/share/doc/kitware-archive-keyring/copyright || sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg + sudo apt-get install -y kitware-archive-keyring + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | sudo tee -a /etc/apt/sources.list.d/kitware.list >/dev/null + sudo apt-get update + sudo apt-get -y install cmake } OS_NAME=$(uname) From 97ae5166768831d8a117b435bdf2d5206d21a408 Mon Sep 17 00:00:00 2001 From: Andrei Stoian Date: Fri, 6 Dec 2024 15:27:02 +0100 Subject: [PATCH 11/11] fix: install cmake --- script/make_utils/setup_os_deps.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index 897ba9494..43e2dc302 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -90,17 +90,22 @@ linux_install_github_cli () { } linux_install_cmake () { - sudo apt-get update - sudo apt-get -y install ca-certificates gpg wget + ${SUDO_BIN:+$SUDO_BIN} apt-get update + ${SUDO_BIN:+$SUDO_BIN} apt-get -y install ca-certificates gpg wget test -f /usr/share/doc/kitware-archive-keyring/copyright || - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null - sudo apt-get update - test -f /usr/share/doc/kitware-archive-keyring/copyright || sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg - sudo apt-get install -y kitware-archive-keyring - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | sudo tee -a /etc/apt/sources.list.d/kitware.list >/dev/null - sudo apt-get update - sudo apt-get -y install cmake + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \ + gpg --dearmor - | \ + ${SUDO_BIN:+$SUDO_BIN} tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | \ + ${SUDO_BIN:+$SUDO_BIN} tee /etc/apt/sources.list.d/kitware.list >/dev/null + ${SUDO_BIN:+$SUDO_BIN} apt-get update + test -f /usr/share/doc/kitware-archive-keyring/copyright || \ + ${SUDO_BIN:+$SUDO_BIN} rm /usr/share/keyrings/kitware-archive-keyring.gpg + ${SUDO_BIN:+$SUDO_BIN} apt-get install -y kitware-archive-keyring + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | \ + ${SUDO_BIN:+$SUDO_BIN} tee -a /etc/apt/sources.list.d/kitware.list >/dev/null + ${SUDO_BIN:+$SUDO_BIN} apt-get update + ${SUDO_BIN:+$SUDO_BIN} apt-get -y install cmake } OS_NAME=$(uname)