Skip to content

Conversation

@jefferyto
Copy link
Member

Maintainer: me
Compile tested: none (cherry pick from #21030)
Run tested: none

Description:
These are all of the fixes and update to Python 3.11.3 from #21030.

jefferyto added 8 commits May 24, 2023 12:31
--without-pymalloc was added in 7bf1ae6
because leaving it enabled added an "m" flag/suffix to file names.

This flag/suffix was removed in Python 3.8[1], so disabling pymalloc is
no longer necessary.

[1]: https://docs.python.org/3.8/whatsnew/3.8.html#build-and-c-api-changes

Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit 3032e70)
003-do-not-run-distutils-tests.patch was removed in
4e05541. This patch stopped "make
install" from, among other things, running compileall.

When this patch was removed, "make install" ran compileall as normal and
created bytecode files in __pycache__ directories. These files were then
packaged in python3-light.

This adds a patch to stop compileall from being run during "make
install".

Fixes: 4e05541 ("python3: bump to version 3.10.0")
Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit 8a4da01)
The Makefile lines to add READELF to TARGET_CONFIGURE_OPTS was removed
in 4e05541.

Without setting READELF, configure finds the symlink to
$(TARGET_CROSS)readelf (e.g. arm-openwrt-linux-readelf) instead of
$(TARGET_CROSS)readelf (e.g. arm-openwrt-linux-muslgnueabi-readelf).

This leads to the symlink name being saved to _sysconfigdata.py, and so
the readelf name is not replaced correctly (in
Py3Package/python3-base/install).

This restores the removed Makefile lines.

Fixes: 4e05541 ("python3: bump to version 3.10.0")
Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit e1a9578)
When doing parallel builds, host Python can install the python3 symlink
before the Python standard library is installed completely.

When this occurs, it is possible for other packages to detect the
python3 symlink and try to use host Python before it is fully installed.

This adds a patch to make commoninstall (where the standard library is
installed) a prerequisite of bininstall (where the python3 symlink is
installed), so that commoninstall is fully completed before bininstall
begins.

Patch has been submitted upstream:
python/cpython#104693

Fixes: openwrt#19241

Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit 67e47f1)
By default, the Python build process will add /usr/local/{lib,include},
and multiarch paths (e.g. /usr/{lib,include}/x86_64-linux-gnu) if
building on Debian/Ubuntu, to its library and includes paths.

006-remove-multi-arch-and-local-paths.patch was added in
84202f1 to stop the Python build
process from adding these paths.

006-remove-multi-arch-and-local-paths.patch was removed in
48277ec.

006-do-not-add-multiarch-paths-when-cross-compiling.patch was added in
0c8b0b0 to stop the Python build
process from adding these paths for target Python.

These paths are still added by the Python build process when building
host Python.

This replaces the cross-compiling-only patch with the original patch,
renamed slightly and adapted for Python 3.10.

Fixes: 48277ec ("python3: bump to version 3.8")
Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit f006d0e)
This adds $(STAGING_DIR_HOST)/include/e2fsprogs to HOST_CFLAGS and
HOST_CPPFLAGS so that configure can find uuid/uuid.h.

Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit 44fb492)
026-openssl-feature-flags.patch and
028-host-python-support-ssl-with-libressl.patch were removed in
4ecd9d6 to fix the ssl module after
libressl was upgraded to 3.7.0[1].

However, the cause of the ssl module build failure was only
028-host-python-support-ssl-with-libressl.patch.

Removing 026-openssl-feature-flags.patch caused a build failure for the
hashlib module.

This restores 026-openssl-feature-flags.patch with an updated version of
the patch from OpenBSD[2].

[1]: openwrt#20107
[2]: https://github.com/openbsd/ports/blob/26a04435bf2a09dcbe22b718bfee08997617a906/lang/python/3.10/patches/patch-Modules__hashopenssl_c

Fixes: 4ecd9d6 ("python3: fix ssl support by removing libressl patches")
Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit 02eb5c1)
* Removed patches:

  * 001-enable-zlib.patch: zlib module should be enabled automatically

  * 007-distutils-do-not-adjust-path.patch: Not necessary since we
    process shebang lines for all scripts (in python3-package.mk)

  * 030-bpo-43112-detect-musl-as-a-separate-SOABI-openwrtGH-24502.patch:
    Already merged

* Move configure vars from config.site back into Makefile

  Centralizing all build information into one file makes it easier to
  maintain

* No longer set ac_cv_header_uuid_h=yes as configure should detect
  libuuid

* Order configure args by enable-/disable-/with-/without-, then
  alphabetically

* Set ac_cv_working_openssl_hashlib=yes for host configure to bypass the
  OpenSSL API tests with LibreSSL

* Use the default Host/Compile recipe instead of picking out specific
  targets to make

Signed-off-by: Jeffery To <[email protected]>
(cherry picked from commit 2445fe9)
@mhei mhei added the OpenWrt 23.05 (end of support) Issue/PR on branch 23.05 label May 24, 2023
@jefferyto
Copy link
Member Author

CI failing due to missing sdk Docker images for 23.05 - ping @aparcar.

@1715173329 1715173329 merged commit 9626223 into openwrt:openwrt-23.05 May 25, 2023
@jefferyto jefferyto deleted the python-3.11.3-openwrt-23.05 branch May 25, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OpenWrt 23.05 (end of support) Issue/PR on branch 23.05

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants