Skip to content

Commit b885060

Browse files
MarcoFalkeUdjinM6
MarcoFalke
authored andcommitted
Merge bitcoin#17549: ci: misc cleanups
fad88e6 ci: Remove use of cd (MarcoFalke) fa2941b ci: Remove unmaintained extended_lint (MarcoFalke) fa04187 scripted-diff: Use ci DEPENDS_DIR, remove BASE_BUILD_DIR (MarcoFalke) fa0656d ci: Add DEPENDS_DIR variable, Add documentation for folders (MarcoFalke) faeeca8 scripted-diff: Move various folders to ci scratch dir (MarcoFalke) Pull request description: Some minor cleanups: * Remove unused and unmaintained extended_lint to avoid ci bottlenecks and waste of CPU * Move all folders that hold temporary ci files to the ci scratch dir (except for the build dirs) * Add some documentation to folders and remove the `BASE_BUILD_DIR` alias for the root directory * Fixes bitcoin#17178 by removing `cd` Top commit has no ACKs. Tree-SHA512: f6eb9d47ab98c08af59a79c2a4bf62fc331f0f6f3174909a28f2c2f48b0234423da5aee876225d2e188619b71b008d882a20d29a7aca68248039ea5080be5af5
1 parent 5066e83 commit b885060

11 files changed

+32
-63
lines changed

.travis.yml

-13
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,6 @@ after_success:
212212
script:
213213
- set -o errexit; source ./ci/lint/06_script.sh
214214

215-
- stage: extended-lint
216-
name: 'extended lint [runtime >= 60 seconds]'
217-
env:
218-
cache: false
219-
language: python
220-
python: '3.5'
221-
install:
222-
- set -o errexit; source ./ci/extended_lint/04_install.sh
223-
before_script:
224-
- set -o errexit; source ./ci/lint/05_before_script.sh
225-
script:
226-
- set -o errexit; source ./ci/extended_lint/06_script.sh
227-
228215
- stage: test
229216
name: 'ARM [GOAL: install] [bionic] [unit tests, functional tests]'
230217
arch: arm64

ci/dash/build-docker.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ DOCKER_IMAGE=${DOCKER_IMAGE:-dashpay/dashd-develop}
1212
DOCKER_TAG=${DOCKER_TAG:-latest}
1313
DOCKER_RELATIVE_PATH=contrib/containers/deploy
1414

15-
BASE_BUILD_DIR=${BASE_BUILD_DIR:-.}
16-
17-
1815
if [ -d $DOCKER_RELATIVE_PATH/bin ]; then
1916
rm $DOCKER_RELATIVE_PATH/bin/*
2017
fi
2118

2219
mkdir $DOCKER_RELATIVE_PATH/bin
23-
cp "$BASE_BUILD_DIR"/src/dashd $DOCKER_RELATIVE_PATH/bin/
24-
cp "$BASE_BUILD_DIR"/src/dash-cli $DOCKER_RELATIVE_PATH/bin/
25-
cp "$BASE_BUILD_DIR"/src/dash-tx $DOCKER_RELATIVE_PATH/bin/
20+
cp "$BASE_ROOT_DIR"/src/dashd $DOCKER_RELATIVE_PATH/bin/
21+
cp "$BASE_ROOT_DIR"/src/dash-cli $DOCKER_RELATIVE_PATH/bin/
22+
cp "$BASE_ROOT_DIR"/src/dash-tx $DOCKER_RELATIVE_PATH/bin/
2623
strip $DOCKER_RELATIVE_PATH/bin/dashd
2724
strip $DOCKER_RELATIVE_PATH/bin/dash-cli
2825
strip $DOCKER_RELATIVE_PATH/bin/dash-tx

ci/dash/build_depends.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ unset DISPLAY
1717
mkdir -p $CACHE_DIR/depends
1818
mkdir -p $CACHE_DIR/sdk-sources
1919

20-
ln -s $CACHE_DIR/depends depends/built
21-
ln -s $CACHE_DIR/sdk-sources depends/sdk-sources
20+
ln -s $CACHE_DIR/depends ${DEPENDS_DIR}/built
21+
ln -s $CACHE_DIR/sdk-sources ${DEPENDS_DIR}/sdk-sources
2222

23-
mkdir -p depends/SDKs
23+
mkdir -p ${DEPENDS_DIR}/SDKs
2424

2525
if [ -n "$XCODE_VERSION" ]; then
2626
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
27-
OSX_SDK_PATH="depends/sdk-sources/${OSX_SDK_BASENAME}"
27+
OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}"
2828
if [ ! -f "$OSX_SDK_PATH" ]; then
2929
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
3030
fi
3131
if [ -f "$OSX_SDK_PATH" ]; then
32-
tar -C depends/SDKs -xf "$OSX_SDK_PATH"
32+
tar -C ${DEPENDS_DIR}/SDKs -xf "$OSX_SDK_PATH"
3333
fi
3434
fi
3535

ci/dash/build_src.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if [ -n "$CONFIG_SHELL" ]; then
4040
export CONFIG_SHELL="$CONFIG_SHELL"
4141
fi
4242

43-
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$BASE_BUILD_DIR/depends/$HOST --bindir=$BASE_OUTDIR/bin --libdir=$BASE_OUTDIR/lib"
43+
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$DEPENDS_DIR/$HOST --bindir=$BASE_OUTDIR/bin --libdir=$BASE_OUTDIR/lib"
4444

4545
( test -n "$CONFIG_SHELL" && eval '"$CONFIG_SHELL" -c "./autogen.sh"' ) || ./autogen.sh
4646

ci/dash/test_integrationtests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ "$RUN_INTEGRATION_TESTS" != "true" ]; then
1818
exit 0
1919
fi
2020

21-
export LD_LIBRARY_PATH=$BASE_BUILD_DIR/depends/$HOST/lib
21+
export LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib
2222

2323
cd build-ci/dashcore-$BUILD_TARGET
2424

ci/dash/test_unittests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ "$RUN_UNIT_TESTS" != "true" ]; then
1717
fi
1818

1919
export BOOST_TEST_RANDOM=${BOOST_TEST_RANDOM:-1}
20-
export LD_LIBRARY_PATH=$BASE_BUILD_DIR/depends/$HOST/lib
20+
export LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib
2121

2222
export WINEDEBUG=fixme-all
2323
export BOOST_TEST_LOG_LEVEL=test_suite

ci/extended_lint/04_install.sh

-12
This file was deleted.

ci/extended_lint/06_script.sh

-9
This file was deleted.

ci/test/00_setup_env.sh

+9-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ echo "Fallback to default values in env (if not yet set)"
2828
MAKEJOBS="-j$(nproc)"
2929
export MAKEJOBS
3030
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...)
31+
# This folder only exists on the ci host.
3132
export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch/}
3233
# What host to compile for. See also ./depends/README.md
3334
# Tests that need cross-compilation export the appropriate HOST.
@@ -47,16 +48,19 @@ export CACHE_DIR=${CACHE_DIR:-$HOST_CACHE_DIR}
4748
export CCACHE_SIZE=${CCACHE_SIZE:-100M}
4849
export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-/tmp/.ccache-temp}
4950
export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
51+
# The cache dir.
52+
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
5053
export CCACHE_DIR=${CCACHE_DIR:-$CACHE_DIR/ccache}
51-
# Folder where the build is done (depends and dist). Can not be changed and is equal to the root of the git repo
52-
export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_ROOT_DIR}
53-
# Folder where the build is done (bin and lib). Can not be changed.
54-
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_BUILD_DIR/out}
54+
# The depends dir.
55+
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
56+
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
57+
# Folder where the build is done (bin and lib).
58+
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
5559
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
5660
export WINEDEBUG=${WINEDEBUG:-fixme-all}
5761
export DOCKER_PACKAGES=${DOCKER_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git}
5862
export GOAL=${GOAL:-install}
59-
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_BUILD_DIR}/qa-assets}
63+
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
6064
export PATH=${BASE_ROOT_DIR}/ci/retry:$PATH
6165
export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}
6266
# Dash's Docker-specifics

ci/test/04_install.sh

+10-8
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,27 @@ elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (A
5151
DOCKER_ADMIN="--cap-add SYS_PTRACE"
5252
fi
5353

54+
export P_CI_DIR="$PWD"
55+
5456
if [ -z "$RUN_CI_ON_HOST" ]; then
5557
echo "Creating $DOCKER_NAME_TAG container to run in"
5658
${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG"
5759

5860
DOCKER_ID=$(docker run $DOCKER_ADMIN -idt \
59-
--mount type=bind,src=$BASE_BUILD_DIR,dst=/ro_base,readonly \
61+
--mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \
6062
--mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \
61-
--mount type=bind,src=$BASE_BUILD_DIR/depends,dst=$BASE_BUILD_DIR/depends \
62-
-w $BASE_BUILD_DIR \
63+
--mount type=bind,src=$DEPENDS_DIR,dst=$DEPENDS_DIR \
64+
-w $BASE_ROOT_DIR \
6365
--env-file /tmp/env \
6466
$DOCKER_NAME_TAG)
6567

6668
DOCKER_EXEC () {
67-
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
69+
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
6870
}
6971
else
7072
echo "Running on host system without docker wrapper"
7173
DOCKER_EXEC () {
72-
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
74+
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
7375
}
7476
fi
7577
export -f DOCKER_EXEC
@@ -101,11 +103,11 @@ if [ ! -d ${DIR_QA_ASSETS} ]; then
101103
fi
102104
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
103105

104-
DOCKER_EXEC mkdir -p "${BASE_BUILD_DIR}/sanitizer-output/"
106+
DOCKER_EXEC mkdir -p "${BASE_SCRATCH_DIR}/sanitizer-output/"
105107

106108
if [ -z "$RUN_CI_ON_HOST" ]; then
107-
echo "Create $BASE_BUILD_DIR"
108-
DOCKER_EXEC rsync -a /ro_base/ $BASE_BUILD_DIR
109+
echo "Create $BASE_ROOT_DIR"
110+
DOCKER_EXEC rsync -a /ro_base/ $BASE_ROOT_DIR
109111
fi
110112

111113
if [ "$USE_BUSY_BOX" = "true" ]; then

ci/test/05_before_script.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ else
1313
DOCKER_EXEC echo \> \$HOME/.dashcore
1414
fi
1515

16-
DOCKER_EXEC mkdir -p depends/SDKs depends/sdk-sources
16+
DOCKER_EXEC mkdir -p ${DEPENDS_DIR}/SDKs ${DEPENDS_DIR}/sdk-sources
1717

1818
if [ -n "$XCODE_VERSION" ] && [ ! -f "$OSX_SDK_PATH" ]; then
1919
DOCKER_EXEC curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
2020
fi
2121
if [ -n "$XCODE_VERSION" ] && [ -f "$OSX_SDK_PATH" ]; then
22-
DOCKER_EXEC tar -C "depends/SDKs" -xf "$OSX_SDK_PATH"
22+
DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
2323
fi
2424
if [[ $HOST = *-mingw32 ]]; then
2525
DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\)

0 commit comments

Comments
 (0)