mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-32593: Drop FreeBSD 9 and older support (#5232)
Drop support of FreeBSD 9 and older.
This commit is contained in:
		
							parent
							
								
									b0a7a037b8
								
							
						
					
					
						commit
						13ff24582c
					
				
					 18 changed files with 23 additions and 108 deletions
				
			
		|  | @ -792,7 +792,7 @@ These constants are used as parameters for :func:`clock_getres` and | ||||||
| 
 | 
 | ||||||
|    High-resolution per-process timer from the CPU. |    High-resolution per-process timer from the CPU. | ||||||
| 
 | 
 | ||||||
|    Availability: FreeBSD 3 or later, NetBSD 7 or later, OpenBSD. |    Availability: FreeBSD, NetBSD 7 or later, OpenBSD. | ||||||
| 
 | 
 | ||||||
|    .. versionadded:: 3.7 |    .. versionadded:: 3.7 | ||||||
| 
 | 
 | ||||||
|  | @ -812,7 +812,7 @@ These constants are used as parameters for :func:`clock_getres` and | ||||||
|    suspended, providing accurate uptime measurement, both absolute and |    suspended, providing accurate uptime measurement, both absolute and | ||||||
|    interval. |    interval. | ||||||
| 
 | 
 | ||||||
|    Availability: FreeBSD 7 or later, OpenBSD 5.5 or later. |    Availability: FreeBSD, OpenBSD 5.5 or later. | ||||||
| 
 | 
 | ||||||
|    .. versionadded:: 3.7 |    .. versionadded:: 3.7 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -806,6 +806,11 @@ Windows Only | ||||||
| Removed | Removed | ||||||
| ======= | ======= | ||||||
| 
 | 
 | ||||||
|  | Platform Support Removals | ||||||
|  | ------------------------- | ||||||
|  | 
 | ||||||
|  | * FreeBSD 9 and older are no longer supported. | ||||||
|  | 
 | ||||||
| API and Feature Removals | API and Feature Removals | ||||||
| ------------------------ | ------------------------ | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,31 +12,15 @@ | ||||||
| #endif | #endif | ||||||
| #endif /* __APPLE__ */ | #endif /* __APPLE__ */ | ||||||
| 
 | 
 | ||||||
| #ifdef __FreeBSD__ | /* On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards
 | ||||||
| /*
 |    against multiple definition of wchar_t and wint_t. */ | ||||||
| ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards | #if defined(__FreeBSD__) && defined(_XOPEN_SOURCE_EXTENDED) | ||||||
| ** against multiple definition of wchar_t and wint_t. | # ifndef __wchar_t | ||||||
| */ | #   define __wchar_t | ||||||
| #ifdef _XOPEN_SOURCE_EXTENDED | # endif | ||||||
| #ifndef __FreeBSD_version | # ifndef __wint_t | ||||||
| #include <osreldate.h> | #   define __wint_t | ||||||
| #endif | # endif | ||||||
| #if __FreeBSD_version >= 500000 |  | ||||||
| #ifndef __wchar_t |  | ||||||
| #define __wchar_t |  | ||||||
| #endif |  | ||||||
| #ifndef __wint_t |  | ||||||
| #define __wint_t |  | ||||||
| #endif |  | ||||||
| #else |  | ||||||
| #ifndef _WCHAR_T |  | ||||||
| #define _WCHAR_T |  | ||||||
| #endif |  | ||||||
| #ifndef _WINT_T |  | ||||||
| #define _WINT_T |  | ||||||
| #endif |  | ||||||
| #endif |  | ||||||
| #endif |  | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS) | #if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS) | ||||||
|  |  | ||||||
|  | @ -564,16 +564,6 @@ extern char * _getpty(int *, int, mode_t, int); | ||||||
|  * workaround was provided by Tim Robbins of FreeBSD project. |  * workaround was provided by Tim Robbins of FreeBSD project. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #ifdef __FreeBSD__ |  | ||||||
| #include <osreldate.h> |  | ||||||
| #if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \ |  | ||||||
|     (__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \ |  | ||||||
|     (__FreeBSD_version >= 800000 && __FreeBSD_version < 800001) |  | ||||||
| # define _PY_PORT_CTYPE_UTF8_ISSUE |  | ||||||
| #endif |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| #if defined(__APPLE__) | #if defined(__APPLE__) | ||||||
| #  define _PY_PORT_CTYPE_UTF8_ISSUE | #  define _PY_PORT_CTYPE_UTF8_ISSUE | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -1471,8 +1471,6 @@ async def connect(): | ||||||
|     @unittest.skipUnless(sys.platform != 'win32', |     @unittest.skipUnless(sys.platform != 'win32', | ||||||
|                          "Don't support pipes for Windows") |                          "Don't support pipes for Windows") | ||||||
|     @unittest.skipIf(sys.platform == 'darwin', 'test hangs on MacOS') |     @unittest.skipIf(sys.platform == 'darwin', 'test hangs on MacOS') | ||||||
|     # Issue #20495: The test hangs on FreeBSD 7.2 but pass on FreeBSD 9 |  | ||||||
|     @support.requires_freebsd_version(8) |  | ||||||
|     def test_read_pty_output(self): |     def test_read_pty_output(self): | ||||||
|         proto = MyReadPipeProto(loop=self.loop) |         proto = MyReadPipeProto(loop=self.loop) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4107,8 +4107,6 @@ def test_interrupted_write_unbuffered(self): | ||||||
|     def test_interrupted_write_buffered(self): |     def test_interrupted_write_buffered(self): | ||||||
|         self.check_interrupted_write(b"xy", b"xy", mode="wb") |         self.check_interrupted_write(b"xy", b"xy", mode="wb") | ||||||
| 
 | 
 | ||||||
|     # Issue #22331: The test hangs on FreeBSD 7.2 |  | ||||||
|     @support.requires_freebsd_version(8) |  | ||||||
|     def test_interrupted_write_text(self): |     def test_interrupted_write_text(self): | ||||||
|         self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii") |         self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii") | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -773,14 +773,7 @@ def serve_forever(self, poll_interval): | ||||||
|                               :func:`select` or :func:`poll` call by |                               :func:`select` or :func:`poll` call by | ||||||
|                               :func:`asyncore.loop`. |                               :func:`asyncore.loop`. | ||||||
|         """ |         """ | ||||||
|         try: |  | ||||||
|         asyncore.loop(poll_interval, map=self._map) |         asyncore.loop(poll_interval, map=self._map) | ||||||
|         except OSError: |  | ||||||
|             # On FreeBSD 8, closing the server repeatably |  | ||||||
|             # raises this error. We swallow it if the |  | ||||||
|             # server has been closed. |  | ||||||
|             if self.connected or self.accepting: |  | ||||||
|                 raise |  | ||||||
| 
 | 
 | ||||||
|     def stop(self, timeout=None): |     def stop(self, timeout=None): | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|  | @ -782,9 +782,7 @@ def test_environb(self): | ||||||
|         value_str = value.decode(sys.getfilesystemencoding(), 'surrogateescape') |         value_str = value.decode(sys.getfilesystemencoding(), 'surrogateescape') | ||||||
|         self.assertEqual(os.environ['bytes'], value_str) |         self.assertEqual(os.environ['bytes'], value_str) | ||||||
| 
 | 
 | ||||||
|     # On FreeBSD < 7 and OS X < 10.6, unsetenv() doesn't return a value (issue |     # On OS X < 10.6, unsetenv() doesn't return a value (bpo-13415). | ||||||
|     # #13415). |  | ||||||
|     @support.requires_freebsd_version(7) |  | ||||||
|     @support.requires_mac_ver(10, 6) |     @support.requires_mac_ver(10, 6) | ||||||
|     def test_unset_error(self): |     def test_unset_error(self): | ||||||
|         if sys.platform == "win32": |         if sys.platform == "win32": | ||||||
|  |  | ||||||
|  | @ -559,6 +559,7 @@ def test_makedev(self): | ||||||
|         self.assertRaises(TypeError, posix.minor) |         self.assertRaises(TypeError, posix.minor) | ||||||
|         self.assertRaises((ValueError, OverflowError), posix.minor, -1) |         self.assertRaises((ValueError, OverflowError), posix.minor, -1) | ||||||
| 
 | 
 | ||||||
|  |         # FIXME: reenable these tests on FreeBSD with the kernel fix | ||||||
|         if sys.platform.startswith('freebsd') and dev >= 0x1_0000_0000: |         if sys.platform.startswith('freebsd') and dev >= 0x1_0000_0000: | ||||||
|             self.skipTest("bpo-31044: on FreeBSD CURRENT, minor() truncates " |             self.skipTest("bpo-31044: on FreeBSD CURRENT, minor() truncates " | ||||||
|                           "64-bit dev to 32-bit") |                           "64-bit dev to 32-bit") | ||||||
|  |  | ||||||
|  | @ -138,7 +138,6 @@ def test_linux_constants(self): | ||||||
|             with contextlib.suppress(AttributeError): |             with contextlib.suppress(AttributeError): | ||||||
|                 self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int) |                 self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int) | ||||||
| 
 | 
 | ||||||
