Skip to content
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

Python 3.12: Add 3.12.2 #15955

Draft
wants to merge 63 commits into
base: oi/hipster
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
cc9a772
Python 3.12 import: work in progress
Bill-Sommerfeld Jan 26, 2024
feabbd1
Rename components/python/python312 to components/python/python-312
Bill-Sommerfeld Feb 5, 2024
e596bdb
shared-macros.mk: Add current estimated Python 3.12 EOL date
Bill-Sommerfeld Feb 5, 2024
0398b25
Clean up module additions
Bill-Sommerfeld Feb 5, 2024
71b8345
More patch cleanups.
Bill-Sommerfeld Feb 5, 2024
63771be
_curses_panel now builds (though the config is a bit sloppy)
Bill-Sommerfeld Feb 6, 2024
4575992
python-312: update TODO
Bill-Sommerfeld Feb 6, 2024
eb1df5f
Clean up the patches that fixed up ldflags for stdlib modules.
Bill-Sommerfeld Feb 6, 2024
5ac6b4d
Tests are happy.
Bill-Sommerfeld Feb 6, 2024
15f0e77
Tweak 35-20142.patch to apply cleanly
Bill-Sommerfeld Feb 6, 2024
c0b42a8
Build against OpenSSL 3.1
Bill-Sommerfeld Feb 6, 2024
58b922c
one more file for the openssl change
Bill-Sommerfeld Feb 6, 2024
dc4b2f3
remove NEWS.d changes that confused Quilt
Bill-Sommerfeld Feb 6, 2024
7dd18ea
Refreshed patches with gmake refresh-patch
Bill-Sommerfeld Feb 7, 2024
b8312ea
Remove --with-system-ffi CONFIGURE_OPTION (was obsoleted several rele…
Bill-Sommerfeld Feb 7, 2024
86e744d
mdb python support: it builds
Bill-Sommerfeld Feb 7, 2024
b01c4ab
Revise ucred patch to set library dependencies in configure.ac
Bill-Sommerfeld Feb 8, 2024
c32aa80
Revise dlpi patch to set library dependencies in configure.ac
Bill-Sommerfeld Feb 8, 2024
092d303
Revise rbac patch to set library dependencies in configure.ac
Bill-Sommerfeld Feb 8, 2024
b7d4e60
Revise 20-test_fixes to avoid test failures.
Bill-Sommerfeld Feb 8, 2024
cbc7fb2
In 37-test-zipfile.patch, capitalize OSError correctly.
Bill-Sommerfeld Feb 8, 2024
99b94dd
Work around truncated timestamp issue in test_tarfile
Bill-Sommerfeld Feb 8, 2024
293f856
Solaris's libc timezone code is returning EET rather than MST for
Bill-Sommerfeld Feb 8, 2024
0da5e66
weaken assertions in test_shutil to tolerate rather than expect an ex…
Bill-Sommerfeld Feb 8, 2024
dd47a03
two tests of test_eintr hang on Illumos; they are skipped on macos fo…
Bill-Sommerfeld Feb 8, 2024
e2b4462
Tolerate systems (like illumos) where tcgetwinsize fails if the windo…
Bill-Sommerfeld Feb 8, 2024
9dea1be
Revert to OpenSSL 1.1 due to test failures.
Bill-Sommerfeld Feb 8, 2024
9d928c1
Remove stale ac_cv_* settings.
Bill-Sommerfeld Feb 8, 2024
bb16cd8
All tests either passing or skipped except for test_dtrace
Bill-Sommerfeld Feb 8, 2024
18ee465
Checkpoint my TODO file
Bill-Sommerfeld Feb 8, 2024
28d1167
Drop python312.license; switch to SPDX license identifier
mtelka Feb 7, 2024
b385aa5
Drop COMPONENT_PUBLISH_ENV
mtelka Feb 7, 2024
17dece9
Drop PATH from ENV; it is by default there already
mtelka Feb 7, 2024
1424373
Drop ENV setting
mtelka Feb 7, 2024
9e5eca1
Rename manifests to do not contain $(PYV)
mtelka Feb 7, 2024
8c96194
PYTHON_VERSION
mtelka Feb 7, 2024
8927cee
shared-macros.mk: remove extra line
mtelka Feb 7, 2024
0991d1e
Support for versions like 3.12.0a1
mtelka Feb 7, 2024
e078c17
Remove CONFIGURE_FIX_LIBTOOL_RPATH
mtelka Feb 7, 2024
f83a41f
Python 3.12.2
Bill-Sommerfeld Feb 8, 2024
1a444f8
Drop _LARGEFILE64_SOURCE; we compile 64-bit only
mtelka Feb 8, 2024
5a0f6d4
06-rbac.patch: fix SyntaxWarning
mtelka Feb 8, 2024
63df635
use parallel build
mtelka Feb 8, 2024
cadcd26
Rework epoll patch and improve the description.
mtelka Feb 8, 2024
e60be17
Add patch description.
Bill-Sommerfeld Feb 8, 2024
f1a7d94
no test redirect
mtelka Feb 8, 2024
d55a28a
simplify comment for 35-20142.patch
mtelka Feb 8, 2024
d3efc23
Regenerate sample-manifest after #16009 and adjust real manifests to …
Bill-Sommerfeld Feb 9, 2024
62c5775
Restore python function boundary dtrace probes (WIP)
Bill-Sommerfeld Feb 9, 2024
da5a675
Use default manifest template
mtelka Feb 9, 2024
6a26d8e
python.p5m: use transform for autopyc=false; add missing smtpd.py
mtelka Feb 9, 2024
45bd5ca
Create symlinks in post-install
mtelka Feb 9, 2024
9c9ebf6
Fix python-config symlink and libpython312.so
mtelka Feb 11, 2024
16df028
Set mediators using transforms
mtelka Feb 11, 2024
f349740
$(PYTHON.$(PYTHON_VERSION).$(BITS)) -> $(PYTHON)
mtelka Feb 12, 2024
2da91f6
Improve 64-bit object in 32-bit path lint error handling
mtelka Feb 11, 2024
efae032
Rename python.p5m to Python.p5m and remove commented out actions
mtelka Feb 11, 2024
e728bd0
Attempt to restore dtrace line probe (incomplete WIP)
Bill-Sommerfeld Feb 10, 2024
40c57cf
checkpoint TODO again
Bill-Sommerfeld Feb 10, 2024
bf91f22
Enable USE_CTF
Bill-Sommerfeld Feb 20, 2024
9e956fd
Add GCC_GNU_SHORT_TRIPLET for packages that use ...-solaris2 instead …
Bill-Sommerfeld Feb 20, 2024
a6d172e
Pull in upstream fix for test_xml_etree and test_xml_etree_c
Bill-Sommerfeld Feb 20, 2024
16a665b
Fix recognition of target triple for illumos.
Bill-Sommerfeld Feb 20, 2024
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
199 changes: 199 additions & 0 deletions components/python/python-312/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, Michal Nowak
# Copyright (c) 2021, Aurelien Larcher
#

# hold at openssl 1.1 until test failures with 3.1 are root-caused.
USE_OPENSSL11= yes
USE_PARALLEL_BUILD = yes
USE_CTF=yes

include ../../../make-rules/shared-macros.mk

COMPONENT_NAME= Python
COMPONENT_VERSION= 3.12.2
PYTHON_VERSION = $(subst $(space),.,$(wordlist 1,2,$(subst ., ,$(COMPONENT_VERSION))))
COMPONENT_SUMMARY= The Python interpreter, libraries and utilities
COMPONENT_PROJECT_URL= https://python.org/
COMPONENT_SRC = $(COMPONENT_NAME)-$(HUMAN_VERSION)
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
COMPONENT_ARCHIVE_HASH= sha256:be28112dac813d2053545c14bf13a16401a21877f1a69eb6ea5d84c4a0f3d870
COMPONENT_ARCHIVE_URL = $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
COMPONENT_FMRI = runtime/python-$(subst .,,$(PYTHON_VERSION))
COMPONENT_CLASSIFICATION= Development/Python
COMPONENT_LICENSE= PSF-2.0
COMPONENT_LICENSE_FILE= LICENSE

COMPONENT_FMRI.idle = library/python/idle-$(subst .,,$(PYTHON_VERSION))
COMPONENT_SUMMARY.idle = Python $(PYTHON_VERSION) IDLE (Integrated Development and Learning Environment)

COMPONENT_FMRI.tkinter = library/python/tkinter-$(subst .,,$(PYTHON_VERSION))
COMPONENT_SUMMARY.tkinter = Python $(PYTHON_VERSION) bindings to tcl/tk

include $(WS_MAKE_RULES)/common.mk

PATH= $(PATH.gnu)

# Need to preserve timestamp for Grammar files. If the pickle files are older,
# Python will try to rebuild them.
PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.txt
PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.pickle

# We patch auto* files, so regenerate headers and configure
COMPONENT_PREP_ACTION = (cd $(@D) ; autoheader ; autoconf -f)

# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
# python-config
CC += $(CFLAGS)

gcc_OPT = -O2

CPPFLAGS += -IPython

# to find the ncurses headers
CPPFLAGS += -I/usr/include/ncurses

# libffi for _ctypes
CPPFLAGS += $(shell pkg-config --cflags-only-I libffi)

# because python links with $(CC) ... $(LDFLAGS) ...
LDFLAGS = $(CC_BITS) $(CC_PIC)

# build pic
CFLAGS += $(CC_PIC)
CFLAGS += $(CFLAGS.$(MACH))

# XPG6
CFLAGS += $(CPP_XPG6MODE)

# The python build is profile-guided for gcc. Use of xprofile requires that
# the same options be used during compilation and linking. The targets chosen
# are based on Solaris 11 minimum supported system requirements.
XPROFILE_DIR= $(BUILD_DIR_$(BITS))/.profile

# Configure script should look into sbin folder when looking for dtrace
CONFIGURE_ENV += PATH="$(PATH):/usr/sbin"

CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
CONFIGURE_OPTIONS += --enable-shared
CONFIGURE_OPTIONS += --enable-optimizations
CONFIGURE_OPTIONS += --enable-loadable-sqlite-extensions
CONFIGURE_OPTIONS += --with-dtrace
CONFIGURE_OPTIONS += --with-system-expat
CONFIGURE_OPTIONS += --without-ensurepip
CONFIGURE_OPTIONS += --enable-ipv6
CONFIGURE_OPTIONS += --with-c-locale-coercion
CONFIGURE_OPTIONS += --bindir=$(USRBINDIR)
CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS) -DSKIP_ZIP_PATH "
CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
CONFIGURE_OPTIONS += DFLAGS="-$(BITS)"
CONFIGURE_OPTIONS += XPROFILE_DIR="$(XPROFILE_DIR)"

COMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
COMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)"

# 64 bit shared objects need to go in a 64-bit directory
COMPONENT_INSTALL_ARGS += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python$(PYTHON_VERSION)/lib-dynload

# Simplify the definitions of CC, CXX, CFLAGS and LDFLAGS so they hard-code
# neither paths from our build systems nor Studio-specific options.
COMPONENT_PRE_INSTALL_ACTION= \
(cd $(@D) ; \
$(GSED) -i -e 's/^CC=.*/CC=\t\tgcc/' -e 's/^CXX=.*/CXX=\t\tg++/' \
-e 's/^CFLAGS=.*/CFLAGS=\t\t\$$\(BASECFLAGS) \$$\(OPT) \$$\(EXTRA_CFLAGS)/' \
-e 's|^LDFLAGS=.*|LDFLAGS=|' Makefile)

# Because we stripped the Makefile above, we need to pass several things in the
# environment, and use -e to tell gmake to pay attention to the environment.
COMPONENT_INSTALL_ENV += CC="$(CC)"
COMPONENT_INSTALL_ENV += CXX="$(CXX)"
COMPONENT_INSTALL_ENV += CFLAGS="$(CFLAGS)"
COMPONENT_INSTALL_ENV += LDFLAGS="$(LDFLAGS)"
COMPONENT_INSTALL_ARGS += -e

