aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-07-16 12:01:25 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-07-16 13:18:18 +0200
commitfa2f18ad8e386f067c2d7d5362f6b4dd84c295a0 (patch)
tree6205699c7099c78311bbc02a745f4ed668751688 /ci
parent01e5d6b105861ebf1216df6f1682004e44dd2544 (diff)
downloadbitcoin-fa2f18ad8e386f067c2d7d5362f6b4dd84c295a0.tar.xz
ci: Use DOCKER_BUILDKIT for lint image
Can be reviewed with: --color-moved=dimmed-zebra --ignore-all-space
Diffstat (limited to 'ci')
-rwxr-xr-xci/lint/04_install.sh47
-rw-r--r--ci/lint/Dockerfile29
-rwxr-xr-xci/lint/docker-entrypoint.sh2
-rw-r--r--ci/lint_imagefile19
4 files changed, 44 insertions, 53 deletions
diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh
index b3b1c91ee0..148819f468 100755
--- a/ci/lint/04_install.sh
+++ b/ci/lint/04_install.sh
@@ -13,32 +13,31 @@ ${CI_RETRY_EXE} apt-get update
# - gpg (used by verify-commits)
${CI_RETRY_EXE} apt-get install -y curl xz-utils git gpg
-if [ -z "${SKIP_PYTHON_INSTALL}" ]; then
- PYTHON_PATH=/tmp/python
- if [ ! -d "${PYTHON_PATH}/bin" ]; then
- (
- git clone https://github.com/pyenv/pyenv.git
- 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
- env CC=clang python-build "$(cat "${BASE_ROOT_DIR}/.python-version")" "${PYTHON_PATH}"
- fi
- export PATH="${PYTHON_PATH}/bin:${PATH}"
- command -v python3
- python3 --version
+PYTHON_PATH="/python_build"
+if [ ! -d "${PYTHON_PATH}/bin" ]; then
+ (
+ git clone https://github.com/pyenv/pyenv.git
+ 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
+ env CC=clang python-build "$(cat "./.python-version")" "${PYTHON_PATH}"
fi
+export PATH="${PYTHON_PATH}/bin:${PATH}"
+command -v python3
+python3 --version
-${CI_RETRY_EXE} pip3 install codespell==2.2.5
-${CI_RETRY_EXE} pip3 install flake8==6.0.0
-${CI_RETRY_EXE} pip3 install lief==0.13.2
-${CI_RETRY_EXE} pip3 install mypy==1.4.1
-${CI_RETRY_EXE} pip3 install pyzmq==25.1.0
-${CI_RETRY_EXE} pip3 install vulture==2.6
+${CI_RETRY_EXE} pip3 install \
+ codespell==2.2.5 \
+ flake8==6.0.0 \
+ lief==0.13.2 \
+ mypy==1.4.1 \
+ pyzmq==25.1.0 \
+ vulture==2.6
SHELLCHECK_VERSION=v0.8.0
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | \
diff --git a/ci/lint/Dockerfile b/ci/lint/Dockerfile
deleted file mode 100644
index a0a4516480..0000000000
--- a/ci/lint/Dockerfile
+++ /dev/null
@@ -1,29 +0,0 @@
-# See test/lint/README.md for usage.
-#
-# This container basically has to live in this directory in order to pull in the CI
-# install scripts. If it lived in the root directory, it would have to pull in the
-# entire repo as docker context during build; if it lived elsewhere, it wouldn't be
-# able to make back-references to pull in the install scripts. So here it lives.
-
-FROM python:3.8-buster
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LC_ALL=C.UTF-8
-
-# This is used by the 04_install.sh script; we can't read the Python version from
-# .python-version for the same reasons as above, and it's more efficient to pull a
-# preexisting Python image than it is to build from source.
-ENV SKIP_PYTHON_INSTALL=1
-
-# Must be built from ./ci/lint/ for these paths to work.
-COPY ./docker-entrypoint.sh /entrypoint.sh
-COPY ./04_install.sh /install.sh
-
-RUN /install.sh && \
- echo 'alias lint="./ci/lint/06_script.sh"' >> ~/.bashrc && \
- chmod 755 /entrypoint.sh && \
- rm -rf /var/lib/apt/lists/*
-
-
-WORKDIR /bitcoin
-ENTRYPOINT ["/entrypoint.sh"]
diff --git a/ci/lint/docker-entrypoint.sh b/ci/lint/docker-entrypoint.sh
index 3fdbbb0761..63bd2d4298 100755
--- a/ci/lint/docker-entrypoint.sh
+++ b/ci/lint/docker-entrypoint.sh
@@ -5,6 +5,8 @@ export LC_ALL=C
# of the mounted bitcoin src dir.
git config --global --add safe.directory /bitcoin
+export PATH="/python_build/bin:${PATH}"
+
if [ -z "$1" ]; then
LOCAL_BRANCH=1 bash -ic "./ci/lint/06_script.sh"
else
diff --git a/ci/lint_imagefile b/ci/lint_imagefile
new file mode 100644
index 0000000000..20047ea391
--- /dev/null
+++ b/ci/lint_imagefile
@@ -0,0 +1,19 @@
+# See test/lint/README.md for usage.
+
+FROM debian:bookworm
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV LC_ALL=C.UTF-8
+
+COPY ./.python-version /.python-version
+COPY ./ci/lint/docker-entrypoint.sh /entrypoint.sh
+COPY ./ci/lint/04_install.sh /install.sh
+
+RUN /install.sh && \
+ echo 'alias lint="./ci/lint/06_script.sh"' >> ~/.bashrc && \
+ chmod 755 /entrypoint.sh && \
+ rm -rf /var/lib/apt/lists/*
+
+
+WORKDIR /bitcoin
+ENTRYPOINT ["/entrypoint.sh"]