rrdtool-1.x
rrdtool-1.x copied to clipboard
Should prefer python3 over python2
Describe the bug
Apparently I still have python2 installed on my (amd64) system and when running ./configure it selected that to build bindings for. I (ofc) also have python3 installed (and python3-dev), but it didn't select that.
Given that python2 is EOL, I think it should use python3 if that's available.
To Reproduce Steps to reproduce the behavior:
- Have both python2 and python3 installed
- Clone this repo and install build dependencies
cdinto the directory containing the project (rrdtool-1.x)- Run
./bootstrapand then./configure - See that it will use python2 instead of python3
Expected behavior If python3 is installed, it should use/prefer that over python2
Screenshots If applicable, add screenshots to help explain your problem.
Prep for Building Language Bindings
checking for perl... /usr/bin/perl
...
checking for a Python interpreter with version >= 2.3... python2
checking for python2... /usr/bin/python2
checking for python2 version... 2.7
checking for python2 platform... linux2
checking for GNU default python2 prefix... ${prefix}
checking for GNU default python2 exec_prefix... ${exec_prefix}
checking for python2 script directory (pythondir)... ${PYTHON_PREFIX}/lib/python2.7/site-packages
checking for python2 extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python2.7/site-packages
checking for headers required to compile python extensions... not found
configure: WARNING: could not find Python headers
...
config.status: executing po-directories commands
Apply Configuration Information
checking that generated files are newer than configure... done
configure: creating ./config.status
...
ordering CD from https://tobi.oetiker.ch/wish .... just kidding ;-)
----------------------------------------------------------------
Config is DONE!
With MMAP IO: yes
With Locking: yes
Build rrd_graph: yes
Build rrd_restore: yes
Static programs: no
Perl Modules: perl-piped perl-shared
Perl Binary: /usr/bin/perl
Perl Version: 5.36.0
Perl Options: PREFIX=/opt/rrdtool-1.8.0 INSTALL_BASE= LIB=/opt/rrdtool-1.8.0/lib/perl/5.36.0 INSTALLSITEMAN3DIR=${datarootdir}/man/man3
Ruby Modules: ruby
Ruby Binary: /usr/bin/ruby
Ruby Options: sitedir=/opt/rrdtool-1.8.0/lib/ruby
Build Lua Bindings: no
Systemd unit dir: /lib/systemd/system
Build Tcl Bindings: no
Build Python Bindings: no
Python Binary: /usr/bin/python2
Python Version: 2.7
Build examples: yes
Build rrdcached: yes
Build rrdcgi: yes
Build librrd MT: yes
Use gettext: yes
With libDBI: no
With librados: no
With libwrap: yes
With systemd dir: /lib/systemd/system
Libraries: -lcairo -lglib-2.0 -lgobject-2.0 -lharfbuzz -lm -lpango-1.0 -lpangocairo-1.0 -lpng -lwrap -lxml2
Type 'make' to compile the software and use 'make install' to
install everything to: /opt/rrdtool-1.8.0.
Desktop (please complete the following information):
- OS: Debian Bookworm (amd64)
Additional context
I started looking at a build issue for 32-bit systems/hosts (will report on that later) when I noticed this issue.
When I followed the steps to reproduce on a (clean armhf/32bit) system with only python3 (and python3-dev) installed, it did the right thing.
I started looking at a build issue for 32-bit systems/hosts (will report on that later)
It turned out that backporting the below referenced commits since 1.8.0 fixed that build issue, see https://salsa.debian.org/rrdtool-team/rrdtool/-/merge_requests/4 for details.
- "acinclude.m4: Include <stdlib.h> when using exit" (https://github.com/oetiker/rrdtool-1.x/commit/f3334fcbde0a77aa48938ba38602bff91c09cf85)
- "Update Version and Copyright year in git files" (https://github.com/oetiker/rrdtool-1.x/commit/e839e17c9d61f6fdc40f2f0d5a828e2f19614b0f)
- "Fix BUILD_DATE in rrdtool help output" (https://github.com/oetiker/rrdtool-1.x/commit/e59f703bbcc0af949ee365206426b6394c340c6f)
- "Fix unsigned integer overflow in rrdtool first" (https://github.com/oetiker/rrdtool-1.x/commit/b74a0d64e00770384d025e40becdb2ed83c04c0c)
Specifically after "Fix BUILD_DATE in rrdtool help output" Salsa's CI (and thus the build i386 job) succeeded.
No idea why, but I'll take it ;-)
Sounds like this might work to prefer python3
diff --git a/configure.ac b/configure.ac index be8b4d6e..140ad111 100644 --- a/configure.ac +++ b/configure.ac @@ -1018,7 +1018,7 @@ AC_ARG_ENABLE(python,AS_HELP_STRING([--disable-python],[do not build the python
if test "$enable_python" = "yes"; then dnl Check for python -AM_PATH_PYTHON(2.3,[],[enable_python=no]) +AM_PATH_PYTHON(3,[],[AM_PATH_PYTHON(2.3,[],[enable_python=no])]) AM_CHECK_PYTHON_HEADERS(,[enable_python=no;AC_MSG_WARN(could not find Python headers)]) fi