Skip to content

Commit f147248

Browse files
authored
[3.9] bpo-44035: Check autoconf files thoroughly (GH-29935) (GH-29938)
Co-authored-by: Christian Heimes <[email protected]>
1 parent 7accb4f commit f147248

File tree

6 files changed

+57
-50
lines changed

6 files changed

+57
-50
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ jobs:
8383
- uses: actions/setup-python@v2
8484
- name: Install Dependencies
8585
run: sudo ./.github/workflows/posix-deps-apt.sh
86+
- name: Add ccache to PATH
87+
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
88+
- name: Configure ccache action
89+
uses: hendrikmuhs/ccache-action@v1
90+
- name: Check Autoconf version 2.69 and aclocal 1.16.3
91+
run: |
92+
grep "Generated by GNU Autoconf 2.69" configure
93+
grep "aclocal 1.16.3" aclocal.m4
94+
grep -q "runstatedir" configure
95+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
96+
- name: Regenerate autoconf files
97+
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
8698
- name: Build CPython
8799
run: |
88100
./configure --with-pydebug
@@ -91,16 +103,15 @@ jobs:
91103
run: |
92104
changes=$(git status --porcelain)
93105
# Check for changes in regenerated files
94-
if ! test -z "$changes"
95-
then
96-
echo "Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen ;)"
106+
if test -n "$changes"; then
107+
echo "Generated files not up to date."
108+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
109+
echo "configure files must be regenerated with a specific, unpatched version of autoconf."
97110
echo "$changes"
98111
exit 1
99112
fi
100113
- name: Check exported libpython symbols
101114
run: make smelly
102-
- name: Check Autoconf version 2.69
103-
run: grep "Generated by GNU Autoconf 2.69" configure
104115

105116
build_win32:
106117
name: 'Windows (x86)'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Tools/unicode/data/
112112
/config.log
113113
/config.status
114114
/config.status.lineno
115+
# hendrikmuhs/ccache-action@v1
116+
/.ccache
115117
/platform
116118
/profile-clean-stamp
117119
/profile-run-stamp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CI now verifies that autoconf files have been regenerated with a current and
2+
unpatched autoconf package.

aclocal.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
1+
# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
22

33
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
44

configure

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ infodir
788788
docdir
789789
oldincludedir
790790
includedir
791+
runstatedir
791792
localstatedir
792793
sharedstatedir
793794
sysconfdir
@@ -905,6 +906,7 @@ datadir='${datarootdir}'
905906
sysconfdir='${prefix}/etc'
906907
sharedstatedir='${prefix}/com'
907908
localstatedir='${prefix}/var'
909+
runstatedir='${localstatedir}/run'
908910
includedir='${prefix}/include'
909911
oldincludedir='/usr/include'
910912
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1157,6 +1159,15 @@ do
11571159
| -silent | --silent | --silen | --sile | --sil)
11581160
silent=yes ;;
11591161

1162+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1163+
| --runstate | --runstat | --runsta | --runst | --runs \
1164+
| --run | --ru | --r)
1165+
ac_prev=runstatedir ;;
1166+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1167+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1168+
| --run=* | --ru=* | --r=*)
1169+
runstatedir=$ac_optarg ;;
1170+
11601171
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11611172
ac_prev=sbindir ;;
11621173
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1294,7 +1305,7 @@ fi
12941305
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12951306
datadir sysconfdir sharedstatedir localstatedir includedir \
12961307
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1297-
libdir localedir mandir
1308+
libdir localedir mandir runstatedir
12981309
do
12991310
eval ac_val=\$$ac_var
13001311
# Remove trailing slashes.
@@ -1447,6 +1458,7 @@ Fine tuning of the installation directories:
14471458
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14481459
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14491460
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1461+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14501462
--libdir=DIR object code libraries [EPREFIX/lib]
14511463
--includedir=DIR C header files [PREFIX/include]
14521464
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -9920,13 +9932,15 @@ $as_echo "no" >&6; }
99209932
fi
99219933
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
99229934

