Remove TRACK_DEPENDS

This was added in 2012 with I89677fd54635e82b10ab674ddeb9ffb3f1a755f0,
but I can not see it being used anywhere currently.

It's use of virtualenv's has become problematic in a python2
deprecated world, but since it is not used, remove it to avoid further
confusion.

Change-Id: I65d44d24f449436ca6229928eee2c5a021793055
This commit is contained in:
Ian Wienand 2020-01-13 16:31:20 +11:00
parent 4143ce6fc9
commit bcb2c30c31
3 changed files with 22 additions and 61 deletions

View File

@ -27,7 +27,6 @@
# - ``RECLONE`` # - ``RECLONE``
# - ``REQUIREMENTS_DIR`` # - ``REQUIREMENTS_DIR``
# - ``STACK_USER`` # - ``STACK_USER``
# - ``TRACK_DEPENDS``
# - ``http_proxy``, ``https_proxy``, ``no_proxy`` # - ``http_proxy``, ``https_proxy``, ``no_proxy``
# #
@ -44,7 +43,6 @@ declare -A -g GITREPO
declare -A -g GITBRANCH declare -A -g GITBRANCH
declare -A -g GITDIR declare -A -g GITDIR
TRACK_DEPENDS=${TRACK_DEPENDS:-False}
KILL_PATH="$(which kill)" KILL_PATH="$(which kill)"
# Save these variables to .stackenv # Save these variables to .stackenv
@ -2075,11 +2073,7 @@ function _safe_permission_operation {
return 0 return 0
fi fi
if [[ $TRACK_DEPENDS = True ]]; then sudo_cmd="sudo"
sudo_cmd="env"
else
sudo_cmd="sudo"
fi
$xtrace $xtrace
$sudo_cmd $@ $sudo_cmd $@

View File

@ -175,7 +175,7 @@ function disable_python3_package {
# Wrapper for ``pip install`` to set cache and proxy environment variables # Wrapper for ``pip install`` to set cache and proxy environment variables
# Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``, # Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``,
# ``PIP_UPGRADE``, ``TRACK_DEPENDS``, ``*_proxy``, # ``PIP_UPGRADE``, ``*_proxy``,
# Usage: # Usage:
# pip_install pip_arguments # pip_install pip_arguments
function pip_install { function pip_install {
@ -219,37 +219,28 @@ function pip_install {
# this works (for now...) # this works (for now...)
local package_dir=${!#%\[*\]} local package_dir=${!#%\[*\]}
if [[ $TRACK_DEPENDS = True && ! "$@" =~ virtualenv ]]; then if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then
# TRACK_DEPENDS=True installation creates a circular dependency when local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip
# we attempt to install virtualenv into a virtualenv, so we must global
# that installation.
source $DEST/.venv/bin/activate
local cmd_pip=$DEST/.venv/bin/pip
local sudo_pip="env" local sudo_pip="env"
else else
if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then local cmd_pip
local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip cmd_pip=$(get_pip_command $PYTHON2_VERSION)
local sudo_pip="env" local sudo_pip="sudo -H"
else if python3_enabled; then
local cmd_pip # Special case some services that have experimental
cmd_pip=$(get_pip_command $PYTHON2_VERSION) # support for python3 in progress, but don't claim support
local sudo_pip="sudo -H" # in their classifier
if python3_enabled; then echo "Check python version for : $package_dir"
# Special case some services that have experimental if python3_disabled_for ${package_dir##*/}; then
# support for python3 in progress, but don't claim support echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES"
# in their classifier else
echo "Check python version for : $package_dir" # For everything that is not explicitly blacklisted with
if python3_disabled_for ${package_dir##*/}; then # DISABLED_PYTHON3_PACKAGES, assume it supports python3
echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES" # and we will let pip sort out the install, regardless of
else # the package being local or remote.
# For everything that is not explicitly blacklisted with echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
# DISABLED_PYTHON3_PACKAGES, assume it supports python3 sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
# and we will let pip sort out the install, regardless of cmd_pip=$(get_pip_command $PYTHON3_VERSION)
# the package being local or remote.
echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
cmd_pip=$(get_pip_command $PYTHON3_VERSION)
fi
fi fi
fi fi
fi fi

View File

@ -796,19 +796,6 @@ if [[ "$OFFLINE" != "True" ]]; then
PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh
fi fi
TRACK_DEPENDS=${TRACK_DEPENDS:-False}
# Install Python packages into a virtualenv so that we can track them
if [[ $TRACK_DEPENDS = True ]]; then
echo_summary "Installing Python packages into a virtualenv $DEST/.venv"
pip_install -U virtualenv
rm -rf $DEST/.venv
virtualenv --system-site-packages $DEST/.venv
source $DEST/.venv/bin/activate
$DEST/.venv/bin/pip freeze > $DEST/requires-pre-pip
fi
# Do the ugly hacks for broken packages and distros # Do the ugly hacks for broken packages and distros
source $TOP_DIR/tools/fixup_stuff.sh source $TOP_DIR/tools/fixup_stuff.sh
fixup_all fixup_all
@ -997,17 +984,6 @@ fi
# osc commands. Alias dies with stack.sh. # osc commands. Alias dies with stack.sh.
install_oscwrap install_oscwrap
if [[ $TRACK_DEPENDS = True ]]; then
$DEST/.venv/bin/pip freeze > $DEST/requires-post-pip
if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff; then
echo "Detect some changes for installed packages of pip, in depend tracking mode"
cat $DEST/requires.diff
fi
echo "Ran stack.sh in depend tracking mode, bailing out now"
exit 0
fi
# Syslog # Syslog
# ------ # ------