From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/
Date: Mon, 14 Jun 2021 06:28:33 +0000 (UTC) [thread overview]
Message-ID: <1623651960.ac4f07b4b04aadf57f78cb21729e1f5439609f81.zmedico@gentoo> (raw)
commit: ac4f07b4b04aadf57f78cb21729e1f5439609f81
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 14 06:23:56 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 14 06:26:00 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac4f07b4
Revert "PORTAGE_NICENESS: Consider autogroup scheduling"
This reverts commit a4d882964ee1931462f911d0c46a80e27e59fa48.
It triggered this regression:
# PORTAGE_NICENESS=20 emerge -av --depclean
OSError: [Errno 22] Invalid argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.9/emerge", line 51, in <module>
retval = emerge_main()
File "/usr/lib/python3.9/site-packages/_emerge/main.py", line 1319, in emerge_main
return run_action(emerge_config)
File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2999, in run_action
apply_priorities(emerge_config.target_config.settings)
File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2635, in apply_priorities
nice(settings)
File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2672, in nice
out.eerror("%s\n" % str(e))
OSError: [Errno 22] Invalid argument
Bug: https://bugs.gentoo.org/777492#c4
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/_emerge/actions.py | 36 +++---------------------------------
man/make.conf.5 | 10 +---------
2 files changed, 4 insertions(+), 42 deletions(-)
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index bfb08ed6b..1946f49df 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -14,7 +14,6 @@ import textwrap
import time
import warnings
from itertools import chain
-from pathlib import Path
import portage
portage.proxy.lazyimport.lazyimport(globals(),
@@ -2635,43 +2634,14 @@ def apply_priorities(settings):
nice(settings)
def nice(settings):
- nice_value: str = settings.get("PORTAGE_NICENESS", "0")
-
try:
- os.nice(int(nice_value))
+ os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
except (OSError, ValueError) as e:
out = portage.output.EOutput()
- out.eerror(f"Failed to change nice value to {nice_value}")
+ out.eerror("Failed to change nice value to '%s'" % \
+ settings.get("PORTAGE_NICENESS", "0"))
out.eerror("%s\n" % str(e))
- autogroup_file = Path("/proc/self/autogroup")
- try:
- f = autogroup_file.open("r+")
- except EnvironmentError:
- # Autogroup scheduling is not enabled on this system.
- return
-
- with f:
- line = f.readline()
- original_autogroup_nice_value = line.split(" ")[2]
-
- # We need to restore the original nice value of the
- # autogroup, as otherwise the session, e.g. the
- # terminal where portage was executed in, would
- # continue running with that value.
- portage.atexit_register(
- lambda value: autogroup_file.write_text(value),
- original_autogroup_nice_value,
- )
-
- try:
- f.write(nice_value)
- except EnvironmentError as e:
- out = portage.output.EOutput()
- out.eerror(f"Failed to change autogroup's nice value to {nice_value}")
- out.eerror("%s\n" % str(e))
-
-
def ionice(settings):
ionice_cmd = settings.get("PORTAGE_IONICE_COMMAND")
diff --git a/man/make.conf.5 b/man/make.conf.5
index 18573b5e2..1c72109ad 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
@@ -1031,14 +1031,6 @@ The value of this variable will be added to the current nice level that
emerge is running at. In other words, this will not set the nice level,
it will increment it. For more information about nice levels and what
are acceptable ranges, see \fBnice\fR(1).
-.br
-If set and portage is run under Linux with autogroup scheduling (see
-\fBsched\fR(7)) enabled, then portage will set the nice value of its
-autogroup to PORTAGE_NICENESS. Upon exiting, portage will restore the
-original value. Note that if the function responsible for restoring the
-original value is not run, e.g., because portage's process was killed,
-then the autogroup will stay niced. In such a case, the value can be
-reset via corresponding autogroup pseudo\-file in /proc.
.TP
\fBPORTAGE_RO_DISTDIRS\fR = \fI[space delimited list of directories]\fR
When a given file does not exist in \fBDISTDIR\fR, search for the file
next reply other threads:[~2021-06-14 6:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-14 6:28 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-02-27 3:12 [gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/ Zac Medico
2021-12-28 20:08 Zac Medico
2021-12-20 16:18 Mike Gilbert
2021-11-29 2:20 Zac Medico
2021-06-17 17:46 Zac Medico
2021-06-14 21:24 Zac Medico
2020-09-08 0:18 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1623651960.ac4f07b4b04aadf57f78cb21729e1f5439609f81.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox