[Python-checkins] bpo-46602: Do not append conftest.c (GH-31062)

ned-deily webhook-mailer at python.org
Tue Feb 1 21:38:23 EST 2022


https://github.com/python/cpython/commit/b1288964e31069bdf81abe560c82874f6f620928
commit: b1288964e31069bdf81abe560c82874f6f620928
branch: main
author: adanhawth <36526095+adanhawth at users.noreply.github.com>
committer: ned-deily <nad at python.org>
date: 2022-02-01T21:38:15-05:00
summary:

bpo-46602: Do not append conftest.c (GH-31062)

The heredoc creation statements use >> to append conftest.c.  This can cause
tricky build issues if the file is not correctly removed prior to its
name being reused (such name is reused several times for different
contextual tests during the build).  One such result from appending may
cause #include <ac_nonexistent.h> to persist when testing to acquire
PLATFORM_TRIPLET.  This can then lead to downstream issues concerning SOABI.

files:
A Misc/NEWS.d/next/Build/2022-02-02-02-06-07.bpo-46602.8GaOZ2.rst
M configure
M configure.ac

diff --git a/Misc/NEWS.d/next/Build/2022-02-02-02-06-07.bpo-46602.8GaOZ2.rst b/Misc/NEWS.d/next/Build/2022-02-02-02-06-07.bpo-46602.8GaOZ2.rst
new file mode 100644
index 0000000000000..a1123b44ecd59
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2022-02-02-02-06-07.bpo-46602.8GaOZ2.rst
@@ -0,0 +1 @@
+Tidied up configure.ac so that conftest.c is truncated rather than appended.  This assists in the case where the 'rm' of conftest.c fails to happen between tests.  Downstream issues such as a clobbered SOABI can result.
\ No newline at end of file
diff --git a/configure b/configure
index 015b51645f5be..9097c0514b57c 100755
--- a/configure
+++ b/configure
@@ -5942,7 +5942,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
 $as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
-cat >> conftest.c <<EOF
+cat > conftest.c <<EOF
 #undef bfin
 #undef cris
 #undef fr30
@@ -6169,7 +6169,7 @@ $as_echo "$ac_cv_wl_no_as_needed" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android API level" >&5
 $as_echo_n "checking for the Android API level... " >&6; }
-cat >> conftest.c <<EOF
+cat > conftest.c <<EOF
 #ifdef __ANDROID__
 android_api = __ANDROID_API__
 arm_arch = __ARM_ARCH
diff --git a/configure.ac b/configure.ac
index 6204747edfc25..b613c18dbb3c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -833,7 +833,7 @@ fi
 
 
 AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
-cat >> conftest.c <<EOF
+cat > conftest.c <<EOF
 #undef bfin
 #undef cris
 #undef fr30
@@ -1028,7 +1028,7 @@ AC_CACHE_CHECK([for -Wl,--no-as-needed], [ac_cv_wl_no_as_needed], [
 AC_SUBST(NO_AS_NEEDED)
 
 AC_MSG_CHECKING([for the Android API level])
-cat >> conftest.c <<EOF
+cat > conftest.c <<EOF
 #ifdef __ANDROID__
 android_api = __ANDROID_API__
 arm_arch = __ARM_ARCH



More information about the Python-checkins mailing list