Bugzilla – Bug 1212476
patch shebang line match the python version required in the package
Last modified: 2024-07-16 15:41:09 UTC
rpm -q --requires lutris | grep 'python(abi)' python(abi) = 3.10 but the shebang line is /usr/bin/python3 with python3 defaulting to python3.11 this leaves the user with a non working package. => patch shebangline to ensure that the package matches. This affected more packages. lutris is just an example.
That should be a problem of having different versions of packages during the change from python3.10 to python3.11. I've checked the latest build and looks okay: $ rpm -q --requires /home/danigm/.cache/zypp/packages/download.opensuse.org-oss_2/noarch/lutris-0.5.13-1.2.noarch.rpm | grep 'python(abi)' python(abi) = 3.11
I explicitely said this is _not_ about fixing this _one_ package. if a package requires python(abi) = 3.11 thant he shebang line should probably affect that to make upgrading python versions not break things without need. and the most simple way to achieve that is patched shebang lines.
rubygems e.g. injects the versioned shebang lines into the scripts installed into /usr/bin. so this automatically makes it work properly. I hope we can adapt setuptools/distutils/wheel to do something similar and we do not have to patch the shebang line manually in each package. or if we need a per package solution, then it should be a macro.
This is done automatically in python-rpm-macros when using the %python_clone macro [1], and recently was also added to the %pyproject_install [2]. And by default, this is something that is done by setuptools, and other modern python packaging tools [3]. In modern python packages the "binaries" are created during package creation/installation and the shebang line is added there. It's true that there are a lot of packages that does the shebang replacement manually, because of legacy code or other reasons, but there are tools now to fix this kind of issues in the python ecosystem and also in openSUSE python macros. [1] https://github.com/openSUSE/python-rpm-macros/blob/master/macros.lua#L500 [2] https://github.com/openSUSE/python-rpm-macros/commit/1b898fb6fdbb20408ac153ac7217c9b658d7ec69 [3] https://setuptools.pypa.io/en/latest/userguide/entry_point.html
so we should add an rpmlint check for this?
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1149982 Factory / vulkan-headers
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1150776 Factory / units
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1157172 Factory / jgmenu https://build.opensuse.org/request/show/1157173 Factory / sgtk-menu
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1158006 Tools / osc
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1158031 Factory / pacemaker
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1160115 Factory / osc
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1166785 Factory / gupnp https://build.opensuse.org/request/show/1166786 Factory / libglade2
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1166865 Factory / itstool
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1167656 Factory / lirc
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1170718 Factory / gtk2 https://build.opensuse.org/request/show/1170719 Factory / gtk-doc
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1170823 Factory / gnome-tweaks https://build.opensuse.org/request/show/1170824 Factory / gnome-shell https://build.opensuse.org/request/show/1170825 Factory / gnome-music
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1173646 15.6 / opensuse-welcome
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1178065 Factory / git
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1178380 Factory / epy
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1180024 Backports:SLE-15-SP6 / opi
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1180338 Factory / asymptote
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1180707 Factory / munin
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1180932 Factory / fwupd
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1180968 Tools / obs-service-set_version https://build.opensuse.org/request/show/1180973 Tools / obs-service-tar_scm
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1181535 Factory / obs-service-set_version
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1181880 Factory / obs-service-set_version
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1181908 Factory / dwarves
This is breaking some of our SLE-15-SP4 builds: https://build.opensuse.org/package/live_build_log/network:samba:STABLE/cifs-utils/SUSE_SLE-15-SP4_GA/x86_64 (same for network:samba:STABLE/ads) Error message is: > [ 29s] + %python3_fix_shebang > [ 29s] /var/tmp/rpm-tmp.mQs0QZ: line 69: fg: no job control Any ideas how to fix? Or should we just remove it for this specific product?
(In reply to Enzo Matsumiya from comment #29) > Any ideas how to fix? Or should we just remove it for this specific product? https://build.suse.de/request/show/336291
This is an autogenerated message for OBS integration: This bug (1212476) was mentioned in https://build.opensuse.org/request/show/1185296 Factory / texlive-specs-a https://build.opensuse.org/request/show/1185297 Factory / texlive-specs-b https://build.opensuse.org/request/show/1185298 Factory / texlive-specs-c https://build.opensuse.org/request/show/1185299 Factory / texlive-specs-d https://build.opensuse.org/request/show/1185300 Factory / texlive-specs-e https://build.opensuse.org/request/show/1185301 Factory / texlive-specs-f https://build.opensuse.org/request/show/1185302 Factory / texlive-specs-g https://build.opensuse.org/request/show/1185303 Factory / texlive-specs-h https://build.opensuse.org/request/show/1185304 Factory / texlive-specs-i https://build.opensuse.org/request/show/1185305 Factory / texlive-specs-j https://build.opensuse.org/request/show/1185306 Factory / texlive-specs-k https://build.opensuse.org/request/show/1185307 Factory / texlive-specs-l https://build.opensuse.org/request/show/1185308 Factory / texlive-specs-m https://build.opensuse.org/request/show/1185309 Factory / texlive-specs-n https://build.opensuse.org/request/show/1185310 Factory / texlive-specs-o https://build.opensuse.org/request/show/1185311 Factory / texlive-specs-p https://build.opensuse.org/request/show/1185312 Factory / texlive-specs-q https://build.opensuse.org/request/show/1185313 Factory / texlive-specs-r https://build.opensuse.org/request/show/1185314 Factory / texlive-specs-s https://build.opensuse.org/request/show/1185315 Factory / texlive-specs-t https://build.opensuse.org/request/show/1185316 Factory / texlive-specs-u https://build.opensuse.org/request/show/1185317 Factory / texlive-specs-v https://build.opensuse.org/request/show/1185318 Factory / texlive-specs-w https://build.opensuse.org/request/show/1185319 Factory / texlive-specs-x https://build.opensuse.org/request/show/1185320 Factory / texlive-specs-y https://build.opensuse.org/request/show/1185321 Factory / texlive-specs-z