2018-08-03 11:34:25 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2024-07-22 07:18:31 -04:00
|
|
|
# Copyright (c) 2018-present The Bitcoin Core developers
|
2018-08-03 11:34:25 -04:00
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2024-07-22 07:18:31 -04:00
|
|
|
export CI_RETRY_EXE="/ci_retry --"
|
2023-07-11 17:10:38 -04:00
|
|
|
|
2024-07-22 07:39:20 -04:00
|
|
|
pushd "/"
|
|
|
|
|
2020-12-17 07:42:09 -03:00
|
|
|
${CI_RETRY_EXE} apt-get update
|
2023-01-17 15:18:51 -03:00
|
|
|
# Lint dependencies:
|
2024-02-08 09:58:44 -03:00
|
|
|
# - automake pkg-config libtool (for lint_includes_build_config)
|
2023-01-17 15:18:51 -03:00
|
|
|
# - curl/xz-utils (to install shellcheck)
|
|
|
|
# - git (used in many lint scripts)
|
|
|
|
# - gpg (used by verify-commits)
|
2024-02-08 09:58:44 -03:00
|
|
|
${CI_RETRY_EXE} apt-get install -y automake pkg-config libtool curl xz-utils git gpg
|
2023-01-16 10:29:44 -03:00
|
|
|
|
2023-07-16 06:01:25 -04:00
|
|
|
PYTHON_PATH="/python_build"
|
|
|
|
if [ ! -d "${PYTHON_PATH}/bin" ]; then
|
|
|
|
(
|
2024-07-22 11:40:58 -04:00
|
|
|
${CI_RETRY_EXE} git clone --depth=1 https://github.com/pyenv/pyenv.git
|
2023-07-16 06:01:25 -04:00
|
|
|
cd pyenv/plugins/python-build || exit 1
|
|
|
|
./install.sh
|
|
|
|
)
|
|
|
|
# For dependencies see https://github.com/pyenv/pyenv/wiki#suggested-build-environment
|
|
|
|
${CI_RETRY_EXE} apt-get install -y build-essential libssl-dev zlib1g-dev \
|
|
|
|
libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
|
|
|
|
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
|
|
|
clang
|
2024-07-22 07:39:20 -04:00
|
|
|
env CC=clang python-build "$(cat "/.python-version")" "${PYTHON_PATH}"
|
2023-01-16 10:29:44 -03:00
|
|
|
fi
|
2023-07-16 06:01:25 -04:00
|
|
|
export PATH="${PYTHON_PATH}/bin:${PATH}"
|
|
|
|
command -v python3
|
|
|
|
python3 --version
|
2020-06-27 11:43:49 -04:00
|
|
|
|
2023-02-14 13:42:12 -03:00
|
|
|
export LINT_RUNNER_PATH="/lint_test_runner"
|
|
|
|
if [ ! -d "${LINT_RUNNER_PATH}" ]; then
|
|
|
|
${CI_RETRY_EXE} apt-get install -y cargo
|
|
|
|
(
|
2024-07-22 07:39:20 -04:00
|
|
|
cd "/test/lint/test_runner" || exit 1
|
2023-02-14 13:42:12 -03:00
|
|
|
cargo build
|
|
|
|
mkdir -p "${LINT_RUNNER_PATH}"
|
|
|
|
mv target/debug/test_runner "${LINT_RUNNER_PATH}"
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2023-07-16 06:01:25 -04:00
|
|
|
${CI_RETRY_EXE} pip3 install \
|
2024-03-26 13:49:15 -03:00
|
|
|
codespell==2.2.6 \
|
2023-07-31 14:10:06 -04:00
|
|
|
flake8==6.1.0 \
|
2023-07-16 06:01:25 -04:00
|
|
|
lief==0.13.2 \
|
|
|
|
mypy==1.4.1 \
|
|
|
|
pyzmq==25.1.0 \
|
|
|
|
vulture==2.6
|
2019-10-17 11:46:08 -03:00
|
|
|
|
2021-11-30 10:55:33 -03:00
|
|
|
SHELLCHECK_VERSION=v0.8.0
|
2023-01-17 13:52:05 -03:00
|
|
|
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | \
|
|
|
|
tar --xz -xf - --directory /tmp/
|
|
|
|
mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
|
2024-05-07 10:37:31 -04:00
|
|
|
|
2024-07-02 16:16:03 -04:00
|
|
|
MLC_VERSION=v0.18.0
|
2024-05-07 10:37:31 -04:00
|
|
|
MLC_BIN=mlc-x86_64-linux
|
|
|
|
curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
|
|
|
|
chmod +x /usr/bin/mlc
|
2024-07-22 07:39:20 -04:00
|
|
|
|
|
|
|
popd || exit
|