DevinLeamy opened a new pull request, #497:
URL: https://github.com/apache/mesos/pull/497
Recently ran into a issue where `AM_PYTHON_CHECK_VERSION` was failing with
code 127 "command not found" despite that the `$PYTHON` value set by the user
when `./configure` was invoked was valid.
This was resulting in the following error message: """
configure: error: Mesos requires Python >= 2.6
------------------------------------------------------------------- The
detected Python version is 2.7.
If you already have Python 2.6+ installed (and it's the default python on
the path), you might want to check if you have the PYTHON environment variable
set to an older version of Python.
------------------------------------------------------------------- """
Which is rather confusing:
> "Requires Python >= 2.6 but finds 2.7 and throws an error?!"
What was happening is that:
1. $PYTHON=<path to python>
2. $PYTHON was being used to set $PYTHON_VERSION
3. $PYTHON_VERSION was then being used to update $PYTHON
```
if test -n "$PYTHON_VERSION"; then
AC_SUBST([PYTHON], [python$PYTHON_VERSION])
fi
```
4. This made $PYTHON="python2.7" which was not in the path.
5. AM_PYTHON_CHECK_VERSION was called which was failing to find python2.7
6. We received an error.
To fix this, we move the logic that sets $PYTHON using $PYTHON_VERSION to
run **before** the logic that sets $PYTHON_VERSION. This will preserve the
value of $PYTHON, if it was provided. In other words,
$PYTHON=/usr/bin/python2.7 will not become $PYTHON=python2.7 (the problem), but
will remain $PYTHON=/usr/bin/python2.7.
The make similar issues more obvious in the future, we additionally log the
current values of $PYTHON_VERSION **and** $PYTHON in the error message.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]