[PATCH] depgraph: respect <foo-version:= for slot operator rebuild (bug 717140)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] depgraph: respect <foo-version:= for slot operator rebuild (bug 717140)

Zac Medico-2
When searching for slot operator rebuilds, respect non slot-operator
components of parent dependencies, so that a <foo-version:= dependency
like the <dev-libs/libgit2-1:0=[ssh?] dependency from bug 717140 will
not be completely ignored. This will prevent erroneous attempts to
trigger slot operator rebuilds for upgrades that would break
<foo-version:= dependencies (which triggered upgrade/downgrade loops
when backtracking tried to resolve the breakage).

Bug: https://bugs.gentoo.org/717140
Signed-off-by: Zac Medico <[hidden email]>
---
 lib/_emerge/depgraph.py                              | 12 +++++++++---
 .../resolver/test_slot_operator_reverse_deps.py      |  1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 6d1f62178..ec90e59df 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -2068,9 +2068,15 @@ class depgraph(object):
  for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []):
  if isinstance(parent, Package):
  if parent in built_slot_operator_parents:
- # This parent may need to be rebuilt, so its
- # dependencies aren't necessarily relevant.
- continue
+ # This parent may need to be rebuilt, therefore
+ # discard its soname and built slot operator
+ # dependency components which are not necessarily
+ # relevant.
+ if atom.soname:
+ continue
+ elif atom.package and atom.slot_operator_built:
+ # This discards the slot/subslot component.
+ atom = atom.with_slot("=")
 
  if replacement_parent is not None and \
  (replacement_parent.slot_atom == parent.slot_atom
diff --git a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
index 5c5295510..e0e738d6b 100644
--- a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
+++ b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
@@ -122,7 +122,6 @@ class SlotOperatorReverseDepsLibGit2TestCase(TestCase):
  trigger an upgrade to dev-libs/libgit2-1.0.0-r1, ultimately
  resulting in an undesirable downgrade to dev-libs/libgit2-0.28.4-r1.
  """
- self.todo = True
 
  ebuilds = {
 
--
2.24.1


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] depgraph: respect <foo-version:= for slot operator rebuild (bug 717140)

Brian Dolbec-3
On Sat, 11 Apr 2020 17:39:53 -0700
Zac Medico <[hidden email]> wrote:

> When searching for slot operator rebuilds, respect non slot-operator
> components of parent dependencies, so that a <foo-version:= dependency
> like the <dev-libs/libgit2-1:0=[ssh?] dependency from bug 717140 will
> not be completely ignored. This will prevent erroneous attempts to
> trigger slot operator rebuilds for upgrades that would break
> <foo-version:= dependencies (which triggered upgrade/downgrade loops
> when backtracking tried to resolve the breakage).
>
> Bug: https://bugs.gentoo.org/717140
> Signed-off-by: Zac Medico <[hidden email]>
> ---
>  lib/_emerge/depgraph.py                              | 12
> +++++++++--- .../resolver/test_slot_operator_reverse_deps.py      |
> 1 - 2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
> index 6d1f62178..ec90e59df 100644
> --- a/lib/_emerge/depgraph.py
> +++ b/lib/_emerge/depgraph.py
> @@ -2068,9 +2068,15 @@ class depgraph(object):
>   for parent, atom in
> self._dynamic_config._parent_atoms.get(existing_pkg, []): if
> isinstance(parent, Package): if parent in built_slot_operator_parents:
> - # This parent may
> need to be rebuilt, so its
> - # dependencies
> aren't necessarily relevant.
> - continue
> + # This parent may
> need to be rebuilt, therefore
> + # discard its soname
> and built slot operator
> + # dependency
> components which are not necessarily
> + # relevant.
> + if atom.soname:
> + continue
> + elif atom.package
> and atom.slot_operator_built:
> + # This
> discards the slot/subslot component.
> + atom =
> atom.with_slot("=")
>   if replacement_parent is not
> None and \ (replacement_parent.slot_atom == parent.slot_atom
> diff --git
> a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
> b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py index
> 5c5295510..e0e738d6b 100644 ---
> a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py +++
> b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py @@
> -122,7 +122,6 @@ class
> SlotOperatorReverseDepsLibGit2TestCase(TestCase): trigger an upgrade
> to dev-libs/libgit2-1.0.0-r1, ultimately resulting in an undesirable
> downgrade to dev-libs/libgit2-0.28.4-r1. """
> - self.todo = True
>  
>   ebuilds = {
>  

looks fine to me :)

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] depgraph: respect <foo-version:= for slot operator rebuild (bug 717140)

Zac Medico-2
On 4/11/20 6:10 PM, Brian Dolbec wrote:

> On Sat, 11 Apr 2020 17:39:53 -0700
> Zac Medico <[hidden email]> wrote:
>
>> When searching for slot operator rebuilds, respect non slot-operator
>> components of parent dependencies, so that a <foo-version:= dependency
>> like the <dev-libs/libgit2-1:0=[ssh?] dependency from bug 717140 will
>> not be completely ignored. This will prevent erroneous attempts to
>> trigger slot operator rebuilds for upgrades that would break
>> <foo-version:= dependencies (which triggered upgrade/downgrade loops
>> when backtracking tried to resolve the breakage).
>>
>> Bug: https://bugs.gentoo.org/717140
>> Signed-off-by: Zac Medico <[hidden email]>
>> ---
>>  lib/_emerge/depgraph.py                              | 12
>> +++++++++--- .../resolver/test_slot_operator_reverse_deps.py      |
>> 1 - 2 files changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
>> index 6d1f62178..ec90e59df 100644
>> --- a/lib/_emerge/depgraph.py
>> +++ b/lib/_emerge/depgraph.py
>> @@ -2068,9 +2068,15 @@ class depgraph(object):
>>   for parent, atom in
>> self._dynamic_config._parent_atoms.get(existing_pkg, []): if
>> isinstance(parent, Package): if parent in built_slot_operator_parents:
>> - # This parent may
>> need to be rebuilt, so its
>> - # dependencies
>> aren't necessarily relevant.
>> - continue
>> + # This parent may
>> need to be rebuilt, therefore
>> + # discard its soname
>> and built slot operator
>> + # dependency
>> components which are not necessarily
>> + # relevant.
>> + if atom.soname:
>> + continue
>> + elif atom.package
>> and atom.slot_operator_built:
>> + # This
>> discards the slot/subslot component.
>> + atom =
>> atom.with_slot("=")
>>   if replacement_parent is not
>> None and \ (replacement_parent.slot_atom == parent.slot_atom
>> diff --git
>> a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py
>> b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py index
>> 5c5295510..e0e738d6b 100644 ---
>> a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py +++
>> b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py @@
>> -122,7 +122,6 @@ class
>> SlotOperatorReverseDepsLibGit2TestCase(TestCase): trigger an upgrade
>> to dev-libs/libgit2-1.0.0-r1, ultimately resulting in an undesirable
>> downgrade to dev-libs/libgit2-0.28.4-r1. """
>> - self.todo = True
>>  
>>   ebuilds = {
>>  
>
> looks fine to me :)
>
Thanks, merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b755b46f9e88f25fecada0a32095ea614a73b57
--
Thanks,
Zac


signature.asc (1000 bytes) Download Attachment