670 Commits

Author SHA1 Message Date
sthen
bc85bbe650 list allowed values if an unknown MODPY_PYBUILD is used 2022-11-29 11:19:45 +00:00
sthen
57d2b90569 adjust warning text from the 'Try to detect the case where a port will
build regardless of setuptools' check to suggest MODPY_PYBUILD not just
MODPY_SETUPTOOLS
2022-11-28 21:16:55 +00:00
sthen
d858b7cc2a Ports built with setuptools on python 3.10 don't need a RUN_DEPENDS on
setuptools (it's used as a package locator but importlib.metadata in
newer Python core or the external importlib_metadata are preferred).
So drop the RDEP in that case (it's still kept for py27) and bump
revisions.
2022-11-26 23:28:11 +00:00
sthen
fd403c631e fix -tests package spec, should not conflict with py27 2022-11-26 20:04:23 +00:00
sthen
b7554f3b92 warn if MODPY_PYBUILD is used and not set to setuptools_scm when the
port appears to need setuptools_scm.
2022-11-25 16:33:15 +00:00
sthen
f04e702653 use absolute paths in MODPY_TEST_LIBDIR, relative paths don't work if
MODPY_TEST_DIR is set
2022-11-25 16:32:04 +00:00
sthen
80fda491b1 switch MODPY_DEFAULT_VERSION_3 to 3.10 2022-11-13 15:26:02 +00:00
tb
9e438e0f0d Python: Undo the readline hack again now that most snapshots have caught
up with the rlstdc.h change.

ok kmos (maintainer), sthen
2022-11-05 20:46:24 +00:00
sthen
a8dd03208c Patch Modules/readline.c to workaround an issue with the readline module
with Python 3.9+'s definition of PyMODINIT_FUNC and our readline headers
https://github.com/openbsd/src/blob/master/gnu/lib/libreadline/rlstdc.h#L41

(Due to some other strangeness in the build system, on 3.9 it rebuilt a
working version after the first attempt failed and the file was moved out
of the way, but that no longer happens with 3.10+ where readline just
failed).

Fix up PLISTs and WANTLIB for Python 3.11 while there.

Joint work with landry@ tb@ kmos@, ok tb kmos
2022-11-01 16:18:22 +00:00
kmos
633af1ae20 Add Python 3.11.0 to build and python.port.mk
ok sthen@ tb@
2022-10-31 22:06:28 +00:00
kmos
e527e1494f Import Python 3.11.0
https://www.python.org/downloads/release/python-3110/

Still has the same readline module problem as 3.10

Tweaks and ok from tb@ and sthen@
2022-10-31 22:05:43 +00:00
sthen
3c1c57ea49 add notes about keeping REVISION/PKGNAME in -current/next release above the
version in -stable of the previous release when plist is changed etc
(e.g. backporting updates to -stable after swotching the default
Python version during a release cycle means that -current needs
to keep ahead of -stable, to avoid problems with -stable packages
at the next release)
2022-10-23 10:14:04 +00:00
tb
12c0e7a6d6 python 3.x: Fix broken _sha3 based on XKCP (CVE-2022-37454).
ok kmos sthen
2022-10-21 16:04:46 +00:00
sthen
a524a79267 bump REVISION-tkinter for 7.2-current to keep it at a higher revision number
than we had in 7.1-stable (dependencies etc were changed).
2022-10-21 11:44:59 +00:00
kmos
cae219a400 Upgrade to Python 3.9.15
https://docs.python.org/release/3.9.15/whatsnew/changelog.html

gh-97616: Fix multiplying a list by an integer (list *= int): detect the
          integer overflow when the new allocated length is close to the
          maximum size. Issue reported by Jordan Limor. Patch by Victor
          Stinner.

gh-97612: Fix a shell code injection vulnerability in the
          get-remote-certificate.py example script. The script no longer
          uses a shell to run openssl commands. Issue reported and
          initial fix by Caleb Shortt. Patch by Victor Stinner.

Also a couple non-security fixes.

ok sthen
2022-10-14 15:12:13 +00:00
kmos
7b403dee30 https://docs.python.org/3.10/whatsnew/changelog.html#changelog
gh-97616: Fix multiplying a list by an integer (list *= int): detect the
          integer overflow when the new allocated length is close to the
          maximum size. Issue reported by Jordan Limor. Patch by Victor
          Stinner.

gh-97612: Fix a shell code injection vulnerability in the
          get-remote-certificate.py example script. The script no longer
          uses a shell to run openssl commands. Issue reported and
          initial fix by Caleb Shortt. Patch by Victor Stinner.

gh-68966: The deprecated mailcap module now refuses to inject unsafe text
          (filenames, MIME types, parameters) into shell
          commands. Instead of using such text, it will warn and act as
          if a match was not found (or for test commands, as if the test
          failed).

ok sthen
2022-10-14 15:11:26 +00:00
sthen
2206a80000 rename MODPY_PEP517 to MODPY_PYBUILD which is a bit less of a
magic-numbers name and more of a nod at the frontend we're actually
using for the build.
2022-09-13 20:56:17 +00:00
sthen
038dae1c19 allow adding to LIB_DEPENDS-main / WANTLIB-main from a subdir 2022-09-12 21:12:39 +00:00
sthen
d1168dff6f add MODPY_PEP517=setuptools_scm to add the extra dep 2022-09-12 19:52:16 +00:00
kmos
693838ebf4 https://www.python.org/downloads/release/python-3107/
* gh-95778: Converting between int and str in bases other than 2
(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10
(decimal) now raises a ValueError if the number of digits in string form
is above a limit to avoid potential denial of service attacks due to the
algorithmic complexity. This is a mitigation for CVE-2020-10735.

This new limit can be configured or disabled by environment variable,
command line flag, or sys APIs. See the integer string conversion length
limitation documentation. The default limit is 4300 digits in string
form.

Patch by Gregory P. Smith [Google] and Christian Heimes [Red Hat] with
feedback from Victor Stinner, Thomas Wouters, Steve Dower, Ned Deily,
and Mark Dickinson.

ok sthen
2022-09-08 19:36:23 +00:00
kmos
a61bb383c7 https://www.python.org/downloads/release/python-3914/
* CVE-2020-10735: converting between int and str in bases other than
2 (binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10
(decimal) now raises a ValueError if the number of digits in string form
is above a limit to avoid potential denial of service attacks due to the
algorithmic complexity.

* gh-87389: http.server: Fix an open redirection vulnerability in the
HTTP server when an URI path starts with //.

* gh-93065: Fix contextvars HAMT implementation to handle iteration over
deep trees to avoid a potential crash of the interpreter.

* gh-90355: Fix ensurepip environment isolation for the subprocess
running pip.

ok sthen
2022-09-08 19:35:46 +00:00
sthen
609e6accdd Python tidying:
in one of the 3.9.x updates we accidentally lost the "Make sure
CPPFLAGS/LDFLAGS passed to ./configure don't end up -in
PY_CPPFLAGS/PY_LDFLAGS and thus leaking to python extensions" in
a merge.

The original problem this was fixing was a path to the ports WRKDIR
appearing in the built package. (which showed up in "python3.9 -m
sysconfig|grep LDSH" etc).

However that problem no longer shows up in 3.9, so it seems sensible
to sync 3.10 to what we have now for 3.9 and remove the patch, and
update CHANGES.OpenBSD (removing the bogus entry for 3.9, and the
no-longer-needed one for 3.10).

ok kmos@
2022-09-02 16:53:49 +00:00
sthen
9b1b49cfee Python tidying: remove old build-system patch which replaced ${INSTALL_DATA}
with cp, presumably it was used as part of build rather than fake-install
and had problems with non-root builds. install has been mocked in ports
builds for some time now (as part of the PORTS_PRIVSEP) so that's not needed.
ok kmos@
2022-09-02 16:49:03 +00:00
sthen
df75ef21c7 fix r1.164 differently, don't adjust MODPY_CMD which is actually used
in port Makefiles (I thought it was internal). fixes calibre
2022-08-29 15:43:20 +00:00
sthen
2628d6aa03 set "nojunk" for setuptools builds done via MODPY_PEP517 (already set
for those builds done via MODPY_SETUPTOOLS - I was hoping we'd get
away without it for pep517 setuptools builds but naddy ran into a
build problem with py-cryptography which seems that it can only have
happened if importlib-metadata was installed and junked at the wrong
time during build)

we _may_ need nojunk for the other pep517 backends but let's try to
avoid it if possible first.
2022-08-29 13:23:02 +00:00
sthen
bf5b2cd548 Remove patching around libreadline in Python; this was added after
OpenBSD 5.4 to prevent picking up ports libreadline if installed during
build, but this was fixed differently in the libreadline port after 5.5
instead (by moving the headers to a directory which is not usually
picked up by default).

Found while investigating why readline is broken in the Python 3.10
port (but doesn't fix that issue). Also changes to the build in py3.10
mean that this patching no longer worked for the original issue.

ok kmos@
2022-08-29 12:23:42 +00:00
sthen
0d61a66187 make sure MAKE_ENV is passed in for MODPY_PEP517 builds 2022-08-26 13:39:36 +00:00
sthen
20f0a9c7c7 setup default MODPY_TEST_LIBDIR to include the build dir used by pep517 ports 2022-08-22 14:42:38 +00:00
sthen
8fc67391ae PEP 517-based ports don't have "./setup.py test" (which was deprecated
anyway), so in the case of MODPY_PEP517, default to MODPY_PYTEST=Yes to
use py-test infrastructure.
2022-08-22 11:16:50 +00:00
sthen
cbe17bf091 add src to PYTHONPATH for MODPY_PYTEST ports (as well as
the existing lib, src, and the constructed lib.openbsd-$OBSD_VER-arch-$PY_VER)
2022-08-18 19:32:47 +00:00
sthen
e77e795dc1 handle MODPY_PEP517=poetry-core for automatically adding the bdep, ok kmos@ 2022-08-18 00:50:52 +00:00
sthen
35f910e621 use ${MODPY_BIN} -m build rather than pip to build wheels 2022-08-16 12:10:28 +00:00
sthen
08ce32504c don't trigger the MODPY_PEP517 printf unless there's a build-backend line
in the file for now
2022-08-15 23:06:29 +00:00
sthen
56a3e4da96 MODPY_PEP517=setuptools also needs py-wheel 2022-08-15 11:51:42 +00:00
sthen
b146ee177c add setuptools as a MODPY_PEP517 backend.
change from substring match to equality checks so that e.g. listing multiple
backends for MODPY_PEP517 isn't allowed (AFAIK it won't be needed anyway,
it's possible to just set "yes" instead of a backend name and list the
deps in a port itself, plus it wasn't handled properly in the pile of
.elifs).
2022-08-15 10:58:15 +00:00
sthen
cadb24e98d Print some text to show in the log when generating a minimal setup.py
for setuptools ports with no distributed setup.py file; this suggests that
they probably ought to use MODPY_PEP517 instead so it's helpful to have
this show up in build logs.
2022-08-15 10:55:56 +00:00
jca
00b363c7a3 Don't enable profile-guided optimizations on armv7 (fails with out of memory)
Pointed out by phessler@, ok kmos@ (maintainer)
2022-08-14 23:35:01 +00:00
sthen
831f6c45e9 don't allow setting both MODPY_SETUPTOOLS and MODPY_PEP517 2022-08-14 13:22:57 +00:00
sthen
0260e06f81 allow MODPY_PEP517=Yes to avoid the fatal, it is needed in some
cases (e.g. when using build backend internal to the distribution)
2022-08-13 17:20:17 +00:00
sthen
58ebbb9cb3 add a Fatal for unknown MODPY_PEP517 values. 2022-08-13 17:18:16 +00:00
sthen
b884d8b9ee s/hatch/hatchling/ for MODPY_PEP517 2022-08-13 17:16:37 +00:00
sthen
4c3986bdbb add build infrastructure for Python ports using PEP517, ok kmos 2022-08-13 17:10:46 +00:00
sthen
93b5f0d3b1 remove unnecessary "s in variables passed to pkg_create (one remains,
for a string with trailing whitespace).
2022-08-13 17:05:19 +00:00
kmos
bebe94f215 Update to Python 3.10.6
https://docs.python.org/release/3.10.6/whatsnew/changelog.html#python-3-10-6-final

ok sthen@
2022-08-11 14:01:18 +00:00
kmos
64f7bd3d5d Retire and remove Python 3.8 from the ports tree.
A release has already happened with 3.9 as the default python 3
version.

ok sthen@
2022-08-11 02:15:02 +00:00
gkoehler
910c139702 Don't --enable-optimizations on powerpc
This unbreaks python 3.* on powerpc.  The build had enabled PGO
(Profile Guided Optimization), then got "Segmentation fault" from the
./python binary.  This seems to be a bug in clang or lld specific to
32-bit powerpc.  We continue to --enable-optimizations on powerpc64.

ok kmos@, sthen@
2022-08-07 17:00:43 +00:00
sthen
418e62139b tweak the simple generated setup.py script currently used for
pyproject.toml-only ports - add a comment making it clear that it was
generated by python.port.mk; makes it easier to identify where it came
from when looking at files in a port's WRKSRC
2022-08-04 19:15:59 +00:00
robert
4474a47a51 do not enable optimizations in here, it was left here as a mistake 2022-08-01 11:16:35 +00:00
robert
1b98a91114 add --enable-optimizations configure flag to architectures using lld where
llvm-profdata is also available to enable PGO builds

ok sthen@
2022-07-27 06:20:10 +00:00
tb
36ae4dfd1a Fix Python 3.10 build now that we have SSL_CTX_security_level().
We also no longer need to adjust PY_SSL_DEFAULT_CIPHER_STRING.
Update CHANGES.OpenBSD accordingly.
2022-07-07 13:08:53 +00:00