Skip to content

bpo-42173: WIP: Drop Solaris support #23002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ Process-wide parameters

Return the platform identifier for the current platform. On Unix, this is
formed from the "official" name of the operating system, converted to lower
case, followed by the major revision number; e.g., for Solaris 2.x, which is
also known as SunOS 5.x, the value is ``'sunos5'``. On Mac OS X, it is
case, followed by the major revision number. On Mac OS X, it is
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
static storage; the caller should not modify its value. The value is available
to Python code as ``sys.platform``.
Expand Down
1 change: 0 additions & 1 deletion Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,6 @@ other utility module.

* ``linux-i586``
* ``linux-alpha``
* ``solaris-2.6-sun4u``

For non-POSIX platforms, currently just returns ``sys.platform``.

Expand Down
10 changes: 1 addition & 9 deletions Doc/library/gettext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,6 @@ unexpected, or if other problems occur while reading the file, instantiating a
.. deprecated-removed:: 3.8 3.10


Solaris message catalog support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The Solaris operating system defines its own binary :file:`.mo` file format, but
since no documentation can be found on this format, it is not supported at this
time.


The Catalog constructor
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -722,7 +714,7 @@ implementations, and valuable experience to the creation of this module:
.. rubric:: Footnotes

.. [#] The default locale directory is system dependent; for example, on RedHat Linux
it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/locale`.
it is :file:`/usr/share/locale`.
The :mod:`gettext` module does not try to support these system dependent
defaults; instead its default is :file:`{sys.base_prefix}/share/locale` (see
:data:`sys.base_prefix`). For this reason, it is always best to call
Expand Down
12 changes: 4 additions & 8 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2663,14 +2663,6 @@ features:

Time of file creation.

On Solaris and derivatives, the following attributes may also be
available:

.. attribute:: st_fstype

String that uniquely identifies the type of the filesystem that
contains the file.

On Mac OS systems, the following attributes may also be available:

.. attribute:: st_rsize
Expand Down Expand Up @@ -2735,6 +2727,10 @@ features:
files as :const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK`
as appropriate.

.. versionadded:: 3.10
Removed the :attr:`st_fstype` member of Solaris/derivatives.


.. function:: statvfs(path)

Perform a :c:func:`statvfs` system call on the given path. The return value is
Expand Down
5 changes: 2 additions & 3 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ Cross Platform
may look different on different platforms and this is intended.

If *aliased* is true, the function will use aliases for various platforms that
report system names which differ from their common names, for example SunOS will
be reported as Solaris. The :func:`system_alias` function is used to implement
this.
report system names which differ from their common names. The
:func:`system_alias` function is used to implement this.

Setting *terse* to true causes the function to return only the absolute minimum
information needed to identify the platform.
Expand Down
8 changes: 2 additions & 6 deletions Doc/library/posix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Large File Support

.. sectionauthor:: Steve Clift <clift@mail.anacapa.net>

Several operating systems (including AIX, HP-UX, Irix and Solaris) provide
Several operating systems (including AIX) provide
support for files that are larger than 2 GiB from a C programming model where
:c:type:`int` and :c:type:`long` are 32-bit values. This is typically accomplished
by defining the relevant size and offset types as 64-bit values. Such files are
Expand All @@ -47,11 +47,7 @@ Large file support is enabled in Python when the size of an :c:type:`off_t` is
larger than a :c:type:`long` and the :c:type:`long long` is at least as large
as an :c:type:`off_t`.
It may be necessary to configure and compile Python with certain compiler flags
to enable this mode. For example, it is enabled by default with recent versions
of Irix, but with Solaris 2.6 and 2.7 you need to do something like::

CFLAGS="`getconf LFS_CFLAGS`" OPT="-g -O2 $CFLAGS" \
./configure
to enable this mode.

On large-file-capable Linux systems, this might work::

Expand Down
3 changes: 1 addition & 2 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ always available.

For Unix systems, except on Linux and AIX, this is the lowercased OS name as
returned by ``uname -s`` with the first part of the version as returned by
``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, *at the time
``uname -r`` appended, e.g. ``'freebsd8'``, *at the time
when Python was built*. Unless you want to test for a specific system
version, it is therefore recommended to use the following idiom::

Expand Down Expand Up @@ -1561,7 +1561,6 @@ always available.
| | |
| | * ``'nt'``: Windows threads |
| | * ``'pthread'``: POSIX threads |
| | * ``'solaris'``: Solaris threads |
+------------------+---------------------------------------------------------+
| :const:`lock` | Name of the lock implementation: |
| | |
Expand Down
1 change: 0 additions & 1 deletion Doc/library/sysconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ Other functions

- linux-i586
- linux-alpha (?)
- solaris-2.6-sun4u

Windows will return one of:

Expand Down
13 changes: 1 addition & 12 deletions Doc/library/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ Functions
>>> time.strftime('%X %x %Z')
'16:08:12 05/08/03 AEST'

On many Unix systems (including \*BSD, Linux, Solaris, and Darwin), it is more
On many Unix systems (including \*BSD, Linux, and Darwin), it is more
convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) database to
specify the timezone rules. To do this, set the :envvar:`TZ` environment
variable to the path of the required timezone datafile, relative to the root of
Expand Down Expand Up @@ -726,17 +726,6 @@ These constants are used as parameters for :func:`clock_getres` and
.. versionadded:: 3.7


.. data:: CLOCK_HIGHRES

The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal
hardware source, and may give close to nanosecond resolution.
``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock.

.. availability:: Solaris.

.. versionadded:: 3.3


.. data:: CLOCK_MONOTONIC

Clock that cannot be set and represents monotonic time since some unspecified
Expand Down
7 changes: 0 additions & 7 deletions Doc/using/unix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ On FreeBSD and OpenBSD
pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz


On OpenSolaris
--------------

You can get Python from `OpenCSW <https://www.opencsw.org/>`_. Various versions
of Python are available and can be installed with e.g. ``pkgutil -i python27``.


.. _building-python-on-unix:

Building Python
Expand Down
5 changes: 0 additions & 5 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,6 @@ Please be conservative with adding new ones, document them and enclose them
in platform-specific #ifdefs.
**************************************************************************/

#ifdef SOLARIS
/* Unchecked */
extern int gethostname(char *, int);
#endif

#ifdef HAVE__GETPTY
#include <sys/types.h> /* we need to import mode_t */
extern char * _getpty(int *, int, mode_t, int);
Expand Down
4 changes: 2 additions & 2 deletions Lib/cgi.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/local/bin/python

# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# intentionally NOT "/usr/bin/env python". On many systems,
# /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env would be unable to find python. Granted,
# binary installations by Linux vendors often install Python in
Expand Down
2 changes: 1 addition & 1 deletion Lib/ctypes/test/test_byteswap.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_struct_fields_2(self):
# So, we have to align using pad bytes.
#
# Unaligned accesses will crash Python (on those platforms that
# don't allow it, like sparc solaris).
# don't allow it, like sparc).
if sys.byteorder == "little":
base = BigEndianStructure
fmt = ">bxhid"
Expand Down
100 changes: 20 additions & 80 deletions Lib/ctypes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,46 +149,27 @@ def _findLib_gcc(name):
return os.fsdecode(file)


if sys.platform == "sunos5":
# use /usr/ccs/bin/dump on solaris
def _get_soname(f):
if not f:
return None

try:
proc = subprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
except OSError: # E.g. command not found
return None
with proc:
data = proc.stdout.read()
res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', data)
if not res:
return None
return os.fsdecode(res.group(1))
else:
def _get_soname(f):
# assuming GNU binutils / ELF
if not f:
return None
objdump = shutil.which('objdump')
if not objdump:
# objdump is not available, give up
return None
def _get_soname(f):
# assuming GNU binutils / ELF
if not f:
return None
objdump = shutil.which('objdump')
if not objdump:
# objdump is not available, give up
return None

try:
proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
except OSError: # E.g. bad executable
return None
with proc:
dump = proc.stdout.read()
res = re.search(br'\sSONAME\s+([^\s]+)', dump)
if not res:
return None
return os.fsdecode(res.group(1))
try:
proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
except OSError: # E.g. bad executable
return None
with proc:
dump = proc.stdout.read()
res = re.search(br'\sSONAME\s+([^\s]+)', dump)
if not res:
return None
return os.fsdecode(res.group(1))

if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")):

Expand Down Expand Up @@ -224,47 +205,6 @@ def find_library(name):
res.sort(key=_num_version)
return os.fsdecode(res[-1])

elif sys.platform == "sunos5":

def _findLib_crle(name, is64):
if not os.path.exists('/usr/bin/crle'):
return None

env = dict(os.environ)
env['LC_ALL'] = 'C'

if is64:
args = ('/usr/bin/crle', '-64')
else:
args = ('/usr/bin/crle',)

paths = None
try:
proc = subprocess.Popen(args,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
env=env)
except OSError: # E.g. bad executable
return None
with proc:
for line in proc.stdout:
line = line.strip()
if line.startswith(b'Default Library Path (ELF):'):
paths = os.fsdecode(line).split()[4]

if not paths:
return None

for dir in paths.split(":"):
libfile = os.path.join(dir, "lib%s.so" % name)
if os.path.exists(libfile):
return libfile

return None

def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

else:

def _findSoname_ldconfig(name):
Expand Down
2 changes: 1 addition & 1 deletion Lib/distutils/command/bdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class bdist(Command):
no_format_option = ('bdist_rpm',)

# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
# Debian-ish Linux, FreeBSD, ..., Windows, Mac OS.
default_format = {'posix': 'gztar',
'nt': 'zip'}

Expand Down
2 changes: 1 addition & 1 deletion Lib/distutils/tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def setUp(self):
self.tempdirs = []

def tearDown(self):
# Restore working dir, for Solaris and derivatives, where rmdir()
# Restore working dir, for Windows, where rmdir()
# on the current directory fails.
os.chdir(self.old_cwd)
super().tearDown()
Expand Down
21 changes: 0 additions & 21 deletions Lib/distutils/tests/test_build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,6 @@ def test_xx(self):
""")
assert_python_ok('-c', code)

def test_solaris_enable_shared(self):
dist = Distribution({'name': 'xx'})
cmd = self.build_ext(dist)
old = sys.platform

sys.platform = 'sunos' # fooling finalize_options
from distutils.sysconfig import _config_vars
old_var = _config_vars.get('Py_ENABLE_SHARED')
_config_vars['Py_ENABLE_SHARED'] = 1
try:
cmd.ensure_finalized()
finally:
sys.platform = old
if old_var is None:
del _config_vars['Py_ENABLE_SHARED']
else:
_config_vars['Py_ENABLE_SHARED'] = old_var

# make sure we get some library dirs under solaris
self.assertGreater(len(cmd.library_dirs), 0)

def test_user_site(self):
import site
dist = Distribution({'name': 'xx'})
Expand Down
11 changes: 0 additions & 11 deletions Lib/distutils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def get_host_platform():
Examples of returned values:
linux-i586
linux-alpha (?)
solaris-2.6-sun4u

Windows will return one of:
win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
Expand Down Expand Up @@ -68,16 +67,6 @@ def get_host_platform():
# i386, etc.
# XXX what about Alpha, SPARC, etc?
return "%s-%s" % (osname, machine)
elif osname[:5] == "sunos":
if release[0] >= "5": # SunOS 5 == Solaris 2
osname = "solaris"
release = "%d.%s" % (int(release[0]) - 3, release[2:])
# We can't use "platform.architecture()[0]" because a
# bootstrap problem. We use a dict to get an error
# if some suspicious happens.
bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
machine += ".%s" % bitness[sys.maxsize]
# fall through to standard osname-release-machine representation
elif osname[:3] == "aix":
from _aix_support import aix_platform
return aix_platform()
Expand Down
3 changes: 0 additions & 3 deletions Lib/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
# to do binary searches and lazy initializations. Or you might want to use
# the undocumented double-hash algorithm for .mo files with hash tables, but
# you'll need to study the GNU gettext code to do this.
#
# - Support Solaris .mo file formats. Unfortunately, we've been unable to
# find this format documented anywhere.


import os
Expand Down
Loading