# Strip build machine paths from _sysconfigdata.py & config/Makefile,
# then (re)compile _sysconfigdata.py since we just updated it.
# Note that once Python 3.9 has been integrated and propagated to build
# machines, then the LD_LIBRARY_PATH setting and PROTO_DIR prefix below
# can both be removed.
COMPONENT_POST_INSTALL_ACTION= \
(cd $(PROTOUSRLIBDIR)/python$(PYTHON_VERSION) ; \
$(GSED) -i -e 's|$(SOURCE_DIR)|.|g' -e 's|$(COMPONENT_DIR)|..|g' \
-e 's|$(SPRO_VROOT)/bin/||g' _sysconfigdata__sunos5_$(GCC_GNU_SHORT_TRIPLET).py config-$(PYTHON_VERSION)-$(GCC_GNU_SHORT_TRIPLET)/Makefile; \
LD_LIBRARY_PATH=$(PROTOUSRLIBDIR64) $(PROTO_DIR)$(PYTHON) -m py_compile _sysconfigdata__sunos5_$(GCC_GNU_SHORT_TRIPLET).py) ;

# Create symlinks without ending '3' for binaries
COMPONENT_POST_INSTALL_ACTION += \
for f in idle pydoc python ; do \
$(SYMLINK) $${f}$(PYTHON_VERSION) $(PROTOUSRBINDIR)/$$f ; \
done ; \
$(SYMLINK) python$(PYTHON_VERSION)-config $(PROTOUSRBINDIR)/python-config ;

