]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: contrib/spoa: do not register python3.8 if --embed fail
authorBertrand Jacquin <bertrand@jacquin.bzh>
Fri, 22 May 2020 16:03:46 +0000 (17:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2020 14:16:19 +0000 (16:16 +0200)
spoa server fails to build when python3.8 is not available. If
python3-config --embed fails, the output of the command is registered in
check_python_config.  However when it's later used to define
PYTHON_DEFAULT_INC and PYTHON_DEFAULT_LIB it's content does not match
and fallback to python2.7

Content of check_python_config when building with python3.6:

  Usage: bin/python3-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir python3

As we are only looking for return code, this commit ensure we always
ignore the output of python3-config or hash commands.

contrib/spoa_server/Makefile

index e7b20db4c00fb869cac65ad07ec090a279f42750..5de6135ec7d6ad8b7eec750fec5f4c94c2871f6a 100644 (file)
@@ -25,9 +25,9 @@ ifneq ($(USE_PYTHON),)
 OBJS += ps_python.o
 
 # "--embed" flag is supported (and required) only from python 3.8+
-check_python_config := $(shell if python3-config --embed; then echo "python3.8+"; \
-elif hash python3-config; then echo "python3"; \
-elif hash python-config; then echo "python2"; fi)
+check_python_config := $(shell if python3-config --embed > /dev/null 2>&1 ; then echo "python3.8+"; \
+elif hash python3-config > /dev/null 2>&1 ; then echo "python3"; \
+elif hash python-config > /dev/null 2>&1 ; then echo "python2"; fi)
 
 ifeq ($(check_python_config), python3.8+)
 PYTHON_DEFAULT_INC := $(shell python3-config --includes)