Skip to content

Commit 6a3c570

Browse files
committed
[sanitizers] Move "Prepare" step before "Info" and fix venv path
Moving "Prepare" before "Info" allows the "Info" step to report the correct python version from the virtual environment. Also fixes the venv directory name to use an underscore (`llvm_venv`) consistently and ensures it is excluded from clobbering.
1 parent 19b30ec commit 6a3c570

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

zorg/buildbot/builders/sanitizers/buildbot_functions.sh

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ function include_config() {
4646

4747
include_config
4848

49+
build_step "Prepare"
50+
51+
export LIT_OPTS="--time-tests"
52+
53+
{
54+
[[ -f llvm_venv/bin/activate ]] || python3 -m venv llvm_venv
55+
. llvm_venv/bin/activate
56+
pip install --upgrade pip
57+
pip install psutil pyyaml Pygments
58+
59+
CMAKE_COMMON_OPTIONS+=" -DPython3_EXECUTABLE=$(which python)"
60+
} || build_exception
61+
62+
LIT_OPTS+=" --timeout=900"
63+
64+
CMAKE="$(which cmake)"
65+
4966
build_step "Info"
5067
(
5168
set +e
@@ -65,6 +82,9 @@ build_step "Info"
6582
echo
6683
cmake --version
6784
echo
85+
which python
86+
python --version
87+
echo
6888
uname -a
6989
echo
7090
ldd --version
@@ -76,25 +96,6 @@ build_step "Info"
7696
hostname -f
7797
)
7898

79-
build_step "Prepare"
80-
81-
82-
export LIT_OPTS="--time-tests"
83-
84-
{
85-
[[ -f llvm-venv/bin/activate ]] || python3 -m venv llvm-venv
86-
. llvm-venv/bin/activate
87-
pip install --upgrade pip
88-
pip install psutil pyyaml Pygments
89-
90-
$ROOT/llvm-venv/bin/python --version
91-
CMAKE_COMMON_OPTIONS+=" -DPython3_EXECUTABLE=$ROOT/llvm-venv/bin/python"
92-
} || build_exception
93-
94-
LIT_OPTS+=" --timeout=900"
95-
96-
CMAKE="$(which cmake)"
97-
9899
function cmake() {
99100
(
100101
set -x
@@ -126,7 +127,7 @@ function clobber {
126127
exit 1
127128
fi
128129
# Keep sources in ./llvm-project and ./llvm_build0 for faster builds.
129-
find . -maxdepth 1 -mindepth 1 -path ./llvm-project -prune -o -path ./llvm_build0 -prune -o -print -exec rm -rf {} \;
130+
find . -maxdepth 1 -mindepth 1 -path ./llvm-project -prune -o -path ./llvm_build0 -prune -o -path ./llvm_venv -prune -o -print -exec rm -rf {} \;
130131
du -hs ./* | sort -h
131132
return 0
132133
else

0 commit comments

Comments
 (0)