[Bug 1200664] New: python packages which install files into the python versioned path, should also use a versioned shebang line
https://bugzilla.suse.com/show_bug.cgi?id=1200664 Bug ID: 1200664 Summary: python packages which install files into the python versioned path, should also use a versioned shebang line Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: mcepl@suse.com Reporter: mrueckert@suse.com QA Contact: qa-bugs@suse.de CC: matthias.gerstner@suse.com Found By: --- Blocker: --- borg --version Traceback (most recent call last): File "/usr/bin/borg", line 33, in <module> sys.exit(load_entry_point('borgbackup==1.2.0', 'console_scripts', 'borg')()) File "/usr/bin/borg", line 22, in importlib_load_entry_point for entry_point in distribution(dist_name).entry_points File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 957, in distribution return Distribution.from_name(distribution_name) File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 548, in from_name raise PackageNotFoundError(name) importlib.metadata.PackageNotFoundError: No package metadata was found for borgbackup server:mail/getmail6 had the same problem. that means we should have a macro like %python_version_shebang which updates all references from python3 to python3.x. And we should have a rpmlint check for this. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c1 --- Comment #1 from Marcus R�ckert <mrueckert@suse.com> --- related problem: ``` zypper info --requires calibre | py /usr/bin/python3 libpython3.8.so.1.0()(64bit) ``` rpmlint check should also warn about unversioned shebang lines when we also link a libpython3.x library. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c2 --- Comment #2 from Marcus R�ckert <mrueckert@suse.com> --- import os import sys binary_path = os.readlink(sys.executable) if not(os.path.isabs(binary_path)): binary_path = os.path.join(os.path.dirname(sys.executable), os.readlink(sys.executable)) print(binary_path) -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c3 --- Comment #3 from Marcus R�ckert <mrueckert@suse.com> --- also affects osc -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c4 --- Comment #4 from Marcus R�ckert <mrueckert@suse.com> --- it seems it prefers noarch packages from aarch64. and that is our slowest architecture. :( -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c5 Matej Cepl <mcepl@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED --- Comment #5 from Matej Cepl <mcepl@suse.com> --- The problem is not in using unversioned shebang for packages that require unversioned python3 (see its BuildRequires and Requires), but that https://build.opensuse.org/package/show/openSUSE:Factory/borgbackup didn't get rebuild with new python3 interpreter. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c6 --- Comment #6 from Marcus R�ckert <mrueckert@suse.com> --- (In reply to Matej Cepl from comment #5)
The problem is not in using unversioned shebang for packages that require unversioned python3 (see its BuildRequires and Requires), but that https://build.opensuse.org/package/show/openSUSE:Factory/borgbackup didn't get rebuild with new python3 interpreter.
I am aware that slow rebuilding is part of the problem. also picking noarch from aarch64 needs to be fixed. bug we run in the situation that /usr/bin/python3 is provided by a different package than the versioned path inside the borgbackup package. so strictly speaking all deps are fulfilled but it doesnt give us a working package. this needs to be fixed as well. and one solution to guard against this would be versioned shebang lines. for a package that does not install anything into sitelib or sitearch we dont have to version things. but for packages that install things we should do that to make sure packages do not break silently. i had this happen to at least _4_ packages for me. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c7 --- Comment #7 from Marcus R�ckert <mrueckert@suse.com> --- it gets even more fun: for one package i had BR: python3-foo BR: python3-bar during local build foo was python 3.8 and bar 3.10, because foo wasnt rebuilt yet to be the default python3-foo provider. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c9 --- Comment #9 from Matej Cepl <mcepl@suse.com> --- There is nothing we could (and should) do about it other than either * rewrite those packages to be fully multi-version packages (I won���t name all those people who explained to me that it is unnecessary), or * wait until all those required packages get rebuild, you would probably than obsessing over this package be with helping to fix all failing packages in https://build.opensuse.org/project/monitor/openSUSE:Factory?arch_x86_64=1&defaults=0&failed=1&repo_standard=1 Considering WONTFIX. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c10 --- Comment #10 from Marcus R�ckert <mrueckert@suse.com> --- 1. this is definitely not a wontfix. for packages that only provide one program (like getmail/borgbackup/matrix-synapse ) it would be so unneeded to have full multiversion. 2. having something like pythonXY-getmail and a getmail package will not actually fix the issue we see. it will just increase the complexity. 3. yes waiting for rebuilds would fix it. but this is just a timebomb waiting to go up when we switch to 3.11 as default python. there are plenty of small problems here that need fixing. and versioned shebang lines for program only packages is one part of it. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c12 --- Comment #12 from Marcus R�ckert <mrueckert@suse.com> --- (In reply to Rushdoony from comment #11)
Would the accepted change (link below) address the issue? https://build.opensuse.org/request/show/983551
not the problem we are trying to solve. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c13 Benjamin Greiner <code@bnavigator.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |RESOLVED CC| |code@bnavigator.de Resolution|--- |WONTFIX --- Comment #13 from Benjamin Greiner <code@bnavigator.de> --- The title is misleading. There is no unversioned path. Everything is in some form of python3.Y/site-packages/.
importlib.metadata.PackageNotFoundError: No package metadata was found for borgbackup
that means we should have a macro like %python_version_shebang which updates all references from python3 to python3.x.
In this particular case, the interpreter line of the entry-point is generated by setuptools because the specfiles use `python3 setup.py install`. If you don't even use the macros there, why would you want a %python_version_shebang? You can use `python%{python3_bin_suffix} setup.py install` if you think a package should still work after the /usr/bin/python3 symlink has changed but your package has not been successfully rebuilt. And for the record, https://build.opensuse.org/request/show/983551 is exactly the fix that was needed. Because the rebuilt package HAS the metadata in the Python 3.10 platlib. Contrary to the old non-updated borgbackup package for Python 3.8. Fix your builds and all is fine.
server:mail/getmail6 had the same problem.
This is not even in Factory. Also, it does successfully build. How does it have the same problem? -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c14 --- Comment #14 from Marcus R�ckert <mrueckert@suse.com> --- What is the problem we try to solve: 1. Tumbleweed publishes 2. this triggers rebuilds of all the projects in the OBS where people might use 3. user runs "zypper dup" before those rebuilds are done. now the user has packages that fulfill the Requires but do not give the user a working package. This is something we can solve! And FWIW: when I opened the bug we even still had packages in Tumbleweed that were broken. (In reply to Benjamin Greiner from comment #13)
The title is misleading. There is no unversioned path. Everything is in some form of python3.Y/site-packages/.
importlib.metadata.PackageNotFoundError: No package metadata was found for borgbackup
that means we should have a macro like %python_version_shebang which updates all references from python3 to python3.x.
In this particular case, the interpreter line of the entry-point is generated by setuptools because the specfiles use `python3 setup.py install`. If you don't even use the macros there, why would you want a %python_version_shebang?
You can use `python%{python3_bin_suffix} setup.py install` if you think a package should still work after the /usr/bin/python3 symlink has changed but your package has not been successfully rebuilt.
And for the record, https://build.opensuse.org/request/show/983551 is exactly the fix that was needed. Because the rebuilt package HAS the metadata in the Python 3.10 platlib. Contrary to the old non-updated borgbackup package for Python 3.8.
Fix your builds and all is fine.
I am not tied to any specific solution. but a generic solution in the python macros would be preferred so we dont have to fix N places.
server:mail/getmail6 had the same problem.
This is not even in Factory. Also, it does successfully build. How does it have the same problem?
And yet one of the main features for the OBS is that users can build their own packages easily and should also not create broken packages just because we change the default python version in Tumbleweed. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c15 Marcus R�ckert <mrueckert@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX |--- --- Comment #15 from Marcus R�ckert <mrueckert@suse.com> --- This has so many parts that need fixing. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c16 --- Comment #16 from Benjamin Greiner <code@bnavigator.de> ---
but a generic solution in the python macros would be preferred so we dont have to fix N places.
But those packages affected explictly don't use the macros. How are you gonna force them to do it? -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c17 --- Comment #17 from Marcus R�ckert <mrueckert@suse.com> --- i named a few packages that dont use macros. that's why one part of this bug is: have rpmlint checks to warn packagers about this issue I also started the discussion with my team to fix the publisher prefering the outdated aarch64 packages. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c18 Matej Cepl <mcepl@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |WONTFIX Assignee|mcepl@suse.com |mrueckert@suse.com --- Comment #18 from Matej Cepl <mcepl@suse.com> --- If you insist opening on something we said to WONTFIX, have it. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 https://bugzilla.suse.com/show_bug.cgi?id=1200664#c19 Matej Cepl <mcepl@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |mcepl@suse.com Resolution|WONTFIX |--- --- Comment #19 from Matej Cepl <mcepl@suse.com> --- Sorry, too many options chosen at once. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1200664 Matthias Gerstner <matthias.gerstner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|matthias.gerstner@suse.com | -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com