From 030f54a1abf9119af9557510560a539a5bcac544 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 20 Sep 2024 11:55:47 +0200 Subject: [PATCH 1/2] 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. --- pdns/recursordist/settings/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdns/recursordist/settings/Makefile.am b/pdns/recursordist/settings/Makefile.am index e9293a4ebaf2..53b78b549bbd 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) From bb3ae5f8eae34ebbc872da5a44ea314af71c7c53 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 7 Oct 2024 11:31:49 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Remi Gacogne --- pdns/recursordist/settings/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/recursordist/settings/Makefile.am b/pdns/recursordist/settings/Makefile.am index 53b78b549bbd..8d186d14aaed 100644 --- a/pdns/recursordist/settings/Makefile.am +++ b/pdns/recursordist/settings/Makefile.am @@ -23,8 +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 + @if test "$(PYTHON)" = ":"; then echo "Settings table table.py has changed, python is needed to regenerate the related settings files but python was not found. Please install python and re-run configure"; exit 1; fi + @if ! $(PYTHON) --version | grep -q "Python 3"; then echo $(PYTHON) should be at least version 3. Please install python 3 and re-run configure; exit 1; fi $(MAKE) -C rust clean (cd ${srcdir} && $(PYTHON) generate.py)