|     @support.requires_freebsd_version(9) |  | ||||||
|     def test_freebsd_contants(self): |     def test_freebsd_contants(self): | ||||||
|         for attr in ['SWAP', 'SBSIZE', 'NPTS']: |         for attr in ['SWAP', 'SBSIZE', 'NPTS']: | ||||||
|             with contextlib.suppress(AttributeError): |             with contextlib.suppress(AttributeError): | ||||||
|  |  | ||||||
|  | @ -56,9 +56,6 @@ def test_getsignal(self): | ||||||
|         self.assertEqual(signal.getsignal(signal.SIGHUP), hup) |         self.assertEqual(signal.getsignal(signal.SIGHUP), hup) | ||||||
| 
 | 
 | ||||||
|     # Issue 3864, unknown if this affects earlier versions of freebsd also |     # Issue 3864, unknown if this affects earlier versions of freebsd also | ||||||
|     @unittest.skipIf(sys.platform=='freebsd6', |  | ||||||
|         'inter process signals not reliable (do not mix well with threading) ' |  | ||||||
|         'on freebsd6') |  | ||||||
|     def test_interprocess_signal(self): |     def test_interprocess_signal(self): | ||||||
|         dirname = os.path.dirname(__file__) |         dirname = os.path.dirname(__file__) | ||||||
|         script = os.path.join(dirname, 'signalinterproctester.py') |         script = os.path.join(dirname, 'signalinterproctester.py') | ||||||
|  | @ -651,7 +648,7 @@ def test_itimer_real(self): | ||||||
|         self.assertEqual(self.hndl_called, True) |         self.assertEqual(self.hndl_called, True) | ||||||
| 
 | 
 | ||||||
