Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3157 by changing CFG_BIN_DIR #3158

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ _canonicalize_file_path() {
CFG_BIN="$( realpath "${BASH_SOURCE[0]}" )"
CFG_ROOT_DIR="$( cd "$( dirname "${CFG_BIN}" )" && pwd )"

# On some environments, the bin directory may lie inside the local directory.
# In those cases, CFG_BIN_DIR will be assigned $CFG_LOCAL_BIN_DIR.
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
CFG_LOCAL_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/local/bin

# force relaunching under X86-64 architecture on macOS M1/ARM
if [[ $OSTYPE == 'darwin'* && $(uname -m) == 'arm64' && $(sysctl -in sysctl.proc_translated) == 0 ]]; then
Expand Down Expand Up @@ -173,6 +176,7 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
# Current directory where this script lives
CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
CFG_LOCAL_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/local/bin


################################
Expand Down Expand Up @@ -218,7 +222,7 @@ create_virtualenv() {
# included either by default. The virtualenv.pyz app cures all these issues.

VENV_DIR="$1"
if [ ! -f "$CFG_BIN_DIR/python" ]; then
if [[ ! -f "$CFG_BIN_DIR/python" && ! -f "$CFG_LOCAL_BIN_DIR/python" ]]; then

mkdir -p "$CFG_ROOT_DIR/$VENV_DIR"

Expand All @@ -237,6 +241,10 @@ create_virtualenv() {
$CFG_QUIET \
"$CFG_ROOT_DIR/$VENV_DIR"
fi

if [[ ! -f "$CFG_BIN_DIR/python" && -f "$CFG_LOCAL_BIN_DIR/python" ]]; then
CFG_BIN_DIR=$CFG_LOCAL_BIN_DIR
fi
}


Expand Down