Skip to content

Commit

Permalink
Unify around PANTS_NO_NATIVE_CLIENT in both scie-pants and the `p…
Browse files Browse the repository at this point in the history
…ants` repo.
  • Loading branch information
stuhood committed May 9, 2023
1 parent 2ee568a commit 7784f9a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pants
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ function exec_pants_bare() {
activate_pants_venv 1>&2
bootstrap_native_code 1>&2

if [ -n "${USE_NATIVE_PANTS}" ]; then
if [ -n "${PANTS_DEBUG}" ]; then
if [[ "$*" != *"--no-pantsd"* ]]; then
echo "Error! Must pass '--no-pantsd' when using PANTS_DEBUG"
exit 1
fi
DEBUG_ARGS="-m debugpy --listen 127.0.0.1:5678 --wait-for-client"
echo "Will launch debugpy server at '127.0.0.1:5678' waiting for client connection."
fi

if [ -z "${PANTS_NO_NATIVE_CLIENT}" ]; then
set +e
"${NATIVE_CLIENT_BINARY}" "$@"
result=$?
Expand All @@ -62,15 +71,6 @@ function exec_pants_bare() {
set -e
fi

if [ -n "${PANTS_DEBUG}" ]; then
if [[ "$*" != *"--no-pantsd"* ]]; then
echo "Error! Must pass '--no-pantsd' when using PANTS_DEBUG"
exit 1
fi
DEBUG_ARGS="-m debugpy --listen 127.0.0.1:5678 --wait-for-client"
echo "Will launch debugpy server at '127.0.0.1:5678' waiting for client connection."
fi

# shellcheck disable=SC2086
PYTHONPATH="${PANTS_SRCPATH}:${PYTHONPATH}" RUNNING_PANTS_FROM_SOURCES=1 \
exec ${PANTS_PREPEND_ARGS:-} "$(venv_dir)/bin/python" ${DEBUG_ARGS} "${PANTS_PY_EXE}" "$@"
Expand Down

0 comments on commit 7784f9a

Please sign in to comment.