From 4137842b56c571aec89fac41d42652beafb7182b Mon Sep 17 00:00:00 2001 From: Vasiliy Kiryanov Date: Tue, 22 Sep 2026 09:13:22 -0400 Subject: [PATCH 1/3] gh-157949: Remove dead UnixWare, OpenServer and ReliantUNIX support code --- Lib/test/test_fcntl.py | 2 +- ...-09-22-09-13-06.gh-issue-157949.EZ8avp.rst | 2 + Modules/_cursesmodule.c | 2 +- Modules/posixmodule.c | 5 -- configure | 64 +----------------- configure.ac | 66 +------------------ pyconfig.h.in | 5 -- 7 files changed, 6 insertions(+), 140 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-09-22-09-13-06.gh-issue-157949.EZ8avp.rst diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py index f20a9d407670a9..d04539df7c96fe 100644 --- a/Lib/test/test_fcntl.py +++ b/Lib/test/test_fcntl.py @@ -73,7 +73,7 @@ def get_lockdata(): fcntl.F_WRLCK, 0) elif sys.platform.startswith('gnukfreebsd'): lockdata = struct.pack('qqihhi', 0, 0, 0, fcntl.F_WRLCK, 0, 0) - elif sys.platform in ['hp-uxB', 'unixware7']: + elif sys.platform == 'hp-uxB': lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) else: lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0) diff --git a/Misc/NEWS.d/next/Build/2026-09-22-09-13-06.gh-issue-157949.EZ8avp.rst b/Misc/NEWS.d/next/Build/2026-09-22-09-13-06.gh-issue-157949.EZ8avp.rst new file mode 100644 index 00000000000000..0b1034807b7dd1 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-09-22-09-13-06.gh-issue-157949.EZ8avp.rst @@ -0,0 +1,2 @@ +Remove dead build and preprocessor code for SCO UnixWare, OpenUNIX, SCO +OpenServer and ReliantUNIX. diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 401b777be23caa..85ee5d19130ce0 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -120,7 +120,7 @@ static const char PyCursesVersion[] = "2.2"; #include #endif -#if !defined(NCURSES_VERSION) && (defined(sgi) || defined(__sun) || defined(SCO5)) +#if !defined(NCURSES_VERSION) && (defined(sgi) || defined(__sun)) #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ typedef chtype attr_t; /* No attr_t type is available */ #endif diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ead2371e341441..ed95e13ad640ec 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -14111,11 +14111,6 @@ os_WSTOPSIG_impl(PyObject *module, int status) #if defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H) -#ifdef _SCO_DS -/* SCO OpenServer 5.0 and later requires _SVID3 before it reveals the - needed definitions in sys/statvfs.h */ -#define _SVID3 -#endif #include #ifdef __APPLE__ diff --git a/configure b/configure index 84f2030049ac31..b405c2810bb229 100755 --- a/configure +++ b/configure @@ -4205,8 +4205,7 @@ then ac_sys_release= else ac_sys_system=`uname -s` - if test "$ac_sys_system" = "AIX" \ - -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then + if test "$ac_sys_system" = "AIX"; then ac_sys_release=`uname -v` else ac_sys_release=`uname -r` @@ -4745,15 +4744,6 @@ printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h # A lower level is defined below. SunOS/*) define_xopen_source=no;; - # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE, - # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice. - # Reconfirmed for 7.1.4 by Martin v. Loewis. - OpenUNIX/8.0.0| UnixWare/7.1.[0-4]) - define_xopen_source=no;; - # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE, - # but used in struct sockaddr.sa_family. Reported by Tim Rice. - SCO_SV/3.2) - define_xopen_source=no;; # On MacOS X 10.2, a bug in ncurses.h means that it craps out if # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which # identifies itself as Darwin/7.* @@ -9941,11 +9931,6 @@ then OPT="-O3 -Wall" ;; esac - - case $ac_sys_system in - SCO_SV*) OPT="$OPT -m486 -DSCO5" - ;; - esac ;; *) @@ -11287,10 +11272,6 @@ fi esac case $ac_sys_system in - SCO_SV*) - BASECFLAGS="$BASECFLAGS -m486 -DSCO5" - ;; - Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. @@ -11506,18 +11487,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ ;; esac -else case e in #( - e) - case $ac_sys_system in - OpenUNIX*|UnixWare*) - BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca " - ;; - SCO_SV*) - BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5" - ;; - esac - ;; -esac fi # Check for --enable-experimental-jit: @@ -12997,13 +12966,6 @@ printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h fi -# Add some code to confdefs.h so that the test for off_t works on SCO -cat >> confdefs.h <<\EOF -#if defined(SCO_DS) -#undef _OFF_T -#endif -EOF - # Type availability checks ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes @@ -14407,17 +14369,6 @@ then NetBSD*|DragonFly*) LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; - OpenUNIX*|UnixWare*) - if test "$ac_cv_gcc_compat" = "yes" ; then - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared' - else - LDSHARED='$(CC) -G' - LDCXXSHARED='$(CXX) -G' - fi;; - SCO_SV*) - LDSHARED='$(CC) -Wl,-G,-Bexport' - LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';; WASI*) if test "x$enable_wasm_dynamic_linking" = xyes then : @@ -14472,16 +14423,6 @@ then : fi;; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; Haiku*) CCSHARED="-fPIC";; - OpenUNIX*|UnixWare*) - if test "$ac_cv_gcc_compat" = "yes" - then CCSHARED="-fPIC" - else CCSHARED="-KPIC" - fi;; - SCO_SV*) - if test "$ac_cv_gcc_compat" = "yes" - then CCSHARED="-fPIC" - else CCSHARED="-Kpic -belf" - fi;; VxWorks*) CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic" esac @@ -14534,9 +14475,6 @@ printf "%s\n" "#define THREAD_STACK_SIZE 0x$stack_size" >>confdefs.h fi fi ;; - OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; - SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; - ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) if [ "`$CC -dM -E - @) - define_xopen_source=no;; - # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE, - # but used in struct sockaddr.sa_family. Reported by Tim Rice. - SCO_SV/3.2) - define_xopen_source=no;; # On MacOS X 10.2, a bug in ncurses.h means that it craps out if # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which # identifies itself as Darwin/7.* @@ -2417,11 +2402,6 @@ then OPT="-O3 -Wall" ;; esac - - case $ac_sys_system in - SCO_SV*) OPT="$OPT -m486 -DSCO5" - ;; - esac ;; *) @@ -2789,10 +2769,6 @@ AS_VAR_IF([ac_cv_gcc_compat], [yes], [ esac case $ac_sys_system in - SCO_SV*) - BASECFLAGS="$BASECFLAGS -m486 -DSCO5" - ;; - Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. @@ -2946,15 +2922,6 @@ AS_VAR_IF([ac_cv_gcc_compat], [yes], [ # end of Darwin* tests ;; esac -], [ - case $ac_sys_system in - OpenUNIX*|UnixWare*) - BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca " - ;; - SCO_SV*) - BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5" - ;; - esac ]) # Check for --enable-experimental-jit: @@ -3336,13 +3303,6 @@ AC_DEFINE([_FILE_OFFSET_BITS], [64], [This must be set to 64 on some systems to enable large file support.]) fi -# Add some code to confdefs.h so that the test for off_t works on SCO -cat >> confdefs.h <<\EOF -#if defined(SCO_DS) -#undef _OFF_T -#endif -EOF - # Type availability checks AC_TYPE_MODE_T AC_TYPE_OFF_T @@ -3723,17 +3683,6 @@ then NetBSD*|DragonFly*) LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; - OpenUNIX*|UnixWare*) - if test "$ac_cv_gcc_compat" = "yes" ; then - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared' - else - LDSHARED='$(CC) -G' - LDCXXSHARED='$(CXX) -G' - fi;; - SCO_SV*) - LDSHARED='$(CC) -Wl,-G,-Bexport' - LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';; WASI*) AS_VAR_IF([enable_wasm_dynamic_linking], [yes], [ dnl not implemented yet @@ -3781,16 +3730,6 @@ then ]);; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; Haiku*) CCSHARED="-fPIC";; - OpenUNIX*|UnixWare*) - if test "$ac_cv_gcc_compat" = "yes" - then CCSHARED="-fPIC" - else CCSHARED="-KPIC" - fi;; - SCO_SV*) - if test "$ac_cv_gcc_compat" = "yes" - then CCSHARED="-fPIC" - else CCSHARED="-Kpic -belf" - fi;; VxWorks*) CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic" esac @@ -3841,9 +3780,6 @@ then fi fi ;; - OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; - SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; - ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) if [[ "`$CC -dM -E - Date: Tue, 22 Sep 2026 09:21:26 -0400 Subject: [PATCH 2/3] Drop STRICT_SYSV_CURSES from the C API macro allowlist --- Tools/build/check_capi_macros_ignored.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Tools/build/check_capi_macros_ignored.txt b/Tools/build/check_capi_macros_ignored.txt index 877c8d72e72827..4410507a3291a8 100644 --- a/Tools/build/check_capi_macros_ignored.txt +++ b/Tools/build/check_capi_macros_ignored.txt @@ -712,7 +712,6 @@ SSTATE_INTERNED_IMMORTAL_STATIC SSTATE_INTERNED_MORTAL SSTATE_NOT_INTERNED STDC_HEADERS -STRICT_SYSV_CURSES SYS_SELECT_WITH_SYS_TIME S_IFLNK S_IFMT From 47a1ac21041b774a293166d1e8f072551a5d321a Mon Sep 17 00:00:00 2001 From: Vasiliy Kiryanov Date: Thu, 5 Nov 2026 09:59:13 -0500 Subject: [PATCH 3/3] Drop the SCO ODT 3.0 note --- PC/pyconfig.h | 3 +-- configure.ac | 3 +-- pyconfig.h.in | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 4216847e2eaec4..f969525c1db5c7 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -506,8 +506,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ /* Define if you have the putenv function. */ #define HAVE_PUTENV -/* Define if you can safely include both and - (which you can't on SCO ODT 3.0). */ +/* Define if you can safely include both and */ /* #undef SYS_SELECT_WITH_SYS_TIME */ /* Define if you want build the _decimal module using a coroutine-local rather diff --git a/configure.ac b/configure.ac index b87537bd99584d..3a59beced1c674 100644 --- a/configure.ac +++ b/configure.ac @@ -6300,8 +6300,7 @@ AS_VAR_IF([ac_cv_device_macros], [yes], [ dnl no longer used, now always defined for backwards compatibility AC_DEFINE([SYS_SELECT_WITH_SYS_TIME], [1], - [Define if you can safely include both and - (which you can't on SCO ODT 3.0).]) + [Define if you can safely include both and ]) # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. diff --git a/pyconfig.h.in b/pyconfig.h.in index 8baaa8f9c4059e..dba7d193bcb3d1 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -1922,8 +1922,7 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define if you can safely include both and - (which you can't on SCO ODT 3.0). */ +/* Define if you can safely include both and */ #undef SYS_SELECT_WITH_SYS_TIME /* Custom thread stack size depending on chosen sanitizer runtimes. */