From: Otto Moerbeek Date: Fri, 20 Sep 2024 09:55:47 +0000 (+0200) Subject: rec: Give a more clear error message if the build fails because python was not found X-Git-Tag: rec-5.2.0-alpha1~45^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=030f54a1abf9119af9557510560a539a5bcac544;p=thirdparty%2Fpdns.git rec: Give a more clear error message if the build fails because python was not found When building from a src tarball you don't need python (the tarball includes the generated files), but that changes if settings/table.py was modified or when building from a github checkout. --- diff --git a/pdns/recursordist/settings/Makefile.am b/pdns/recursordist/settings/Makefile.am index e9293a4eba..53b78b549b 100644 --- a/pdns/recursordist/settings/Makefile.am +++ b/pdns/recursordist/settings/Makefile.am @@ -23,6 +23,8 @@ BUILT_SOURCES=cxxsettings-generated.cc rust/src/lib.rs # # Use patterns to avoid having two instances of generate run simultaneously, a well-known hack for GNU make cxxsettings-generated%cc rust/src/lib%rs: table.py generate.py rust-preamble-in.rs rust-bridge-in.rs docs-old-preamble-in.rst docs-new-preamble-in.rst + @if test "$(PYTHON)" = ":"; then echo "Settings table table.py has changed, need python to regenerate generated settings files but python was not found"; exit 1; fi + @if ! $(PYTHON) --version | grep -q "Python 3"; then echo $(PYTHON) should be at least version 3; exit 1; fi $(MAKE) -C rust clean (cd ${srcdir} && $(PYTHON) generate.py)