The shebang lines in the python scrips - xtf-runner in particular - still need
work, but this at least fixes `make` on systems without `python` on $PATH.
Default to python3 in CI too.
Reported-by: Pranjal Singh <008pranjalsingh@gmail.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Pranjal Singh <008pranjalsingh@gmail.com>
esac
sudo apt-get update -q
- sudo apt-get install -y build-essential python ${{matrix.compiler}} ${EXTRA}
+ sudo apt-get install -y build-essential python3 ${{matrix.compiler}} ${EXTRA}
- uses: actions/checkout@v2
INSTALL_DATA := $(INSTALL) -m 644 -p
INSTALL_DIR := $(INSTALL) -d -p
INSTALL_PROGRAM := $(INSTALL) -p
-PYTHON := python
+
+# Best effort attempt to find a python interpreter, defaulting to Python 3 if
+# available. Fall back to just `python` if `which` is nowhere to be found.
+PYTHON_INTERPRETER := $(word 1,$(shell which python3 python python2 2>/dev/null) python)
+PYTHON ?= $(PYTHON_INTERPRETER)
export CC LD CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON