From b2ae2fa78ffd5c38f16624b17faa9dd263d2f573 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 9 Jul 2024 11:42:05 +0200 Subject: [PATCH] lxml: ignore warnings when calling setup.py build too Reverts dc97b366ab9ce3d38c84da06b8b37131579f87f3 "python3: silence distutils deprecated warning" and f41773d684dfb1bfebe484bbf6d1ec4b5937d348 "python3: silence distutils deprecated warning (take 2)" and c920605dd4c4520ab8ee80f9fb4746287835918c "external/lxml: Fix --enable-python=fully-internal build" Change-Id: I9131fa5ac22cf4f0279e7bf0edc5c50b61845044 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170206 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- external/lxml/ExternalProject_lxml.mk | 2 +- .../replace-setuptools-with-distutils.patch.1 | 19 +---------- external/python3/UnpackedTarball_python3.mk | 1 - external/python3/distutils_deprecated.patch.0 | 33 ------------------- 4 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 external/python3/distutils_deprecated.patch.0 diff --git a/external/lxml/ExternalProject_lxml.mk b/external/lxml/ExternalProject_lxml.mk index 34bd89c1eca8..66953b8296c2 100644 --- a/external/lxml/ExternalProject_lxml.mk +++ b/external/lxml/ExternalProject_lxml.mk @@ -32,7 +32,7 @@ $(call gb_ExternalProject_get_state_target,lxml,build): \ LDFLAGS="$$LDFLAGS -L$(gb_UnpackedTarball_workdir)/python3" && \ _PYTHON_PROJECT_BASE=$(gb_UnpackedTarball_workdir)/python3 && \ export CFLAGS LDFLAGS _PYTHON_PROJECT_BASE && ) \ - $(lxml_PYTHON) setup.py build \ + $(lxml_PYTHON) -Wi setup.py build \ $(if $(SYSTEM_LIBXML),,--with-xml2-config=$(gb_UnpackedTarball_workdir)/libxml2/xml2-config) \ $(if $(SYSTEM_LIBXSLT),,--with-xslt-config=$(gb_UnpackedTarball_workdir)/libxslt/xslt-config) && \ rm -fr install && \ diff --git a/external/lxml/replace-setuptools-with-distutils.patch.1 b/external/lxml/replace-setuptools-with-distutils.patch.1 index 5275e40312c8..17fb51278d81 100644 --- a/external/lxml/replace-setuptools-with-distutils.patch.1 +++ b/external/lxml/replace-setuptools-with-distutils.patch.1 @@ -4,26 +4,9 @@ diff -ur lxml.org/setupinfo.py lxml/setupinfo.py @@ -4,7 +4,7 @@ import os.path import subprocess - + -from setuptools.command.build_ext import build_ext as _build_ext +from distutils.command.build_ext import build_ext as _build_ext from distutils.core import Extension from distutils.errors import CompileError, DistutilsOptionError from versioninfo import get_base_dir -diff -ur lxml.org/setup.py lxml/setup.py ---- lxml.org/setup.py 2023-10-20 10:32:17.949501053 +0200 -+++ lxml/setup.py 2023-10-20 10:33:09.082631759 +0200 -@@ -217,9 +217,10 @@ - # `Unknown distribution option: 'bugtrack_url'` - # which distract folks from real causes of problems when troubleshooting - # bugtrack_url="https://bugs.launchpad.net/lxml", -- project_urls={ -- "Source": "https://github.com/lxml/lxml", -- }, -+ # same as for bugtrack_urls also for project_urls when using distutils instead of setuptools -+ #project_urls={ -+ # "Source": "https://github.com/lxml/lxml", -+ #}, - description=( - "Powerful and Pythonic XML processing library" - " combining libxml2/libxslt with the ElementTree API." diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 9c766c26dda4..4e522715afc2 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -22,7 +22,6 @@ $(eval $(call gb_UnpackedTarball_set_patchflags,python3,--binary)) endif $(eval $(call gb_UnpackedTarball_add_patches,python3,\ - external/python3/distutils_deprecated.patch.0 \ external/python3/i100492-freebsd.patch.1 \ external/python3/python-3.3.0-darwin.patch.1 \ external/python3/python-3.8-msvc-libffi.patch.1 \ diff --git a/external/python3/distutils_deprecated.patch.0 b/external/python3/distutils_deprecated.patch.0 deleted file mode 100644 index 2e9666245ff1..000000000000 --- a/external/python3/distutils_deprecated.patch.0 +++ /dev/null @@ -1,33 +0,0 @@ ---- Lib/distutils/__init__.py 2024-07-06 14:41:11.881840873 +0200 -+++ Lib/distutils/__init__.py 2024-07-06 14:41:31.725586707 +0200 -@@ -7,14 +7,3 @@ - - setup (...) - """ -- --import sys --import warnings -- --__version__ = sys.version[:sys.version.index(' ')] -- --_DEPRECATION_MESSAGE = ("The distutils package is deprecated and slated for " -- "removal in Python 3.12. Use setuptools or check " -- "PEP 632 for potential alternatives") --warnings.warn(_DEPRECATION_MESSAGE, -- DeprecationWarning, 2) ---- Lib/distutils/sysconfig.py 2024-07-06 18:03:30.397986006 +0200 -+++ Lib/distutils/sysconfig.py 2024-07-06 18:03:58.637312653 +0200 -@@ -55,13 +55,6 @@ - if os.name == "nt": - from sysconfig import _fix_pcbuild - --warnings.warn( -- 'The distutils.sysconfig module is deprecated, use sysconfig instead', -- DeprecationWarning, -- stacklevel=2 --) -- -- - # Following functions are the same as in sysconfig but with different API - def parse_config_h(fp, g=None): - return sysconfig_parse_config_h(fp, vars=g)