|     # Issue 3864, unknown if this affects earlier versions of freebsd also |     # Issue 3864, unknown if this affects earlier versions of freebsd also | ||||||
|     @unittest.skipIf(sys.platform in ('freebsd6', 'netbsd5'), |     @unittest.skipIf(sys.platform in ('netbsd5',), | ||||||
|         'itimer not reliable (does not mix well with threading) on some BSDs.') |         'itimer not reliable (does not mix well with threading) on some BSDs.') | ||||||
|     def test_itimer_virtual(self): |     def test_itimer_virtual(self): | ||||||
|         self.itimer = signal.ITIMER_VIRTUAL |         self.itimer = signal.ITIMER_VIRTUAL | ||||||
|  | @ -673,9 +670,6 @@ def test_itimer_virtual(self): | ||||||
|         # and the handler should have been called |         # and the handler should have been called | ||||||
|         self.assertEqual(self.hndl_called, True) |         self.assertEqual(self.hndl_called, True) | ||||||
| 
 | 
 | ||||||
|     # Issue 3864, unknown if this affects earlier versions of freebsd also |  | ||||||
|     @unittest.skipIf(sys.platform=='freebsd6', |  | ||||||
|         'itimer not reliable (does not mix well with threading) on freebsd6') |  | ||||||
|     def test_itimer_prof(self): |     def test_itimer_prof(self): | ||||||
|         self.itimer = signal.ITIMER_PROF |         self.itimer = signal.ITIMER_PROF | ||||||
|         signal.signal(signal.SIGPROF, self.sig_prof) |         signal.signal(signal.SIGPROF, self.sig_prof) | ||||||
|  | @ -762,16 +756,6 @@ def handler(signum, frame): | ||||||
| 
 | 
 | ||||||
|             signal.signal(signum, handler) |             signal.signal(signum, handler) | ||||||
| 
 | 
 | ||||||
|             if sys.platform == 'freebsd6': |  | ||||||
|                 # Issue #12392 and #12469: send a signal to the main thread |  | ||||||
|                 # doesn't work before the creation of the first thread on |  | ||||||
|                 # FreeBSD 6 |  | ||||||
|                 def noop(): |  | ||||||
|                     pass |  | ||||||
|                 thread = threading.Thread(target=noop) |  | ||||||
|                 thread.start() |  | ||||||
|                 thread.join() |  | ||||||
| 
 |  | ||||||
|             tid = threading.get_ident() |             tid = threading.get_ident() | ||||||
|             try: |             try: | ||||||
|                 signal.pthread_kill(tid, signum) |                 signal.pthread_kill(tid, signum) | ||||||
|  | @ -1010,9 +994,6 @@ def read_sigmask(): | ||||||
|         """ |         """ | ||||||
|         assert_python_ok('-c', code) |         assert_python_ok('-c', code) | ||||||
| 
 | 
 | ||||||
|     @unittest.skipIf(sys.platform == 'freebsd6', |  | ||||||
|         "issue #12392: send a signal to the main thread doesn't work " |  | ||||||
|         "before the creation of the first thread on FreeBSD 6") |  | ||||||
|     @unittest.skipUnless(hasattr(signal, 'pthread_kill'), |     @unittest.skipUnless(hasattr(signal, 'pthread_kill'), | ||||||
|                          'need signal.pthread_kill()') |                          'need signal.pthread_kill()') | ||||||
|     def test_pthread_kill_main_thread(self): |     def test_pthread_kill_main_thread(self): | ||||||
|  |  | ||||||
|  | @ -2598,9 +2598,6 @@ def testRecvmsgShorter(self): | ||||||
|     def _testRecvmsgShorter(self): |     def _testRecvmsgShorter(self): | ||||||
|         self.sendToServer(MSG) |         self.sendToServer(MSG) | ||||||
| 
 | 
 | ||||||
|     # FreeBSD < 8 doesn't always set the MSG_TRUNC flag when a truncated |  | ||||||
|     # datagram is received (issue #13001). |  | ||||||
|     @support.requires_freebsd_version(8) |  | ||||||
|     def testRecvmsgTrunc(self): |     def testRecvmsgTrunc(self): | ||||||
|         # Receive part of message, check for truncation indicators. |         # Receive part of message, check for truncation indicators. | ||||||
|         msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, |         msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, | ||||||
|  | @ -2610,7 +2607,6 @@ def testRecvmsgTrunc(self): | ||||||
|         self.assertEqual(ancdata, []) |         self.assertEqual(ancdata, []) | ||||||
|         self.checkFlags(flags, eor=False) |         self.checkFlags(flags, eor=False) | ||||||
| 
 | 
 | ||||||
|     @support.requires_freebsd_version(8) |  | ||||||
|     def _testRecvmsgTrunc(self): |     def _testRecvmsgTrunc(self): | ||||||
|         self.sendToServer(MSG) |         self.sendToServer(MSG) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -25,8 +25,7 @@ | ||||||
| # #12316 and #11870), and fork() from a worker thread is known to trigger | # #12316 and #11870), and fork() from a worker thread is known to trigger | ||||||
| # problems with some operating systems (issue #3863): skip problematic tests | # problems with some operating systems (issue #3863): skip problematic tests | ||||||
| # on platforms known to behave badly. | # on platforms known to behave badly. | ||||||
| platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5', | platforms_to_skip = ('netbsd5', 'hp-ux11') | ||||||
|                      'hp-ux11') |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # A trivial mutable counter. | # A trivial mutable counter. | ||||||
|  |  | ||||||
|  | @ -10,8 +10,6 @@ | ||||||
| 
 | 
 | ||||||
