bpo-45723: Add helper macros and more caching to configure.ac (GH-29429)#29429
bpo-45723: Add helper macros and more caching to configure.ac (GH-29429)#29429tiran merged 3 commits intopython:mainfrom
Conversation
|
I suggest using a buildbot-test of this when it is believed ready. Yay more modern autoconf practices. |
d048406 to
f13a97f
Compare
|
🤖 New build scheduled with the buildbot fleet by @tiran for commit f13a97f33c447f309c40315437a38ea4386e46f8 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
|
Outstanding!! 🚀🚀 |
All buildbots are passing except FreeBSD builder. It fails with an unrelated error in test_gdb. |
f13a97f to
f9bfcf2
Compare
Almost all checks are now cached by AC_CACHE_CHECK(). Common patterns are replaced by helper macros. Variable names now use naming scheme ``ac_cv_func_$funcname``, ``ac_cv_lib_$library_$funcname``, or ``ac_cv_header_$headername_h``. ``SYS_SELECT_WITH_SYS_TIME`` is no longer used. ``uuid_create`` and ``uuid_enc_be`` are provided by libc on BSD. It is safe to use ``AC_CHECK_FUNCS`` here. Caching speeds up ./configure -C from ~ 4s to 2.6s on my system. Signed-off-by: Christian Heimes <[email protected]>
f9bfcf2 to
a52ce97
Compare
erlend-aasland
left a comment
There was a problem hiding this comment.
This is so nice; great work! The macros really simplifies a lot of stuff. I left some suggestions, mainly:
- add missing brackets around text/descriptions (not required, but good practise)
- remove unneeded double brackets; AFAIK, double brackets are only needed if you need literal brackets in the target text. OTOH, the double brackets make no harm, so I'm fine with leaving it as it is.
There more stuff that can be cached in there, and we could simplify stuff further with more macros (for example tweaking BASECFLAGS), but this PR is already pretty huge, so perhaps it's better to split it up?
|
$ git diff configure |
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Some distributions have made minor alterations to autoconf or ship different versions of autoarchive. I created https://quay.io/repository/tiran/cpython_autoconf to reduce the noise. It's a minimal Alpine image with autoconf 2.69, autoarchive, and pkg-config m4 macros. |
Thanks for the review! Yes, there are a handful of checks that are not cached yet. I got most slow paths in this PR. Let's handle the remaining places in a new PR. I think we can also adopt autoconf 2.71 soon. It's reducing the runtime of fully cached configure by another second. |
|
Sounds like a good plan! |
…GH-29429) Almost all checks are now cached by AC_CACHE_CHECK(). Common patterns are replaced by helper macros. Variable names now use naming scheme ``ac_cv_func_$funcname``, ``ac_cv_lib_$library_$funcname``, or ``ac_cv_header_$headername_h``. ``SYS_SELECT_WITH_SYS_TIME`` is no longer used. ``uuid_create`` and ``uuid_enc_be`` are provided by libc on BSD. It is safe to use ``AC_CHECK_FUNCS`` here. Caching speeds up ./configure -C from ~ 4s to 2.6s on my system. Co-authored-by: Erlend Egeberg Aasland <[email protected]>
…GH-29429) Almost all checks are now cached by AC_CACHE_CHECK(). Common patterns are replaced by helper macros. Variable names now use naming scheme ``ac_cv_func_$funcname``, ``ac_cv_lib_$library_$funcname``, or ``ac_cv_header_$headername_h``. ``SYS_SELECT_WITH_SYS_TIME`` is no longer used. ``uuid_create`` and ``uuid_enc_be`` are provided by libc on BSD. It is safe to use ``AC_CHECK_FUNCS`` here. Caching speeds up ./configure -C from ~ 4s to 2.6s on my system. Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Almost all checks are now cached by AC_CACHE_CHECK().
Common patterns are replaced by helper macros.
Variable names now use naming scheme
ac_cv_func_$funcname,ac_cv_lib_$library_$funcname, orac_cv_header_$headername_h.SYS_SELECT_WITH_SYS_TIMEis no longer used.uuid_createanduuid_enc_beare provided by libc on BSD. It issafe to use
AC_CHECK_FUNCShere.Caching speeds up ./configure -C from ~ 4s to 2.6s on my system.
Signed-off-by: Christian Heimes [email protected]
https://bugs.python.org/issue45723