01_install.sh raw

   1  #!/usr/bin/env bash
   2  #
   3  # Copyright (c) 2018-present The Bitcoin Core developers
   4  # Distributed under the MIT software license, see the accompanying
   5  # file COPYING or http://www.opensource.org/licenses/mit-license.php.
   6  
   7  export LC_ALL=C
   8  
   9  set -o errexit -o pipefail -o xtrace
  10  
  11  export DEBIAN_FRONTEND=noninteractive
  12  export CI_RETRY_EXE="/ci_retry"
  13  
  14  pushd "/"
  15  
  16  ${CI_RETRY_EXE} apt-get update
  17  # Lint dependencies:
  18  # - cargo (used to run the lint tests)
  19  # - curl/xz-utils (to install shellcheck)
  20  # - git (used in many lint scripts)
  21  # - gpg (used by verify-commits)
  22  # - moreutils (used by scripted-diff)
  23  ${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg moreutils
  24  
  25  # Install Python and create venv using uv (reads version from .python-version)
  26  uv venv /python_env
  27  
  28  export PATH="/python_env/bin:${PATH}"
  29  command -v python3
  30  python3 --version
  31  
  32  uv pip install --python /python_env --requirements /ci/lint/requirements.txt
  33  
  34  SHELLCHECK_VERSION=v0.11.0
  35  curl --fail -L "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname --machine).tar.xz" | \
  36      tar --xz -xf - --directory /tmp/
  37  mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
  38  
  39  MLC_VERSION=v1.2.0
  40  curl --fail -L "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/mlc-$(uname --machine)-linux" -o "/usr/bin/mlc"
  41  chmod +x /usr/bin/mlc
  42  
  43  popd || exit
  44