55if [[ -n " ${RULES_PYTHON_BOOTSTRAP_VERBOSE:- } " ]]; then
66 set -x
77fi
8- # # set -x
98
109# runfiles-relative path
1110STAGE2_BOOTSTRAP=" %stage2_bootstrap%"
@@ -147,7 +146,6 @@ if [[ "$IS_ZIPFILE" == "1" ]]; then
147146 mkdir -p " $( dirname $python_exe ) "
148147 ln -s " $symlink_to " " $python_exe "
149148elif [[ " $RECREATE_VENV_AT_RUNTIME " == " 1" ]]; then
150- runfiles_venv=" $RUNFILES_DIR /$( dirname $( dirname $PYTHON_BINARY ) ) "
151149
152150 if [[ -n " $RULES_PYTHON_EXTRACT_ROOT " ]]; then
153151 use_exec=1
@@ -166,9 +164,9 @@ elif [[ "$RECREATE_VENV_AT_RUNTIME" == "1" ]]; then
166164 fi
167165
168166 # Match the basename; some tools, e.g. pyvenv key off the executable name
169- venv_py_exe =" $venv /bin/$( basename $PYTHON_BINARY_ACTUAL ) "
167+ python_exe =" $venv /bin/$( basename $PYTHON_BINARY_ACTUAL ) "
170168
171- if [[ ! -e " $venv_py_exe " ]]; then
169+ if [[ ! -e " $python_exe " ]]; then
172170 if [[ " $PYTHON_BINARY_ACTUAL " == /* ]]; then
173171 # An absolute path, i.e. platform runtime, e.g. /usr/bin/python3
174172 symlink_to=$PYTHON_BINARY_ACTUAL
@@ -185,6 +183,7 @@ elif [[ "$RECREATE_VENV_AT_RUNTIME" == "1" ]]; then
185183 fi
186184 fi
187185
186+ runfiles_venv=" $RUNFILES_DIR /$( dirname $( dirname $PYTHON_BINARY ) ) "
188187 # When RESOLVE_PYTHON_BINARY_AT_RUNTIME is true, it means the toolchain
189188 # has thrown two complications at us:
190189 # 1. The build-time assumption of the Python version may not match the
230229 if [[ ! -e " $venv /pyvenv.cfg" ]]; then
231230 ln -s " $runfiles_venv /pyvenv.cfg" " $venv /pyvenv.cfg"
232231 fi
233-
234232else
235233 use_exec=1
236234fi
0 commit comments