Bug#1065893: libreoffice: Please drop dependencies on python3-distutils
Hi again, Am 10.03.24 um 19:59 schrieb Rene Engelhard: BTW, What is the replacement for it? setuptools._distutils? As in the following patch? OK, so discussion on IRC gave: 19:51 < tumbleweed> _rene_: distutils is removed in 3.12 19:51 < tumbleweed> if you need distutils, try installing setuptools, it provides a distutils shim 20:00 < _rene_> setuptools._distutils, yes 20:00 < _rene_> but yet import distutils works in 3.12 :) 20:00 < _rene_> and afaicr from debconf in kochi we didn't want to force distutils removal yet for python3.12-as-default, only after it? 20:03 < _rene_> tumbleweed: does https://www.rene-engelhard.de/~rene/d look sane? 20:04 < tumbleweed> _rene_: yes, it works because setuptools provide a shim to make it work 20:04 < _rene_> (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1065893#19) 20:04 -zwiebelbot:#debian-release- Debian#1065893: libreoffice: Please drop dependencies on python3-distutils - https://bugs.debian.org/1065893 20:05 < tumbleweed> just build-depend on python3-setuptools and you don't need the rest of your patch 20:05 < _rene_> I see, ok 20:05 < tumbleweed> obviously upstream should stop using distutils, but you've got time there 20:06 < tumbleweed> the answer isn't to use setuptools._distutils, but rather sysconfig 20:06 < _rene_> should have been in the bugreport 20:07 < tumbleweed> fwiw, the bof notes say: https://salsa.debian.org/debconf-team/public/data/dc23/-/blob/main/etherpad/txt/27-python-bof.txt#L20 20:10 < _rene_> hmm, indeed. but dh-python already does that. 20:10 < tumbleweed> the problem for you was more than just a dependency 20:10 < _rene_> so if it provided a shim to make plain import distutils work one could just make it Provides: python3-disturils 20:10 < _rene_> distutils 20:11 < _rene_> aka make the real package virtual and stuff continues to work 20:11 < tumbleweed> err, what am I saying 20:11 < tumbleweed> did you try just dropping the dependency on python3-distutils? 20:11 < _rene_> I can't remove it from the disk due to everything python'ish being removed, too with it 20:12 < _rene_> The following packages will be REMOVED: dh-python python3-dev python3-distutils python3-setuptools 20:12 -!- andibmu [~a...@i5387a7d5.versanet.de] has joined #debian-release 20:12 < tumbleweed> I mean from your build-depends so you don't get in your build chroot 20:13 < _rene_> how does that help if I still need dh-python and python3-dev? (and gobject-introspection) 20:13 < tumbleweed> they don't need distutils. Nothing does in 3.12 20:13 < _rene_> just now doing it in a chroot where I can do stuff and do a manual debuild -Pnogir 20:13 < _rene_> why does dh-python and python3-dev then get removed on apt remove python3-distutils? 20:14 < _rene_> (and the gobject-introspection stuff.) 20:15 < tumbleweed> oh, right, dh-python does still depend on it 20:15 < tumbleweed> fine. As long as you drop *your* dependency, we should be OK when everyone else drops theirs 20:15 < _rene_> and apt -t experimental install python3-dev also does 20:15 < _rene_> The following NEW packages will be installed: python3-dev python3-distutils 20:16 < tumbleweed> that's OK so just exchanging the build-dep would be fine. You could have just said so in the report for people who are not that into python stuff. Will be fixed in next experimental upload. Regards, Rene
Bug#1065893: libreoffice: Please drop dependencies on python3-distutils
Hi, Am 10.03.24 um 19:44 schrieb Rene Engelhard: and similar stuff in upstreams configure. python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"` python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"` python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"` python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"` to be precise. BTW, What is the replacement for it? setuptools._distutils? As in the following patch? diff --git a/changelog b/changelog index 968af9a3b..9d16707d6 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,10 @@ +libreoffice (4:24.2.2~rc1-3) UNRELEASED; urgency=medium + + * debian/patches/distutils-is-obsolete.diff, debian/rules: use + setuptools._distutils instead of distutils (closes: #1065893) + + -- Rene Engelhard Sun, 10 Mar 2024 19:57:14 +0100 + libreoffice (4:24.2.2~rc1-2) experimental; urgency=medium * debian/patches/fix-32bit-build.diff: as name says; from upstream diff --git a/patches/series b/patches/series index 75a4f68d2..47b80676f 100644 --- a/patches/series +++ b/patches/series @@ -50,3 +50,4 @@ fix-system-abseil-build.diff fix-riscv64-bridge.diff pdfium-ports.diff fix-32bit-build.diff +distutils-is-obsolete.diff diff --git a/rules b/rules index aa981c5b1..a47940395 100755 --- a/rules +++ b/rules @@ -1086,7 +1086,7 @@ ifeq "$(ENABLE_PYTHON)" "y" PYMAJOR:=$(shell $(PYTHON) -c "import sys; print (sys.version_info[0])") PYMINOR:=$(shell $(PYTHON) -c "import sys; print (sys.version_info[1])") PYMINORPLUS1:=$(shell $(PYTHON) -c "import sys; print (sys.version_info[1]+1)") -PYTHON_SITE:=debian/python3-uno/$(shell $(PYTHON) -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') +PYTHON_SITE:=$(shell $(PYTHON) -c 'from setuptools._distutils import sysconfig; print(sysconfig.get_python_lib())') endif BUILD_DEPS += , $(PYTHON) @@ -2953,9 +2953,9 @@ else endif ifeq "$(PACKAGE_BASE)" "y" - mkdir -p debian/python3-access2base/$(shell $(PYTHON) -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') + mkdir -p debian/python3-access2base/$(PYTHON_SITE) } mv $(PKGDIR)-common/$(OODIR)/program/access2base.py \ - debian/python3-access2base/$(shell $(PYTHON) -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') + debian/python3-access2base/$(PYTHON_SITE) else rm -rf $(PKGDIR)-common/$(OODIR)/share/basic/Access2Base t=`mktemp -q`; grep -v Access2Base $(PKGDIR)-common/$(OODIR)/share/basic/dialog.xlc > \ @@ -2966,9 +2966,9 @@ else endif # ScriptForge - mkdir -p debian/python3-scriptforge/$(shell $(PYTHON) -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') + mkdir -p debian/python3-scriptforge/$(PYTHON_SITE) \ mv $(PKGDIR)-common/$(OODIR)/program/scriptforge.py \ - debian/python3-scriptforge/$(shell $(PYTHON) -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') + debian/python3-scriptforge/$(PYTHON_SITE) ifeq "$(PACKAGE_SDK)" "y" # move gengal stuff into -dev-gui @@ -3354,16 +3354,16 @@ endif ifeq "$(ENABLE_PYTHON)" "y" # PyUNO packaging - install -d $(PYTHON_SITE) + install -d debian/python3-uno/$(PYTHON_SITE) # prepend stuff so that it works when the module is not in LOs # directories but in $(PYTHON_SITE). Can't be a patch (anymore) # as otherwise the python-based unittests fail miserably. - echo "import sys, os" > $(PYTHON_SITE)/uno.py - echo "sys.path.append('/$(OODIR)/program')" >> $(PYTHON_SITE)/uno.py - echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:/$(OODIR)/program/fundamentalrc')" >> $(PYTHON_SITE)/uno.py - cat debian/python3-uno/$(OODIR)/program/uno.py >> $(PYTHON_SITE)/uno.py + echo "import sys, os" > debian/python3-uno/$(PYTHON_SITE)/uno.py + echo "sys.path.append('/$(OODIR)/program')" >> debian/python3-uno/$(PYTHON_SITE)/uno.py + echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:/$(OODIR)/program/fundamentalrc')" >> debian/python3-uno/$(PYTHON_SITE)/uno.py + cat debian/python3-uno/$(OODIR)/program/uno.py >> debian/python3-uno/$(PYTHON_SITE)/uno.py rm -f debian/python3-uno/$(OODIR)/program/uno.py - mv debian/python3-uno/$(OODIR)/program/unohelper.py $(PYTHON_SITE) + mv debian/python3-uno/$(OODIR)/program/unohelper.py debian/python3-uno/$(PYTHON_SITE) touch debian/python3-uno/$(OODIR)/program/pythonloader.unorc chmod u+w debian/python3-uno/$(OODIR)/program/pythonloader.unorc ( echo 'PYTHONHOME=file:///usr/lib/python$(PYMAJOR).$(PYMINOR)' ;\ --- /dev/null 2024-03-09 21:11:03.946057442 +0100 +++ patches/distutils-is-obsolete.diff 2024-03-10 19:55:13.982399830 +0100 @@ -0,0 +1,19 @@ +diff --git a/configure.ac
Bug#1065893: libreoffice: Please drop dependencies on python3-distutils
tag 1065893 - ftbfs tag 1065893 + moreinfo thanks Hi, Am 10.03.24 um 18:49 schrieb Graham Inggs: Severity: important Tags: ftbfs Nope. As demonstrated below it does NOT FTBFS if I ran it to the end. Actually did once. This package has dependencies, build-dependencies and/or autopkgtest dependencies on python3-distutils. The python3-distutils binary package will soon be dropped from python3-stdlib-extensions. # apt remove python3-distutils Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: gir1.2-girepository-2.0 gir1.2-girepository-2.0-dev libgirepository-1.0-1 libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.11-dev python3-lib2to3 python3-mako python3-markdown python3-markupsafe python3-pkg-resources python3.11-dev Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: dh-python gobject-introspection gobject-introspection-bin libgirepository-1.0-dev libgirepository1.0-dev python3-dev python3-distutils python3-setuptools 0 upgraded, 0 newly installed, 8 to remove and 0 not upgraded. After this operation, 5736 kB disk space will be freed. Do you want to continue? [Y/n] and dh-python gobject-introspection libgirepository1.0-dev python3-dev are definitely needed as build -dependencies- In fact, there is no module for Python 3.12 in python3-distutils, so these dependencies may already be unnecessary. Wrong. both debian/rules and LibreOffices configure use distutils to figure out the module install directory path for example. e.g. PYTHON_SITE:=debian/python3-uno/$(shell $(PYTHON) -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') and similar stuff in upstreams configure. And that one is not done on 3.12 yet since LibreOffice (for reasons!) only builds for default python. Which is 3.11. After install python3 python3-dev from experimental (so 3.12): $ python3 Python 3.12.2 (main, Feb 25 2024, 17:51:42) [GCC 13.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import distutils; >>> from distutils import sysconfig; print(sysconfig.get_python_lib()) /usr/lib/python3/dist-packages >>> print(distutils) (/usr/lib/python3/dist-packages/setuptools/_distutils/__init__.py)> >>> and doing a libreoffice build with debuild -Pnogir (since we need gobject-introspection etc. which isn't yet built for default 3.12 either): $ debuild -Pnogir [...] checking for a Python interpreter with version >= 3.3... python3 checking for python3... /usr/bin/python3 checking for python3 version... 3.12 checking for python3 platform... linux checking for GNU default python3 prefix... ${prefix} checking for GNU default python3 exec_prefix... ${exec_prefix} checking for python3 script directory (pythondir)... ${PYTHON_PREFIX}/lib/python3.12/site-packages checking for python3 extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python3.12/site-packages [...] in upstreams configure. I think this bugreport is too early. Regards, Rene
Bug#1065893: libreoffice: Please drop dependencies on python3-distutils
Source: libreoffice Version: 4:24.2.0-1 Severity: important Tags: ftbfs User: debian-pyt...@lists.debian.org Usertags: python3.12 Hi Maintainer This package has dependencies, build-dependencies and/or autopkgtest dependencies on python3-distutils. The python3-distutils binary package will soon be dropped from python3-stdlib-extensions. In fact, there is no module for Python 3.12 in python3-distutils, so these dependencies may already be unnecessary. Regards Graham