Skip to content

Commit 98537a0

Browse files
committed
Merge bitcoin/bitcoin#30499: lint: Use consistent out-of-tree build for python and test_runner
fa8d73e lint: Use consistent out-of-tree build for python and test_runner (MarcoFalke) fa0f859 doc: Clarify intent of ./ci/lint_run_all.sh (MarcoFalke) fa9ad59 lint: Use $CI_RETRY_EXE when building ./ci/lint_imagefile (MarcoFalke) Pull request description: Fixes bitcoin/bitcoin#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 bitcoin/bitcoin@fa8d73e willcl-ark: utACK fa8d73e paplorinc: utACK fa8d73e Tree-SHA512: 4181ca14299a798850f5e05f180f3305a3378081ca8dabf6ab2da6115997cc17f6ef0f10db9b2b31618e59231083e5c4a971432d27b4d77903e655be21155abb
2 parents 3a29ff5 + fa8d73e commit 98537a0

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

ci/lint/04_install.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright (c) 2018-2022 The Bitcoin Core developers
3+
# Copyright (c) 2018-present The Bitcoin Core developers
44
# Distributed under the MIT software license, see the accompanying
55
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
66

77
export LC_ALL=C
88

9-
export PATH=$PWD/ci/retry:$PATH
9+
export CI_RETRY_EXE="/ci_retry --"
10+
11+
pushd "/"
1012

1113
${CI_RETRY_EXE} apt-get update
1214
# Lint dependencies:
@@ -28,7 +30,7 @@ if [ ! -d "${PYTHON_PATH}/bin" ]; then
2830
libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
2931
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
3032
clang
31-
env CC=clang python-build "$(cat "./.python-version")" "${PYTHON_PATH}"
33+
env CC=clang python-build "$(cat "/.python-version")" "${PYTHON_PATH}"
3234
fi
3335
export PATH="${PYTHON_PATH}/bin:${PATH}"
3436
command -v python3
@@ -38,7 +40,7 @@ export LINT_RUNNER_PATH="/lint_test_runner"
3840
if [ ! -d "${LINT_RUNNER_PATH}" ]; then
3941
${CI_RETRY_EXE} apt-get install -y cargo
4042
(
41-
cd ./test/lint/test_runner || exit 1
43+
cd "/test/lint/test_runner" || exit 1
4244
cargo build
4345
mkdir -p "${LINT_RUNNER_PATH}"
4446
mv target/debug/test_runner "${LINT_RUNNER_PATH}"
@@ -62,3 +64,5 @@ MLC_VERSION=v0.18.0
6264
MLC_BIN=mlc-x86_64-linux
6365
curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
6466
chmod +x /usr/bin/mlc
67+
68+
popd || exit

ci/lint_imagefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM debian:bookworm
99
ENV DEBIAN_FRONTEND=noninteractive
1010
ENV LC_ALL=C.UTF-8
1111

12+
COPY ./ci/retry/retry /ci_retry
1213
COPY ./.python-version /.python-version
1314
COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh
1415
COPY ./ci/lint/04_install.sh /install.sh

ci/lint_run_all.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright (c) 2019-2020 The Bitcoin Core developers
3+
# Copyright (c) 2019-present The Bitcoin Core developers
44
# Distributed under the MIT software license, see the accompanying
55
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
66

77
export LC_ALL=C.UTF-8
88

9-
set -o errexit; source ./ci/test/00_setup_env.sh
9+
# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
10+
11+
cp "./ci/retry/retry" "/ci_retry"
12+
cp "./.python-version" "/.python-version"
13+
mkdir --parents "/test/lint"
14+
cp --recursive "./test/lint/test_runner" "/test/lint/"
1015
set -o errexit; source ./ci/lint/04_install.sh
1116
set -o errexit
1217
./ci/lint/06_script.sh

0 commit comments

Comments
 (0)