9935+
# check for libuuid from util-linux
99239936
save_LIBS=$LIBS
9924-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate_time_safe" >&5
9925-
$as_echo_n "checking for library containing uuid_generate_time_safe... " >&6; }
9926-
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
9937+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time in -luuid" >&5
9938+
$as_echo_n "checking for uuid_generate_time in -luuid... " >&6; }
9939+
if ${ac_cv_lib_uuid_uuid_generate_time+:} false; then :
99279940
$as_echo_n "(cached) " >&6
99289941
else
9929-
ac_func_search_save_LIBS=$LIBS
9942+
ac_check_lib_save_LIBS=$LIBS
9943+
LIBS="-luuid $LIBS"
99309944
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
99319945
/* end confdefs.h. */
99329946

@@ -9936,61 +9950,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
99369950
#ifdef __cplusplus
99379951
extern "C"
99389952
#endif
9939-
char uuid_generate_time_safe ();
9953+
char uuid_generate_time ();
99409954
int
99419955
main ()
99429956
{
9943-
return uuid_generate_time_safe ();
9957+
return uuid_generate_time ();
99449958
;
99459959
return 0;
99469960
}
99479961
_ACEOF
9948-
for ac_lib in '' uuid; do
9949-
if test -z "$ac_lib"; then
9950-
ac_res="none required"
9951-
else
9952-
ac_res=-l$ac_lib
9953-
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
9954-
fi
9955-
if ac_fn_c_try_link "$LINENO"; then :
9956-
ac_cv_search_uuid_generate_time_safe=$ac_res
9957-
fi
9958-
rm -f core conftest.err conftest.$ac_objext \
9959-
conftest$ac_exeext
9960-
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
9961-
break
9962-
fi
9963-
done
9964-
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
9965-
9962+
if ac_fn_c_try_link "$LINENO"; then :
9963+
ac_cv_lib_uuid_uuid_generate_time=yes
99669964
else
9967-
ac_cv_search_uuid_generate_time_safe=no
9965+
ac_cv_lib_uuid_uuid_generate_time=no
99689966
fi
9969-
rm conftest.$ac_ext
9970-
LIBS=$ac_func_search_save_LIBS
9967+
rm -f core conftest.err conftest.$ac_objext \
9968+
conftest$ac_exeext conftest.$ac_ext
9969+
LIBS=$ac_check_lib_save_LIBS
99719970
fi
9972-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate_time_safe" >&5
9973-
$as_echo "$ac_cv_search_uuid_generate_time_safe" >&6; }
9974-
ac_res=$ac_cv_search_uuid_generate_time_safe
9975-
if test "$ac_res" != no; then :
9976-
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9977-
9978-
9979-
$as_echo "#define HAVE_LIBUUID 1" >>confdefs.h
9980-
,
9981-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9982-
$as_echo "yes" >&6; }
9971+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_time" >&5
9972+
$as_echo "$ac_cv_lib_uuid_uuid_generate_time" >&6; }
9973+
if test "x$ac_cv_lib_uuid_uuid_generate_time" = xyes; then :
9974+
cat >>confdefs.h <<_ACEOF
9975+
#define HAVE_LIBUUID 1
9976+
_ACEOF
99839977

9984-
else
9985-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9986-
$as_echo "no" >&6; }
9978+
LIBS="-luuid $LIBS"
99879979

99889980
fi
99899981

99909982
LIBS=$save_LIBS
99919983

99929984
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
9993-
# FreeBSD and OpenBSD provides support as well
9985+
# FreeBSD and OpenBSD provides support in libc as well.
99949986
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
99959987
$as_echo_n "checking for uuid_create... " >&6; }
99969988
cat confdefs.h - <<_ACEOF >conftest.$ac_ext

pyconfig.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@
613613
/* Define to 1 if you have the <libutil.h> header file. */
614614
#undef HAVE_LIBUTIL_H
615615

616-
/* Define you have libuuid. */
616+
/* Define to 1 if you have the `uuid' library (-luuid). */
617617
#undef HAVE_LIBUUID
618618

619619
/* Define if you have the 'link' function. */

0 commit comments

Comments
 (0)