[gentoo-portage-dev] [PATCH] _serialize_tasks: limit scope of dropped circular dependencies

2019-12-26 Thread Zac Medico
Ensure that all members of a buildtime dependency cycle are merged
as a group, such that packages which depend on one or more members
of the group will only be merged *after* the entire group has been
merged.

This extends runtime cycle handling to also handle buildtime cycles
in cases where the buildtime dependencies happen to be satisfied by
installed packages. In situations when this is necessary, it is
desirable to rely on the old installed instances of these packages
as little as possible, since they might have been broken by the
upgrade of a package that is a member of the dependency cycle.
Upgrading members of the cycle as a group effectively minimizes
reliance on the old installed package instances, avoiding some cases
of bug 199856. For example, it should avoid bug 703676, where
libspectre reportedly failed to build against an old installed
instance of ghostscript-gpl.

Bug: https://bugs.gentoo.org/199856
Bug: https://bugs.gentoo.org/690436
Bug: https://bugs.gentoo.org/703676
---
 lib/_emerge/depgraph.py   | 91 +++
 .../tests/resolver/test_merge_order.py| 25 -
 2 files changed, 75 insertions(+), 41 deletions(-)

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index ed7aeccad..58255681c 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -7636,21 +7636,6 @@ class depgraph(object):
break
removed_nodes.clear()
self._merge_order_bias(mygraph)
-   def cmp_circular_bias(n1, n2):
-   """
-   RDEPEND is stronger than PDEPEND and this function
-   measures such a strength bias within a circular
-   dependency relationship.
-   """
-   n1_n2_medium = n2 in mygraph.child_nodes(n1,
-   
ignore_priority=priority_range.ignore_medium_soft)
-   n2_n1_medium = n1 in mygraph.child_nodes(n2,
-   
ignore_priority=priority_range.ignore_medium_soft)
-   if n1_n2_medium == n2_n1_medium:
-   return 0
-   elif n1_n2_medium:
-   return 1
-   return -1
myblocker_uninstalls = 
self._dynamic_config._blocker_uninstalls.copy()
retlist=[]
# Contains uninstall tasks that have been scheduled to
@@ -7811,7 +7796,8 @@ class depgraph(object):
self._spinner_update()
selected_nodes = None
ignore_priority = None
-   if drop_satisfied or (prefer_asap and asap_nodes):
+   cycle_digraph = None
+   if prefer_asap and asap_nodes:
priority_range = DepPrioritySatisfiedRange
else:
priority_range = DepPriorityNormalRange
@@ -7893,11 +7879,12 @@ class depgraph(object):
break
 
if not selected_nodes:
-   nodes = 
get_nodes(ignore_priority=priority_range.ignore_medium)
-   if nodes:
-   mergeable_nodes = set(nodes)
+
+   def find_smallest_cycle(mergeable_nodes, 
priority_ranges):
if prefer_asap and asap_nodes:
nodes = asap_nodes
+   else:
+   nodes = mergeable_nodes
# When gathering the nodes belonging to 
a runtime cycle,
# we want to minimize the number of 
nodes gathered, since
# this tends to produce a more optimal 
merge order.
@@ -7908,21 +7895,44 @@ class depgraph(object):
# that depend on them. Therefore, we 
search for the
# smallest cycle in order to try and 
identify and prefer
# these smaller independent cycles.
-   ignore_priority = 
priority_range.ignore_medium_soft
smallest_cycle = None
+   ignore_priority = None
for node in nodes:
if not 
mygraph.parent_nodes(node):
continue
-   selected_nodes = set()
-   if gather_deps(ignore_priority,
-   

Re: [gentoo-portage-dev] [PATCH] Clean up remnants of eapi5-hdepend, HDEPEND and targetroot

2019-12-26 Thread Zac Medico
On 12/26/19 2:59 AM, James Le Cuirot wrote:
> I wanted to do this in the first place but someone, I forget who, said
> it needs to stay. :/

It was probably me. Now that BDEPEND is well established, we can safely
forget about HDEPEND.
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] Clean up remnants of eapi5-hdepend, HDEPEND and targetroot

2019-12-26 Thread James Le Cuirot
I wanted to do this in the first place but someone, I forget who, said
it needs to stay. :/

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer


pgpAftQqoeABx.pgp
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH] Clean up remnants of eapi5-hdepend, HDEPEND and targetroot

2019-12-26 Thread Michał Górny
Signed-off-by: Michał Górny 
---
 bin/eapi.sh   | 46 +--
 bin/ebuild.sh | 23 +++---
 bin/phase-functions.sh|  4 +-
 doc/package/ebuild.docbook|  1 -
 doc/package/ebuild/eapi/5-hdepend.docbook | 32 -
 doc/portage.docbook   |  1 -
 lib/_emerge/Package.py|  6 +--
 lib/_emerge/actions.py|  1 -
 lib/_emerge/depgraph.py   | 12 +
 lib/portage/__init__.py   |  2 +-
 lib/portage/cache/metadata.py |  2 +-
 lib/portage/dbapi/bintree.py  |  7 ++-
 lib/portage/dbapi/porttree.py |  2 +-
 lib/portage/dbapi/vartree.py  |  2 +-
 lib/portage/dep/_slot_operator.py |  3 --
 lib/portage/eapi.py   | 18 ++--
 .../ebuild/_config/special_env_vars.py|  2 +-
 lib/portage/package/ebuild/config.py  | 13 +-
 man/emerge.1  | 10 ++--
 repoman/cnf/repository/linechecks.yaml|  1 -
 .../modules/linechecks/patches/patches.py |  2 +-
 21 files changed, 53 insertions(+), 137 deletions(-)
 delete mode 100644 doc/package/ebuild/eapi/5-hdepend.docbook

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 4eafc1c87..29dfb008c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -31,19 +31,15 @@ ___eapi_has_prefix_variables() {
 }
 
 ___eapi_has_BROOT() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
 }
 
 ___eapi_has_SYSROOT() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
-}
-
-___eapi_has_HDEPEND() {
-   [[ ${1-${EAPI-0}} =~ ^(5-hdepend)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
 }
 
 ___eapi_has_BDEPEND() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
 }
 
 ___eapi_has_RDEPEND_DEPEND_fallback() {
@@ -65,11 +61,11 @@ ___eapi_has_dosed() {
 }
 
 ___eapi_has_einstall() {
-   [[ ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_has_dohtml() {
-   [[ ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+   [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
 }
 
 ___eapi_has_dohtml_deprecated() {
@@ -77,7 +73,7 @@ ___eapi_has_dohtml_deprecated() {
 }
 
 ___eapi_has_dolib_libopts() {
-   [[ ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+   [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
 }
 
 ___eapi_has_docompress() {
@@ -85,7 +81,7 @@ ___eapi_has_docompress() {
 }
 
 ___eapi_has_dostrip() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
 }
 
 ___eapi_has_nonfatal() {
@@ -101,23 +97,23 @@ ___eapi_has_usex() {
 }
 
 ___eapi_has_get_libdir() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_has_einstalldocs() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_has_eapply() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_has_eapply_user() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_has_in_iuse() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_has_version_functions() {
@@ -167,7 +163,7 @@ ___eapi_unpack_supports_xz() {
 }
 
 ___eapi_unpack_supports_txz() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress)$ ]]
 }
 
 ___eapi_econf_passes_--disable-dependency-tracking() {
@@ -179,7 +175,7 @@ ___eapi_econf_passes_--disable-silent-rules() {
 }
 
 ___eapi_econf_passes_--docdir_and_--htmldir() {
-   [[ ! ${1-${EAPI-0}} =~ 
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^