Using python-any-r1 eclas cause python_fix_shebang to use wrong python interpreter. For example in a stable system python-3.11 is installed but PYTHON_TARGETS is set to python_targets_3_10 and python_fix_shebang set #!/usr/bin/python3.11 as shebang causing error on runtime: Traceback (most recent call last): File "/usr/bin/switcherooctl", line 3, in <module> from gi.repository import Gio, GLib ModuleNotFoundError: No module named 'gi' Usign python-single-r1 eclass fix the problem --- switcheroo-control-2.6-r1.ebuild 2023-01-22 17:53:13.798380842 +0100 +++ switcheroo-control-2.6-r2.ebuild 2023-01-22 17:54:23.231334893 +0100 @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) -inherit meson python-any-r1 systemd +inherit meson python-single-r1 systemd DESCRIPTION="D-Bus service to check the availability of dual-GPU" HOMEPAGE="https://gitlab.freedesktop.org/hadess/switcheroo-control/" @@ -25,7 +25,7 @@ dev-util/gdbus-codegen gtk-doc? ( dev-util/gtk-doc ) test? ( - $(python_gen_any_dep 'dev-python/python-dbusmock[${PYTHON_USEDEP}]') + dev-python/python-dbusmock[${PYTHON_SINGLE_USEDEP}] dev-util/umockdev ) " @@ -34,7 +34,7 @@ python_check_deps() { use test || return 0 - python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]" + python_has_version "dev-python/python-dbusmock[${PYTHON_SINGLE_USEDEP}]" } src_configure() { Reproducible: Always
Created attachment 849039 [details, diff] switcheroo-control-2.6-r1.ebuild.patch
*** Bug 891807 has been marked as a duplicate of this bug. ***
(In reply to Marco Genasci from comment #0) > Using python-any-r1 eclas cause python_fix_shebang to use wrong python > interpreter. For example in a stable system python-3.11 is installed but > PYTHON_TARGETS is set to python_targets_3_10 and python_fix_shebang set > #!/usr/bin/python3.11 as shebang causing error on runtime: Ah, that explains why I didn't notice as I have PYTHON_TARGETS also with 3.11 :/
(In reply to Marco Genasci from comment #1) > Created attachment 849039 [details, diff] [details, diff] > switcheroo-control-2.6-r1.ebuild.patch That leads to with USE test enabled (not so strange as dev-python/python-dbusmock is not a python-single-r1 package): emerge: there are no ebuilds built with USE flags to satisfy "dev-python/python-dbusmock[python_single_target_python3_9(-)?,python_single_target_python3_10(-)?,python_single_target_python3_11(-)?]". !!! One of the following packages is required to complete your request: - sys-power/switcheroo-control-2.6-r2::gentoo (Change USE: -python_single_target_python3_10) (dependency required by "sys-power/switcheroo-control-2.6-r2::gentoo" [ebuild]) (dependency required by "=sys-power/switcheroo-control-2.6-r2" Also... as switcherooctl uses python... we will need to move the python checks out of test USE flag as they will always be needed
Created attachment 849153 [details] switcheroo-control-2.6-r2.ebuild I think it should be something like this... but I prepared it just now and couldn't test it :/
(In reply to Pacho Ramos from comment #5) > Created attachment 849153 [details] > switcheroo-control-2.6-r2.ebuild > > I think it should be something like this... but I prepared it just now and > couldn't test it :/ In my stable system works fine now.
(In reply to Marco Genasci from comment #6) > (In reply to Pacho Ramos from comment #5) > > Created attachment 849153 [details] > > switcheroo-control-2.6-r2.ebuild > > > > I think it should be something like this... but I prepared it just now and > > couldn't test it :/ > > In my stable system works fine now. Seems to be working on my stable system too. Best Regards, Georgi
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe26dafd89a74727711ce0213d5d93772fee9e7c commit fe26dafd89a74727711ce0213d5d93772fee9e7c Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2023-01-27 20:36:24 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2023-01-27 20:38:51 +0000 sys-power/switcheroo-control: Fix python handling Bug: https://bugs.gentoo.org/891749 Signed-off-by: Pacho Ramos <pacho@gentoo.org> .../switcheroo-control-2.6-r2.ebuild | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=115665d53ea9fb698b0bef80de8a920da07570d4 commit 115665d53ea9fb698b0bef80de8a920da07570d4 Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2023-02-11 08:43:17 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2023-02-11 08:43:17 +0000 sys-power/switcheroo-control: stabilize 2.6-r2 for amd64 Closes: https://bugs.gentoo.org/891749 Signed-off-by: Pacho Ramos <pacho@gentoo.org> sys-power/switcheroo-control/switcheroo-control-2.6-r2.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)