aboutsummaryrefslogtreecommitdiff
path: root/lang/python/python3
Commit message (Collapse)AuthorAge
...
* python3: bump to version 3.9.4Alexandru Ardelean2021-04-05
| | | | | | For some reason Python3 jumped from 3.9.2 to 3.9.4 in about a week. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python3: Update to 3.9.2, refresh patchesJeffery To2021-02-22
| | | | | | | | | Includes fixes for: * CVE-2021-3177 - ctypes: Buffer overflow in PyCArg_repr * CVE-2021-23336 - urllib parse_qsl(): Web cache poisoning - semicolon as a query args separator Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* treewide: Run refresh on all packagesIlya Lipnitskiy2021-02-20
| | | | | | | | | The crude loop I wrote to come up with this changeset: find -L package/feeds/packages/ -name patches | \ sed 's/patches$/refresh/' | sort | xargs make Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
* python3: Fix target python-config when building on macOSJeffery To2021-02-17
| | | | | | | | | | | | | | | | | | | | The Python version of python-config is installed when building on macOS, rather than the shell script version when building on Linux. When run on macOS, the Python version of python-config will return values with Mac-specific customizations. This patches the python-config install recipe so that which version is installed can be controlled by the package makefile. When building on macOS, this installs the Python version for host Python and the shell script version for target Python. This also updates Host/Compile and Host/Install to use the default host build recipes, so that the various HOST_* variables are taken into account automatically. Fixes https://github.com/openwrt/packages/issues/14652 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: bump to version 3.9.1Alexandru Ardelean2020-12-14
| | | | Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python3: fix compilationRosen Penev2020-11-29
| | | | | | | Because of e52d0487e88c3c8c57e1310d1a02b18eae0d142e , these flags no longer get passed. Add them back to fix compilation. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* python3: bump to version 3.9.0Alexandru Ardelean2020-10-19
| | | | | | | | | | | Refreshed patches. Dropped 'patches-setuptools/004-site-patch.patch' Does not apply anymore. Setuptools has removed site.py support: https://github.com/pypa/setuptools/issues/2165 If this is still needed, we may need to re-think it's implementation. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python3: Add config PYTHON3_HOST_PIP_CACHE_WORLD_READABLEJeffery To2020-08-16
| | | | | | | | | | This adds a config option PYTHON3_HOST_PIP_CACHE_WORLD_READABLE; if enabled, chmod will be run after pip install to make all files/directories in the host pip cache world-readable. Supersedes https://github.com/openwrt/packages/pull/13012. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: fix host compilation with clangRosen Penev2020-08-02
| | | | | | Matched rpath parameter with Makefile. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* python3: Update to 3.8.5Jeffery To2020-07-27
| | | | | | | | | | | | | | | This version includes fixes for: * CVE-2020-15801 - Fixes python3x._pth being ignored on Windows * CVE-2019-20907 - Avoid infinite loop when reading specially crafted TAR files using the tarfile module This also: * Remove patches that are included in the update * Add a dependency in python3-distutils for python3-email[1] [1]: https://github.com/python/cpython/blob/v3.8.5/Lib/distutils/dist.py#L10 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Update to 3.8.4, refresh/rework patches, backport patchesJeffery To2020-07-20
| | | | | | | | | | | | | | | | | | | | | This version includes fixes for: * CVE-2020-14422: Hash collisions in IPv4Interface and IPv6Interface * CVE-2020-15523: Python uses invalid DLL path after calling Py_SetPath on Windows This version also includes support for OpenSSL 1.1.x builds that use 'no-deprecated' and '--api=1.1.0'[1], and so this removes the previous OpenSSL-related patches. This also backports fixes for security issues, including: * CVE-2019-20907: Infinite loop in the tarfile module This also updates the setuptools and pip packages to 47.1.0 and 20.1.1, respectively. [1]: https://github.com/python/cpython/pull/20566 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Use default _PYTHON_HOST_PLATFORMJeffery To2020-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets the Python build process set _PYTHON_HOST_PLATFORM instead of forcing an explicit value. Also: * Save the target _PYTHON_HOST_PLATFORM value during Build/InstallDev for use when building target Python packages (in python3-package.mk). * Use the (mostly) default PYTHON_FOR_BUILD value, instead patch configure to remove the platform triplet from the sysconfigdata file name. * Remove the "CROSS_COMPILE=yes" make variable (there is no indication that this variable is necessary). * Force host pip to build packages from source instead of downloading binary wheels. Previously, host pip can download universal (platform-independent) wheels but not platform-specific wheels, because of the custom _PYTHON_HOST_PLATFORM value. (Packages that do not have universal wheels would be compiled from source.) With a correct _PYTHON_HOST_PLATFORM, host pip can install platform-specific wheels as well. However, the pre-built shared object (.so) files in these wheels will have the host's platform triplet in their file names. When target Python packages are built (using the target's _PYTHON_HOST_PLATFORM), Python will not use these shared object files. By forcing host pip to build packages from source, the built shared object files will not have the platform triplet in their file names. (Host Python has been patched to remove the platform triplet from file names.) This allows these packages to be used when building target Python packages. (The net effect of this complete change is that platform-dependent packages will continue to be compiled from source, while platform-independent packages will now also be compiled from source.) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python-packages: Add usr/bin symlinks without "3" suffixJeffery To2020-05-22
| | | | | | | | | | | | | Previously, binaries installed by Python packages will have a non-suffixed Python 2 version and a suffixed Python 3 version, e.g. pip and pip3. With the removal of Python 2, the non-suffixed names are no longer taken. This adds symlinks for the non-suffixed names linking to the suffixed scripts (or in the case of pip, easy_install, and python-config, to the fully-versioned scripts). Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3-setuptools: Fix error when installing from sourceJeffery To2020-05-21
| | | | | | | | | | | | | | | | | | | When a Python package is installed from source (i.e. using setup.py) into a custom location (with --home), setuptools may want to create a site.py file in the custom location. This file is created based on the source code of site-patch.py, a file bundled with setuptools. Because the normal OpenWrt setuptools package does not contain Python source code, this file is missing and the installation will end with an error. This copies site-patch.py to site-patch.py.txt so that it will be included in python3-setuptools, and patches setuptools to look for this file. See https://github.com/openwrt/packages/issues/12223 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Update to 3.8.3, refresh patchesJeffery To2020-05-20
| | | | Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3-openssl: Add dependency on ca-certsJeffery To2020-05-20
| | | | | | | | | The ssl module assumes OpenSSL can load the default trust anchors (root CA certificates). From https://github.com/openwrt/packages/issues/12209 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Enable compile-time optimizationsJeffery To2020-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the --enable-optimizations configure option (for profile-guided optimization) for both host and target Python, and the --with-lto configure option (for link-time optimization) for target Python (for non-MIPS platforms). Currently, compiling Python with LTO leads to link errors on mips and mipsel. (Compiling with LTO appears to succeed on mips64 but there is only one mips64 target available for convenient testing.) This also cleans up the host and target configure options: * Sort options/variables - Alphabetically - Flags/options before child-process environment variables - Group options by type (enable/disable/with/without) - Static options/variables before conditional ones * Remove the prefix/dir options, as they are the same as the defaults set by the build system * Remove --with-threads, as it is no longer a valid option (threads are always enabled) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Fix host build tool names recorded in target filesJeffery To2020-04-27
| | | | | | | | | | | | | | | | | | | | | | | Python will record the values of CC, CXX, AR, and READELF (and other configure options) used during compilation. pip will use these programs when asked to compile extension modules on the target device. * If ccache is used during build, CC and CXX will be ccache_cc and ccache_cxx, respectively, which are not available on-device (#11912). * If an external toolchain is used during build, the values of these variables will contain the external toolchain prefix, which may not be available on target. * If the normal toolchain is used during build, AR and READELF will contain the toolchain prefix, but the names of ar and readelf on-device do not contain the prefix; they are named "ar" and "readelf". This changes the values of these variables in Python's files to match the names available on-device, and without any toolchain prefix. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3-pip: Fix error when installing packages that require compilationJeffery To2020-04-24
| | | | | | This addresses one of the issues raised in #11912. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Change PYTHON_VERSION references to PYTHON3_VERSIONJeffery To2020-04-19
| | | | | | | | | | | | PYTHON_VERSION is a holdover from Python 2; all Python 3 variables are prefixed with PYTHON3 (or some variation with "3"). This updates all uses of PYTHON_VERSION to PYTHON3_VERSION. This also sets PYTHON3_PKG_BUILD:=0 before python3-package.mk is included in the python3 Makefile. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: symlink 'python' to '/usr/bin/python3'Alexandru Ardelean2020-04-08
| | | | | | | | Time to make it more official. Running 'python' should get you an interpreter running, and that one is now Python3. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python3-pip: Symlink pip3 to pip3.8Jeffery To2020-04-04
| | | | | | | Currently, python3-pip installs the same script as pip3 and pip3.8 to usr/bin. This changes pip3 to be a symlink to pip3.8. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Update to 3.8.2, fix python3-xml dependencyJeffery To2020-03-20
| | | | | | | | xml.sax.saxutils has a dependency on urllib[1]. [1]: https://github.com/python/cpython/blob/v3.8.2/Lib/xml/sax/saxutils.py#L6 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Fix compilation without deprecated APIsRosen Penev2020-01-14
| | | | | | | | | | | | | This is based on upstream work here: https://github.com/python/cpython/pull/3934 and https://github.com/python/cpython/pull/39430 First patch was kept as is (just rebased) while the second was combined into one. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* python3: Updated to version 3.8.1Josef Schlehofer2019-12-21
| | | | | | Removed upstream patch: 002-fix-blake2-detection.patch Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* python3: bump PKG_RELEASEJosef Schlehofer2019-11-21
| | | | | | | Fixes: 85eee2d7f85421fd9156fb988ac865679e4e7851 (python3: fix build when Blake2 not enabled in OpenSSL") Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* python3: fix build when Blake2 not enabled in OpenSSLYorkie Liu2019-11-21
| | | | | | | | | Refs: - https://github.com/python/cpython/commit/7c20888e71304ecbf4bd3d595f364b7c691d30a0 - https://bugs.python.org/issue38684 Signed-off-by: Yorkie Liu <yorkiefixer@gmail.com>
* python3: fix build on Ubuntu/Debian multi-archAlexandru Ardelean2019-11-04
| | | | | | | | | | | | | | | | | This issue was introduced after upgrading to 3.8. Patch `006-remove-multi-arch-and-local-paths.patch` was dropped. It was tested on x86, but when using the x86_64 compiler in OpenWrt, the issue is present. The issue seems to be about Ubuntu/Debian's multi-arch support in Python/Python3 setup [which I forgot about]. The code runs it regardless of whether it cross-compiles or not, and for OpenWrt, this causes issues, as it introduces absolute include paths from the host system. Fixes https://github.com/openwrt/packages/issues/10452 Fixes: 48277ec915815 ("python3: bump to version 3.8") Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python3: bump to version 3.8Alexandru Ardelean2019-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This required a bit work to get working, compared to other versions. So, some things have changed a bit more significantly. Some highlights: * there is no longer a pgen executable, seems this is now part of libpython; let's see what this means for us in the future * blake2 hash (from OpenSSL) detection needs some fixing; will upstream added patch 002-fix-blake2-detection.patch * removed all bpo patches; those should be fixed in upstream * some needed to be manually re-applied as stuff changed: - 001-enable-zlib.patch - file changed - 004-do-not-write-bytes-codes.patch - file changed - 015-abort-on-failed-modules.patch - variable was renamed cross_compiling -> CROSS_COMPILING * 017_lib2to3_fix_pyc_search.patch - the code changed, it does not seem to have the original problem with respect to file-extension, as there does not seem to be any special extension logic anymore there * 006-remove-multi-arch-and-local-paths.patch - dropped patch; I can't remember the full-details of this issue; it was something with Debian/Ubuntu's multi-arch stuff; it was probably added maybe due to some overzealous (on my part) thingy caused by some weird reports, that I could never solve; let's have this patch dropped and see * make package/python3/refresh to reduce fuzz for the rest Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python,python3: Fix CVE-2019-16056, CVE-2019-16935Jeffery To2019-10-04
| | | | | | | | | | | | | | | These patches address issues: CVE-2019-16056: email.utils.parseaddr mistakenly parse an email CVE-2019-16935: A reflected XSS in python/Lib/DocXMLRPCServer.py (for Python 2.7) CVE-2019-16935 was fixed for python3 in #10109 Links to Python issues: https://bugs.python.org/issue34155 https://bugs.python.org/issue38243 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: backport three security patchesJosef Schlehofer2019-09-29
| | | | | | Fixes: CVE-2019-16935 Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* python,python3: split python[3]-pkg-resources from setuptoolsAlexandru Ardelean2019-09-20
| | | | | | | | | | This package is required by other packages to run some binaries via `load_entry_point`. So, this splits this package away from setuptools. setuptools is pretty big, akd pkg-resources is also big, but not as big. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* python,python3: Fix host Python compilation for macOSJeffery To2019-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | * Remove $$$$(pkg-config --static --libs libcrypto libssl) from HOST_LDFLAGS Having this leads to an "unknown type name 'u_int'" error on Mac. Removing it doesn't appear to affect Python's ability to find buildroot LibreSSL. * Change -Wl,-rpath=... to -Wl,-rpath,... in HOST_LDFLAGS The equals sign version is not supported by the Mac linker (appears to be an GNU extension). The comma version is supported; -rpath and its argument will be separated by a space when passed to the linker. * Add ac_cv_header_libintl_h=no to HOST_CONFIGURE_VARS for Mac Python on Mac doesn't expect to use libintl, but if gettext-full is compiled for host, it will try, leading to undefined symbol errors during compilation. This prevents configure from finding libintl.h. Fixes #7171. Fixes #9621. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python,python3: Fix ctypes.util.find_library()Jeffery To2019-07-22
| | | | | | | | | | | | | | | Python's ctypes.util.find_library() function currently doesn't work for musl libraries/systems[1]. This adds a patch to fix this function, based on a patch from Alpine Linux[2]. Fixes #9448. [1]: https://bugs.python.org/issue21622 [2]: https://git.alpinelinux.org/aports/tree/main/python2/musl-find_library.patch Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* python3: Update to version 3.7.4Josef Schlehofer2019-07-10
| | | | | | | | | | | | | - Update setuptools to 40.8.0 - Update pip to 19.0.3 - Refreshed patches - Removed 4 patches (2 of them was included in 3.7.3 and other two are included in this release) Makefile python3: - Move PKG_MAINTAINER above PKG_LICENSE Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* python3: use _python_sysroot for cross-compilationEneas U de Queiroz2019-06-26
| | | | | | | This patch, taken from buildroot, avoids the use of host paths when compiling third-party extensions. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* python,python3: Move python-config to $(STAGING_DIR)/hostJeffery To2019-06-10
| | | | | | | | | Build/InstallDev is passed a second argument, a path where host binaries should be placed (ultimately $(STAGING_DIR)/host). This change moves python[3]-config to that directory. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* Merge pull request #9131 from jefferyto/python-bpo-35907Rosen Penev2019-06-05
|\ | | | | python,python3: Fix CVE-2019-9948 - local_file:// allowed in urllib
| * python,python3: Fix CVE-2019-9948 - local_file:// allowed in urllibJeffery To2019-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These patches address issue: CVE-2019-9948: Unnecessary URL scheme exists to allow local_file:// reading file in urllib Link to Python issue: https://bugs.python.org/issue35907 Issue 35907 is still currently open, waiting for a decision for Python 3.5; these patches for Python 2.7 and 3.7 have been merged. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* | Merge pull request #9114 from ↵Hannu Nyman2019-06-03
|\ \ | |/ |/| | | | | jefferyto/python-host-setuptools-pip-installed-pkg-release python,python3: Record PKG_RELEASE for host setuptools/pip
| * python,python3: Record PKG_RELEASE for host setuptools/pipJeffery To2019-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the "patched" indicator files for host setuptools and pip to include their PKG_RELEASE values. This also removes host setuptools and/or pip before host install, if the installed copy does not match the version (and PKG_RELEASE) of the copy to be installed. This will allow added or removed patches to affect host setuptools / pip, since these changes will cause PKG_RELEASE to be incremented. This also fixes the host install error, when the install tries to patch an already patched copy of setuptools. (This error occurs because the existing indicator files do not have version numbers in their file names, whereas host install expected version numbers to be present.) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* | Merge pull request #9100 from jefferyto/isolate-host-pythonRosen Penev2019-06-03
|\ \ | | | | | | python,python3: Better isolate host Python
| * | python,python3: Disable user site-packages for host PythonJeffery To2019-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, Python will include the user's site-packages directory (~/.local/lib/python$(PYTHON_VERSION)/site-packages) in it's internal search path for modules. This disables this default inclusion for host Python. This change is applied during Host/Configure instead of as a patch to keep this setting unchanged for target Python. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* | | python,python3: Fix CVE-2019-9740 and CVE-2019-9947Jeffery To2019-06-03
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | These patches address issues: CVE-2019-9740: Python urllib CRLF injection vulnerability CVE-2019-9947: Header Injection in urllib Links to Python issues: https://bugs.python.org/issue36276 (resolved duplicated of 30458) https://bugs.python.org/issue35906 (resolved duplicated of 30458) https://bugs.python.org/issue30458 Issue 30458 is still currently open, waiting for a decision for Python 3.5; these patches for Python 2.7 and 3.7 have been merged. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* | Merge pull request #9103 from ↵Hannu Nyman2019-05-30
|\ \ | | | | | | | | | | | | jefferyto/python-host-patch-upgraded-setuptools-pip python,python3: Allow upgraded host setuptools/pip to be patched
| * | python,python3: Allow upgraded host setuptools/pip to be patchedJeffery To2019-05-30
| | | | | | | | | | | | | | | | | | | | | This adds the current setuptools/pip version numbers to the indicator files' names, which should allow upgraded versions to be patched. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* | | Merge pull request #9101 from jefferyto/python-setuptools-pip-installHannu Nyman2019-05-30
|\ \ \ | |/ / |/| | python-setuptools,python-pip: Installation changes
| * | python3-setuptools,python3-pip: Use more predictable pycache cleanupJeffery To2019-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses two find commands to delete __pycache__ contents then the __pycache__ directories, rather than a for loop. The second command omits a -empty test, so that if the first command doesn't remove all directory contents for some reason, the second command will return an error (find will not delete a non-empty directory). Signed-off-by: Jeffery To <jeffery.to@gmail.com>
| * | python-setuptools,python-pip: Change prefix to /usrJeffery To2019-05-29
| | | | | | | | | | | | | | | | | | | | | | | | This changes the --prefix option, passed to host pip when "installing" target setuptools and pip, to /usr, in case the prefix is recorded in the packages. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
| * | python-setuptools,python-pip: Set pip cache dir, disable version checkJeffery To2019-05-29
| |/ | | | | | | | | | | | | | | | | | | This adds --cache-dir and --disable-pip-version-check options for host pip, when "installing" target setuptools and pip. This also changes the pip command to use $(HOST_PYTHON[3]_PIP) from python[3]-host.mk. Signed-off-by: Jeffery To <jeffery.to@gmail.com>