Merge bitcoin/bitcoin#30499: lint: Use consistent out-of-tree build for python and test_runner

fa8d73e86e lint: Use consistent out-of-tree build for python and test_runner (MarcoFalke)
fa0f859885 doc: Clarify intent of ./ci/lint_run_all.sh (MarcoFalke)
fa9ad59f87 lint: Use $CI_RETRY_EXE when building ./ci/lint_imagefile (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/30496

  Seems odd to sometimes do an out-of-tree build (via `./ci/lint_imagefile`, see `test/lint/README.md`) and sometimes not (via Cirrus CI, see `./ci/lint_run_all.sh`).

  Fix it by doing an out-of-tree build consistently in the same location.

  Also, fix `$CI_RETRY_EXE`, while touching this.

ACKs for top commit:
  josibake:
    utACK fa8d73e86e
  willcl-ark:
    utACK fa8d73e86e
  paplorinc:
    utACK fa8d73e86e

Tree-SHA512: 4181ca14299a798850f5e05f180f3305a3378081ca8dabf6ab2da6115997cc17f6ef0f10db9b2b31618e59231083e5c4a971432d27b4d77903e655be21155abb
pull/30501/head
merge-script 4 months ago
commit 98537a0212
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -1,12 +1,14 @@
#!/usr/bin/env bash
#
# Copyright (c) 2018-2022 The Bitcoin Core developers
# Copyright (c) 2018-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C
export PATH=$PWD/ci/retry:$PATH
export CI_RETRY_EXE="/ci_retry --"
pushd "/"
${CI_RETRY_EXE} apt-get update
# Lint dependencies:
@ -28,7 +30,7 @@ if [ ! -d "${PYTHON_PATH}/bin" ]; then
libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
clang
env CC=clang python-build "$(cat "./.python-version")" "${PYTHON_PATH}"
env CC=clang python-build "$(cat "/.python-version")" "${PYTHON_PATH}"
fi
export PATH="${PYTHON_PATH}/bin:${PATH}"
command -v python3
@ -38,7 +40,7 @@ export LINT_RUNNER_PATH="/lint_test_runner"
if [ ! -d "${LINT_RUNNER_PATH}" ]; then
${CI_RETRY_EXE} apt-get install -y cargo
(
cd ./test/lint/test_runner || exit 1
cd "/test/lint/test_runner" || exit 1
cargo build
mkdir -p "${LINT_RUNNER_PATH}"
mv target/debug/test_runner "${LINT_RUNNER_PATH}"
@ -62,3 +64,5 @@ MLC_VERSION=v0.18.0
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
popd || exit

@ -9,6 +9,7 @@ FROM debian:bookworm
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
COPY ./ci/retry/retry /ci_retry
COPY ./.python-version /.python-version
COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh
COPY ./ci/lint/04_install.sh /install.sh

@ -1,12 +1,17 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Copyright (c) 2019-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C.UTF-8
set -o errexit; source ./ci/test/00_setup_env.sh
# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
cp "./ci/retry/retry" "/ci_retry"
cp "./.python-version" "/.python-version"
mkdir --parents "/test/lint"
cp --recursive "./test/lint/test_runner" "/test/lint/"
set -o errexit; source ./ci/lint/04_install.sh
set -o errexit
./ci/lint/06_script.sh

Loading…
Cancel
Save