# Allow mediated libpython3.so stable ABI
COMPONENT_POST_INSTALL_ACTION += \
$(MV) $(PROTOUSRLIBDIR.$(BITS))/libpython3.so $(PROTOUSRLIBDIR.$(BITS))/libpython$(subst .,,$(PYTHON_VERSION)).so ; \
$(SYMLINK) libpython$(subst .,,$(PYTHON_VERSION)).so $(PROTOUSRLIBDIR.$(BITS))/libpython3.so ;

# You can set TESTOPTS_PYTHON_TEST to a particular test if you want to run just
# one test. For example:
# $ TESTOPTS_PYTHON_TEST=test_sys
TESTOPTS_PYTHON_TEST=

# Using "-uall,-network" ensures all tests are run except the network tests.
# The network tests contain many expected failures when run behind a firewall.
# The "-v" ensures verbose mode.
COMPONENT_TEST_ENV += EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)"

# Override default test target. See README.rst.
COMPONENT_TEST_TARGETS = test

# The test output contains details from each test, in whatever order they
# complete. The default _TRANSFORMER is not powerful enough to deal with
# this; we need heavier artillery. Extract just the sections that start
# with "tests OK." and end with "Re-running failed tests..." for comparison.
COMPONENT_TEST_TRANSFORMER= $(NAWK)
COMPONENT_TEST_TRANSFORMS= "'/tests OK./ {results = 1}; /Total duration/ {results = 0}; /Re-running failed tests in verbose mode/ {results = 0} {if (results) print $0 }'"

# Required for dump(1)
REQUIRED_PACKAGES += developer/object-file
# Required to build ossaudiodev module
REQUIRED_PACKAGES += system/header/header-audio

# Auto-generated dependencies
REQUIRED_PACKAGES += compress/bzip2
REQUIRED_PACKAGES += compress/xz
REQUIRED_PACKAGES += database/sqlite-3
REQUIRED_PACKAGES += library/database/gdbm
REQUIRED_PACKAGES += library/expat
REQUIRED_PACKAGES += library/libffi
REQUIRED_PACKAGES += library/ncurses
REQUIRED_PACKAGES += library/readline
REQUIRED_PACKAGES += library/security/openssl-11
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += runtime/tcl-8
REQUIRED_PACKAGES += runtime/tk-8
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/math
Loading