Building python 3.10.4 and possibly undefined macro: AC_MSG_ERROR

Author:

Emerging the new python 3.10 in Gentoo may lead to the following error, despite all the dependencies installed. This error might also occur in any other Linux distro! During the configure stage the autoconf tool outputs error:

root@srv ~ # cat /var/tmp/portage/dev-lang/python-3.10.5/temp/autoconf.out 
***** autoconf *****
***** PWD: /var/tmp/portage/dev-lang/python-3.10.5/work/Python-3.10.5
***** autoconf --force

configure.ac:59: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:59: You should run autoupdate.
./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:59: the top level
configure.ac:911: warning: AC_LINK_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
./lib/autoconf/specific.m4:364: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:911: the top level
configure.ac:2214: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:2214: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:2214: the top level
configure.ac:4250: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:4250: You should run autoupdate.
./lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from...
configure.ac:4250: the top level
configure.ac:18: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation

It appears a dependency is missing! First, build the package sys-devel/autoconf-archive and then the building of python-3.10.5 will finish successfully.

root@srv ~ # emerge -va autoconf-archive

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-devel/autoconf-archive-2022.02.11::gentoo  660 KiB

Total: 1 package (1 new), Size of downloads: 660 KiB

Would you like to merge these packages? [Yes/No] yes

Emerging the dev-lang/python-3.10.5::gentoo outputs the error and the building process stops. The error output in emerge command is so informative. The actual error is in the /var/tmp/portage/dev-lang/python-3.10.5/temp/autoconf.out.

>>> Emerging (1 of 1) dev-lang/python-3.10.5::gentoo
 * Python-3.10.5.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                   [ ok ]
 * python-gentoo-patches-3.10.5.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                    [ ok ]
>>> Unpacking source...
>>> Unpacking Python-3.10.5.tar.xz to /var/tmp/portage/dev-lang/python-3.10.5/work
>>> Unpacking python-gentoo-patches-3.10.5.tar.xz to /var/tmp/portage/dev-lang/python-3.10.5/work
>>> Source unpacked in /var/tmp/portage/dev-lang/python-3.10.5/work
>>> Preparing source in /var/tmp/portage/dev-lang/python-3.10.5/work/Python-3.10.5 ...
 * Applying patches from /var/tmp/portage/dev-lang/python-3.10.5/work/python-gentoo-patches-3.10.5 ...
 *   0001-Disable-modules-and-SSL.patch ...                                                      [ ok ]
 *   0002-Override-libdir.patch ...                                                              [ ok ]
 *   0003-setup.py-exit-with-non-zero-status-on-failure.patch ...                                [ ok ]
 *   0004-Improve-distutils-C-support.patch ...                                                  [ ok ]
 *   0005-Disable-nis.patch ...                                                                  [ ok ]
 *   0006-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch ...                         [ ok ]
 *   0007-Install-shared-libs-in-LIBDEST.patch ...                                               [ ok ]
 *   0008-Blacklist-test_pickletools-from-__all__-test-as-it-i.patch ...                         [ ok ]
 *   0009-Skip-RDS-socket-tests-that-hang-frequently.patch ...                                   [ ok ]
 *   0010-ssl-Hard-disable-SSLv3-to-avoid-automagic-deps.patch ...                               [ ok ]
 *   0011-bpo-45433-Do-not-link-libpython-against-libcrypt.patch ...                             [ ok ]
 * Running eautoreconf in '/var/tmp/portage/dev-lang/python-3.10.5/work/Python-3.10.5' ...
 * Running 'aclocal --system-acdir=/var/tmp/portage/dev-lang/python-3.10.5/temp/aclocal' ...     [ ok ]
 * Running 'autoconf --force' ...                                                                [ !! ]

 * Failed running 'autoconf'!
 * 
 * Include in your bug report the contents of:
 * 
 *   /var/tmp/portage/dev-lang/python-3.10.5/temp/autoconf.out

 * ERROR: dev-lang/python-3.10.5::gentoo failed (prepare phase):
 *   Failed running 'autoconf'!
 * 
 * Call stack:
 *     ebuild.sh, line  127:  Called src_prepare
 *   environment, line 3491:  Called eautoreconf
 *   environment, line 1939:  Called eautoconf '--force'
 *   environment, line 1852:  Called autotools_run_tool '--at-m4flags' 'autoconf' '--force'
 *   environment, line 1515:  Called die
 * The specific snippet of code:
 *           die "Failed running '${1}'!";
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/python-3.10.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/python-3.10.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/python-3.10.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-3.10.5/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/python-3.10.5/work/Python-3.10.5'
 * S: '/var/tmp/portage/dev-lang/python-3.10.5/work/Python-3.10.5'

>>> Failed to emerge dev-lang/python-3.10.5, Log file:

>>>  '/var/tmp/portage/dev-lang/python-3.10.5/temp/build.log'

More tips and tricks on Gentoo emerge problems here.

Leave a Reply

Your email address will not be published. Required fields are marked *