From 49a0bf2ef5142d11846eb8e463bc0685b8c0d56c Mon Sep 17 00:00:00 2001 From: Evan Pitstick Date: Thu, 24 Aug 2023 16:20:44 -0400 Subject: [PATCH 1/2] Additional verbosity when using PYENV_DEBUG I'm trying to figure out #2417 which hit me on 3.11.4 but not 3.11.3 which was well after other reports. Having a way to debug seems useful either way. Using `PYENV_DEBUG` may not seem like the best name but it works with the underlying tools which avoids possible compatibility problems in the future. --- bin/install | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/install b/bin/install index 3c4219c..60eb9b5 100755 --- a/bin/install +++ b/bin/install @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +[ -n "$PYENV_DEBUG" ] && set -x + source "$(dirname "$0")/utils.sh" @@ -8,6 +10,9 @@ install_python() { local install_type=$1 local version=$2 local install_path=$3 + local VERBOSE + + [ -n "$PYENV_DEBUG" ] && VERBOSE="-v" if [ "$install_type" != "version" ]; then echoerr "Cannot install specific ref from source, sorry." @@ -16,17 +21,17 @@ install_python() { fi install_or_update_python_build - if [[ -n "${ASDF_PYTHON_PATCH_URL:-}" ]]; then + if [[ -n "${ASDF_PYTHON_PATCH_URL:-}" ]]; then echo "python-build --patch $version $install_path" echo "with patch file from: $ASDF_PYTHON_PATCH_URL" - $(python_build_path) --patch "$version" "$install_path" < <(curl -sSL "$ASDF_PYTHON_PATCH_URL") + $(python_build_path) $VERBOSE --patch "$version" "$install_path" < <(curl -sSL "$ASDF_PYTHON_PATCH_URL") elif [[ -n "${ASDF_PYTHON_PATCHES_DIRECTORY:-}" ]] && [[ -f ${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch ]]; then local patch_file=${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch echo "python-build $version $install_path -p < $patch_file" - $(python_build_path) "$version" "$install_path" -p < $patch_file + $(python_build_path) $VERBOSE "$version" "$install_path" -p < $patch_file else echo "python-build $version $install_path" - $(python_build_path) "$version" "$install_path" + $(python_build_path) $VERBOSE "$version" "$install_path" fi } From a7b220bfc2bcc94387df681fd5e53f473e419996 Mon Sep 17 00:00:00 2001 From: Evan Pitstick Date: Thu, 24 Aug 2023 16:34:36 -0400 Subject: [PATCH 2/2] Add debugging info to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 7badb74..4f5e2d9 100644 --- a/README.md +++ b/README.md @@ -70,3 +70,12 @@ pipenv ``` You can specify a non-default location of this file by setting a `ASDF_PYTHON_DEFAULT_PACKAGES_FILE` variable. + +## Debugging + +You can get more verbose information about a python installation by setting `PYENV_DEBUG`, for example: + +``` +PYENV_DEBUG=1 asdf install python latest +``` +