Skip to content

Commit fa8d73e

Browse files
author
MarcoFalke
committedJul 22, 2024
lint: Use consistent out-of-tree build for python and test_runner
This mirrors the build by ./ci/lint_imagefile, which is done out-of-tree in "/". Otherwise, there could be errors due to a dirty tree.
1 parent fa0f859 commit fa8d73e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎ci/lint/04_install.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export LC_ALL=C
88

99
export CI_RETRY_EXE="/ci_retry --"
1010

11+
pushd "/"
12+
1113
${CI_RETRY_EXE} apt-get update
1214
# Lint dependencies:
1315
# - automake pkg-config libtool (for lint_includes_build_config)
@@ -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_run_all.sh

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export LC_ALL=C.UTF-8
99
# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
1010

1111
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/"
1215
set -o errexit; source ./ci/lint/04_install.sh
1316
set -o errexit
1417
./ci/lint/06_script.sh

0 commit comments

Comments
 (0)
Please sign in to comment.