public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH] ArchChecks: don't mix arches between ebuilds
Date: Sun, 24 Apr 2016 15:04:57 -0700	[thread overview]
Message-ID: <571D4309.5090405@gentoo.org> (raw)
In-Reply-To: <571D3E7D.3070705@gentoo.org>

On 04/24/2016 02:45 PM, Zac Medico wrote:
> On 04/24/2016 01:00 AM, Brian Dolbec wrote:
>> On Sun, 24 Apr 2016 08:15:56 +0200
>> Michał Górny <mgorny@gentoo.org> wrote:
>>
>>> On Sat, 23 Apr 2016 16:57:21 -0700
>>> Zac Medico <zmedico@gentoo.org> wrote:
>>>
>>>> Fix ArchChecks to not mix arches of ebuilds together, so that
>>>> errors are only reported for those arches that the ebuild has
>>>> keywords for.
>>>> ---
>>>> Applies to the *repoman* branch.
>>>>
>>>>  pym/repoman/modules/scan/arches/arches.py | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/pym/repoman/modules/scan/arches/arches.py
>>>> b/pym/repoman/modules/scan/arches/arches.py index 4df25a8..6e1c17d
>>>> 100644 --- a/pym/repoman/modules/scan/arches/arches.py
>>>> +++ b/pym/repoman/modules/scan/arches/arches.py
>>>> @@ -69,7 +69,7 @@ class ArchChecks(ScanBase):
>>>>  				arches.add(('**', '**', ('**',)))
>>>>  		# update the dynamic data
>>>>  		dyn_arches = kwargs.get('arches')
>>>> -		#dyn_arches.clear()
>>>> +		dyn_arches.clear()
>>>>  		dyn_arches.update(arches)  
>>>
>>> Is that some crazy way of replacing contents of an existing dict? May
>>> be worth a comment since the code looks suspicious, at least.
>>>
>>
>> It was an interim step so that modules didn't pass back
>> arbitrary data to be re-used by other modules after it.  This way
>> maintains the data pointer to the set (not dict) object in the calling
>> function. Just assigning it a new set doesn't set the 'arches' pointer
>> in the calling function so that it can pass that data along to other
>> modules.
> 
> I feel like the plugin structure has lead to decoupling of things that
> really should be coupled. For example, the code in the ArchChecks could
> be a function that's called by the ProfileDependsChecks plugin, given
> that ProfileDependsChecks seems to be the only consumer of this data.

We'll have to go through all of the plugins and look for other things
that have too aggressively decoupled. The fact Scanner._scan_ebuilds
calls plugins in a hardcoded order is troubling. It means that there may
be coupling between plugins that makes the order matter, yet this
coupling is hidden and non-trivial to discover. If we couple more things
together where appropriate (like ArchChecks and ProfileDependsChecks),
then it will make the system easier for a person to reason about.
-- 
Thanks,
Zac


  reply	other threads:[~2016-04-24 22:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23 23:57 [gentoo-portage-dev] [PATCH] ArchChecks: don't mix arches between ebuilds Zac Medico
2016-04-24  6:15 ` Michał Górny
2016-04-24  8:00   ` Brian Dolbec
2016-04-24 21:45     ` Zac Medico
2016-04-24 22:04       ` Zac Medico [this message]
2016-04-24 22:16         ` Zac Medico
2016-04-25  3:48         ` Brian Dolbec

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=571D4309.5090405@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-portage-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