After adding "PORTAGE_SCHEDULING_POLICY=idle" to make.conf, running emerge with pypy always crashes: # emerge --info Traceback (most recent call last): File "/usr/lib/python-exec/pypy3/emerge", line 60, in <module> retval = emerge_main() File "/usr/lib/pypy3.9/site-packages/_emerge/main.py", line 1294, in emerge_main return run_action(emerge_config) File "/usr/lib/pypy3.9/site-packages/_emerge/actions.py", line 3511, in run_action apply_priorities(emerge_config.target_config.settings) File "/usr/lib/pypy3.9/site-packages/_emerge/actions.py", line 3057, in apply_priorities set_scheduling_policy(settings) File "/usr/lib/pypy3.9/site-packages/_emerge/actions.py", line 3108, in set_scheduling_policy "idle": os.SCHED_IDLE, File "/usr/lib/pypy3.9/site-packages/portage/__init__.py", line 328, in __getattribute__ result = getattr(object.__getattribute__(self, "_mod"), attr) AttributeError: module 'os' has no attribute 'SCHED_IDLE' Prepending EPYTHON=python3.10 to the emerge command line fixes this.
A valid report, after discussing with Floppym I will prepare a fix with static numbers of scheduling policies rather than os.XXX int objects that are missing in pypy.
Would be nice to report this to pypy upstream (https://foss.heptapod.net/pypy/pypy). They're very nice and I think they wouldn't have a problem adding the missing constants.
Ping
Pong. Will prepare pull request this weekend. The fix will be to remove the os.NAME and use the int IDs from header, since python does not interface at all the SCHED_DEADLINE (sched 6). Unless comments arrive, this is the kind of PR I will create.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=7dfa05c4446d1d2290d4ba61520a8f6ee9e57332 commit 7dfa05c4446d1d2290d4ba61520a8f6ee9e57332 Author: KARBOWSKI Piotr <slashbeast@gentoo.org> AuthorDate: 2023-01-14 20:13:40 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-01-14 21:02:21 +0000 SCHEDULING_POLICY: switch to scheduler policy IDs rather than aliases. The os.SCHED_* aliases are not reliable enough, the mainline Python lacks deadline, and the pypy lacks them all together. The IDs are not going to change, at most new would arrive, so it is safe to use it as is. By extension, the deadline policy was also added, since those originally were not present in aliases. Bug: https://bugs.gentoo.org/867031 Closes: https://github.com/gentoo/portage/pull/976 Signed-off-by: KARBOWSKI Piotr <slashbeast@gentoo.org> Signed-off-by: Mike Gilbert <floppym@gentoo.org> cnf/make.conf.example | 12 ++++++------ lib/_emerge/actions.py | 12 +++++++----- man/make.conf.5 | 16 ++++++++-------- 3 files changed, 21 insertions(+), 19 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e342b1cae0ba19e35d27fe523ce0331e1412e295 commit e342b1cae0ba19e35d27fe523ce0331e1412e295 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-15 22:13:26 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-15 22:13:26 +0000 sys-apps/portage: add 3.0.44 Closes: https://bugs.gentoo.org/889328 Closes: https://bugs.gentoo.org/607696 Closes: https://bugs.gentoo.org/867031 Closes: https://bugs.gentoo.org/873202 Closes: https://bugs.gentoo.org/888543 Closes: https://bugs.gentoo.org/834038 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.44.ebuild | 288 +++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+)