| @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | ||||||
| @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | ||||||
| @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " |  | ||||||
|     "if threads have been used") |  | ||||||
| class TestBreak(unittest.TestCase): | class TestBreak(unittest.TestCase): | ||||||
|     int_handler = None |     int_handler = None | ||||||
| 
 | 
 | ||||||
|  | @ -267,22 +265,16 @@ def test(): | ||||||
| 
 | 
 | ||||||
| @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | ||||||
| @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | ||||||
| @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " |  | ||||||
|     "if threads have been used") |  | ||||||
| class TestBreakDefaultIntHandler(TestBreak): | class TestBreakDefaultIntHandler(TestBreak): | ||||||
|     int_handler = signal.default_int_handler |     int_handler = signal.default_int_handler | ||||||
| 
 | 
 | ||||||
| @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | ||||||
| @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | ||||||
| @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " |  | ||||||
|     "if threads have been used") |  | ||||||
| class TestBreakSignalIgnored(TestBreak): | class TestBreakSignalIgnored(TestBreak): | ||||||
|     int_handler = signal.SIG_IGN |     int_handler = signal.SIG_IGN | ||||||
| 
 | 
 | ||||||
| @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") | ||||||
| @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") | ||||||
| @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " |  | ||||||
|     "if threads have been used") |  | ||||||
| class TestBreakSignalDefault(TestBreak): | class TestBreakSignalDefault(TestBreak): | ||||||
|     int_handler = signal.SIG_DFL |     int_handler = signal.SIG_DFL | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | Drop support of FreeBSD 9 and older. | ||||||
|  | @ -56,16 +56,6 @@ | ||||||
| #endif | #endif | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| /* Before FreeBSD 5.4, system scope threads was very limited resource
 |  | ||||||
|    in default setting.  So the process scope is preferred to get |  | ||||||
|    enough number of threads to work. */ |  | ||||||
| #ifdef __FreeBSD__ |  | ||||||
| #include <osreldate.h> |  | ||||||
| #if __FreeBSD_version >= 500000 && __FreeBSD_version < 504101 |  | ||||||
| #undef PTHREAD_SYSTEM_SCHED_SUPPORTED |  | ||||||
| #endif |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| #if !defined(pthread_attr_default) | #if !defined(pthread_attr_default) | ||||||
| #  define pthread_attr_default ((pthread_attr_t *)NULL) | #  define pthread_attr_default ((pthread_attr_t *)NULL) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -481,10 +481,6 @@ case $ac_sys_system/$ac_sys_release in | ||||||
|   # but used in struct sockaddr.sa_family. Reported by Tim Rice. |   # but used in struct sockaddr.sa_family. Reported by Tim Rice. | ||||||
|   SCO_SV/3.2) |   SCO_SV/3.2) | ||||||
|     define_xopen_source=no;; |     define_xopen_source=no;; | ||||||
|   # On FreeBSD 4, the math functions C89 does not cover are never defined |  | ||||||
|   # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them. |  | ||||||
|   FreeBSD/4.*) |  | ||||||
|     define_xopen_source=no;; |  | ||||||
|   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if |   # 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 |   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which | ||||||
|   # identifies itself as Darwin/7.* |   # identifies itself as Darwin/7.* | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								setup.py
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								setup.py
									
										
									
									
									
								
							|  | @ -1571,12 +1571,6 @@ class db_found(Exception): pass | ||||||
|             macros = dict() |             macros = dict() | ||||||
|             libraries = [] |             libraries = [] | ||||||
| 
 | 
 | ||||||
|         elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): |  | ||||||
|             # FreeBSD's P1003.1b semaphore support is very experimental |  | ||||||
|             # and has many known problems. (as of June 2008) |  | ||||||
|             macros = dict() |  | ||||||
|             libraries = [] |  | ||||||
| 
 |  | ||||||
|         elif host_platform.startswith('openbsd'): |         elif host_platform.startswith('openbsd'): | ||||||
|             macros = dict() |             macros = dict() | ||||||
|             libraries = [] |             libraries = [] | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner