Skip to content

Commit fae322a

Browse files
author
MarcoFalke
committed
ci: Slim down lint image
Currently, the lint_test_runner is built and installed into the lint CI image. This is problematic, because it triggers a full image build on every change to its source code. Doing a build of the lint test_runner on every run is easier and faster.
1 parent 3333273 commit fae322a

File tree

5 files changed

+3
-16
lines changed

5 files changed

+3
-16
lines changed

ci/lint/04_install.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ pushd "/"
1212

1313
${CI_RETRY_EXE} apt-get update
1414
# Lint dependencies:
15+
# - cargo (used to run the lint tests)
1516
# - curl/xz-utils (to install shellcheck)
1617
# - git (used in many lint scripts)
1718
# - gpg (used by verify-commits)
18-
${CI_RETRY_EXE} apt-get install -y curl xz-utils git gpg
19+
${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg
1920

2021
PYTHON_PATH="/python_build"
2122
if [ ! -d "${PYTHON_PATH}/bin" ]; then
@@ -35,17 +36,6 @@ export PATH="${PYTHON_PATH}/bin:${PATH}"
3536
command -v python3
3637
python3 --version
3738

38-
export LINT_RUNNER_PATH="/lint_test_runner"
39-
if [ ! -d "${LINT_RUNNER_PATH}" ]; then
40-
${CI_RETRY_EXE} apt-get install -y cargo
41-
(
42-
cd "/test/lint/test_runner" || exit 1
43-
cargo build
44-
mkdir -p "${LINT_RUNNER_PATH}"
45-
mv target/debug/test_runner "${LINT_RUNNER_PATH}"
46-
)
47-
fi
48-
4939
${CI_RETRY_EXE} pip3 install \
5040
codespell==2.2.6 \
5141
lief==0.13.2 \

ci/lint/06_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ -n "$CIRRUS_PR" ]; then
1616
fi
1717
fi
1818

19-
RUST_BACKTRACE=1 "${LINT_RUNNER_PATH}/test_runner"
19+
RUST_BACKTRACE=1 cargo run --manifest-path "./test/lint/test_runner/Cargo.toml"
2020

2121
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then
2222
# Sanity check only the last few commits to get notified of missing sigs,

ci/lint/container-entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export LC_ALL=C
1111
git config --global --add safe.directory /bitcoin
1212

1313
export PATH="/python_build/bin:${PATH}"
14-
export LINT_RUNNER_PATH="/lint_test_runner"
1514

1615
if [ -z "$1" ]; then
1716
bash -ic "./ci/lint/06_script.sh"

ci/lint_imagefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ COPY ./ci/retry/retry /ci_retry
1313
COPY ./.python-version /.python-version
1414
COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh
1515
COPY ./ci/lint/04_install.sh /install.sh
16-
COPY ./test/lint/test_runner /test/lint/test_runner
1716

1817
RUN /install.sh && \
1918
echo 'alias lint="./ci/lint/06_script.sh"' >> ~/.bashrc && \

ci/lint_run.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ set -o errexit -o pipefail -o xtrace
99

1010
# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
1111
export PATH="/python_build/bin:${PATH}"
12-
export LINT_RUNNER_PATH="/lint_test_runner"
1312
./ci/lint/06_script.sh

0 commit comments

Comments
 (0)