public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:root-deps-both commit in: /, man/, lib/_emerge/, lib/portage/tests/resolver/
@ 2024-05-10 12:05 James Le Cuirot
  0 siblings, 0 replies; only message in thread
From: James Le Cuirot @ 2024-05-10 12:05 UTC (permalink / raw
  To: gentoo-commits

commit:     ea8e36027a51b9a9d3968cdbdb1b1081bff5307d
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Fri May 10 11:26:18 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Fri May 10 12:05:32 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ea8e3602

emerge: Make --root-deps install build deps to ROOT plus / for all EAPIs

Rather than instead of / for EAPI 6 and below. This changes the
behaviour, but it is arguably not a breaking change, as no installations
are being dropped. The previous behaviour was highly likely to break
anyway.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 NEWS                                          |  4 +++-
 lib/_emerge/depgraph.py                       | 24 ++++++++++++++++--------
 lib/portage/tests/resolver/test_targetroot.py |  6 +++++-
 man/emerge.1                                  | 20 +++++++-------------
 4 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/NEWS b/NEWS
index 7c1eb99616..b61ac3fa82 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,9 @@ Release notes take the form of the following optional categories:
 portage-3.0.65 (UNRELEASED)
 --------------
 
-TODO
+Features:
+* emerge: Make bare --root-deps option install build-time dependencies to ROOT
+  as well as / for all EAPIs rather than instead of / for EAPI 6 and below.
 
 portage-3.0.64 (2024-04-28)
 --------------

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 6853ec4911..9649f2a14b 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -4040,16 +4040,24 @@ class depgraph:
         if removal_action:
             depend_root = myroot
         else:
+            root_deps = self._frozen_config.myopts.get("--root-deps")
+
             if eapi_attrs.bdepend:
                 depend_root = pkg.root_config.settings["ESYSROOT"]
             else:
                 depend_root = self._frozen_config._running_root.root
-                root_deps = self._frozen_config.myopts.get("--root-deps")
-                if root_deps is not None:
-                    if root_deps is True:
-                        depend_root = myroot
-                    elif root_deps == "rdeps":
-                        ignore_depend_deps = True
+                if root_deps == "rdeps":
+                    ignore_depend_deps = True
+
+            if root_deps == True:
+                edepend["RDEPEND"] += (
+                    " "
+                    + edepend["IDEPEND"]
+                    + " "
+                    + edepend["DEPEND"]
+                    + " "
+                    + edepend["BDEPEND"]
+                )
 
         # If rebuild mode is not enabled, it's safe to discard ignored
         # build-time dependencies. If you want these deps to be traversed
@@ -8390,7 +8398,7 @@ class depgraph:
         for root in self._frozen_config.roots:
             if root != self._frozen_config.target_root and (
                 "remove" in self._dynamic_config.myparams
-                or self._frozen_config.myopts.get("--root-deps") is not None
+                or self._frozen_config.myopts.get("--root-deps") != "rdeps"
             ):
                 # Only pull in deps for the relevant root.
                 continue
@@ -8625,7 +8633,7 @@ class depgraph:
             dep_keys = Package._runtime_keys
             for myroot in self._frozen_config.trees:
                 if (
-                    self._frozen_config.myopts.get("--root-deps") is not None
+                    self._frozen_config.myopts.get("--root-deps") != "rdeps"
                     and myroot != self._frozen_config.target_root
                 ):
                     continue

diff --git a/lib/portage/tests/resolver/test_targetroot.py b/lib/portage/tests/resolver/test_targetroot.py
index 642a8b1505..8660313b3b 100644
--- a/lib/portage/tests/resolver/test_targetroot.py
+++ b/lib/portage/tests/resolver/test_targetroot.py
@@ -66,7 +66,11 @@ class TargetRootTestCase(TestCase):
                 ambiguous_merge_order=True,
                 success=True,
                 mergelist=[
-                    ("dev-libs/B-1{targetroot}", "dev-libs/C-1{targetroot}"),
+                    (
+                        "dev-libs/B-1",
+                        "dev-libs/B-1{targetroot}",
+                        "dev-libs/C-1{targetroot}",
+                    ),
                     "dev-libs/A-1{targetroot}",
                 ],
             ),

diff --git a/man/emerge.1 b/man/emerge.1
index dd9cde5722..057990cba2 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -981,21 +981,15 @@ Set the \fBROOT\fR environment variable.
 Set the \fBSYSROOT\fR environment variable.
 .TP
 .BR \-\-root\-deps[=rdeps]
-If no argument is given then build\-time dependencies of packages for
-\fBROOT\fR are installed to \fBROOT\fR instead of /.
-If the \fBrdeps\fR argument is given then discard all build\-time dependencies
-of packages for \fBROOT\fR.
-This option is only meaningful when used together with \fBROOT\fR and it should
-not be enabled under normal circumstances!
+This option is only meaningful when used together with \fBROOT\fR.
 
-Does not affect EAPIs that support \fBBDEPEND\fR.  \fBEAPI 7\fR introduces
-\fBBDEPEND\fR as a means to adjust installation into / and \fBROOT\fR.  Use
-the \fBSYSROOT\fR environment variable to control where \fBDEPEND\fR
-is installed to under \fBEAPI 7\fR.
+If no argument is given, then build\-time dependencies of packages for
+\fBROOT\fR are installed to \fBROOT\fR as well as /.
 
-When ebuilds with different EAPIs feature in the same emerge run, the
-appropriate behaviour for each EAPI is applied independently to each
-ebuild.
+If the \fBrdeps\fR argument is given, then all build\-time dependencies of
+packages for \fBROOT\fR are ignored entirely. This option should not be enabled
+under normal circumstances! It is not applied to ebuilds at \fBEAPI 7\fR or
+later.
 .TP
 .BR "\-\-search\-index < y | n >"
 Enable or disable indexed search for search actions. This option is


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-10 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 12:05 [gentoo-commits] proj/portage:root-deps-both commit in: /, man/, lib/_emerge/, lib/portage/tests/resolver/ James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox