Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1F0CCD495D for ; Thu, 21 Sep 2023 06:39:52 +0000 (UTC) Received: from server3.justice4all.it (server3.justice4all.it [95.217.19.36]) by mx.groups.io with SMTP id smtpd.web10.10062.1695278385402042935 for ; Wed, 20 Sep 2023 23:39:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@pianon.eu header.s=mail20151219 header.b=ATeDf6tB; spf=pass (domain: pianon.eu, ip: 95.217.19.36, mailfrom: alberto@pianon.eu) Received: from localhost (localhost [127.0.0.1]) by server3.justice4all.it (Postfix) with ESMTP id 2D5A75C0096; Thu, 21 Sep 2023 08:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pianon.eu; h= message-id:references:in-reply-to:subject:subject:from:from:date :date:content-transfer-encoding:content-type:content-type :mime-version; s=mail20151219; t=1695278382; x=1697092783; bh=zM Ezber756zO0fh2QrJHDEPG6fU85s6fmvKLw4MHSYc=; b=ATeDf6tB7g+bSamk+B auoATDGmbZpC2B7R89vi8xdHw+MiEgSqpmFkGJp1KiGf8SpkJMLaH58245JzjyrR WSQ5yGJqonN0PpdQi5QJdXdKCtYVwrAWEeSTPzZdeZzeDHOL8e1gBUa2guSjrkCk OZeq4TffJMwW8CxRAKg/yjLtw= X-Virus-Scanned: Debian amavisd-new at server3.justice4all.it Received: from server3.justice4all.it ([127.0.0.1]) by localhost (server3.justice4all.it [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JZkTdyHCz9zp; Thu, 21 Sep 2023 08:39:42 +0200 (CEST) Received: from pianon.eu (localhost [127.0.0.1]) (Authenticated sender: alberto@pianon.eu) by server3.justice4all.it (Postfix) with ESMTPA id 719025C0095; Thu, 21 Sep 2023 08:39:42 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 21 Sep 2023 08:39:42 +0200 From: Alberto Pianon To: Richard Purdie Cc: Bitbake Devel , 'Carlo Piana' , Joshua Watt Subject: Re: initial idea for hooks needed for source tracing In-Reply-To: <3b9ec69856ec79e4ec9856d72395b3cbd36e58b2.camel@linuxfoundation.org> References: <7f5d05fe554d232c300b2604addc452a@pianon.eu> <517df01859172566e88a239658c601be@pianon.eu> <6d0c953729ea7602ee09cc9238513c1b@pianon.eu> <8a899d6d88c1d493d48c3a495a9671b13df6a408.camel@linuxfoundation.org> <15196a1c207f89bfc8894f155b05cbde@pianon.eu> <97ecac758fd3b771e56e32e0a6c095d0900629a3.camel@linuxfoundation.org> <3b9ec69856ec79e4ec9856d72395b3cbd36e58b2.camel@linuxfoundation.org> Message-ID: X-Sender: alberto@pianon.eu List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 21 Sep 2023 06:39:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15096 On 2023-09-20 21:20, Richard Purdie wrote: > On Wed, 2023-09-20 at 21:02 +0200, Alberto Pianon wrote: >> On 2023-09-20 20:39, Richard Purdie wrote: >> >> > > > Again, you'd get the git unpack events for this? >> > > >> > > This method passes git submodule's url, name, relative checkout path >> > > and >> > > revision to the tracer: where do you suggest to collect the same >> > > information? Should the tracer autonomously parse all .gitmodules >> > > files >> > > again and use git commands to reconstruct the same information? >> > >> > No, you shouldn't need to parse those. Isn't this information included >> > in the ud that is being passed to git unpack in the line immediately >> > below? That will be seen via the git unpack call the tracer will see? >> > >> > > >> > > > >> > > > > Git.unpack(self, ud, destdir, d) >> >> Partly. The missing piece of information is the checkout path. If you >> search for >> 'modpath' in gitsm.py you see that that parameter is passed to >> multiple >> functions but never used (apart from module updates) nor stored >> anywhere >> (or am I missing something?) > > "unpack path" is pretty much the thing you're having to instrument the > other fetchers for so if that is the only extra information being > logged in gitsm, that brings it into line with all the other fetchers > and we have a consistent API. > > What worried me more was an unbalanced API where some fetchers had to > have extra special handling. If the tracer API is consistent with just > the unpack/checkout path needing logging/tracing, that is much clearer > and consistent and a sign the API is right. Unpack path of git submodules (including nested ones) - stored in ud.destdir -corresponds to their bareclone path (like in /git/.git/modules//) and not to the checkout path, which is not even calculated by gitsm. The bareclone path is of no use for the tracer, and in any case it's not consistent with what other fetchers return as unpack dir to the tracer (which should be the folder with where unpacked files are found). IIUC, in case of git submodules (nested or not), gitsm fetcher just bareclones them but it does not check them out; all generated subodules urls/urldata have the bareclone parameter set and no information about the checkout path; ud.destdir is set to the bareclone path. Only at the end, when all submodules (including nested ones) have been barecloned, gitsm calls 'git submodule update --recursive --no-fetch' only once, to check out submodules into /git/, /git// etc. So I would apply for an exception here :) Calculating submodule checkout paths (also for nested submodules) and adding them to urldata would require adding just a couple of lines in gitsm.py and would do no harm, I hope... This would be much better than passing the modpath parameter to the tracer with a special hook: the tracer could just collect the checkout path from urldata and no fetcher-specific hooks would be required. In other words, we would solve the only problem that's still left (the others should be solved by using sessions as you suggested). What do you think? Cheers, Alberto >> > > >> > > I can reduce internal module additions by externally >> > > recalculating/re-collecting npm/git module information, even if this >> > > will >> > > cause the same data/files to be processed twice. >> > > If you tell me, I'll do that :) >> > > Do you have any other solution in mind? >> > >> > I think you can get the data from the ud that gets passed into the >> > recursive calls. You shouldn't need to parse files, that isn't my >> > intent. I'm not convinced we need the fetcher specific hooks though, >> > probably just some basic state tracing in the tracer. >> >> I will try to use sessions for that, and I will tell you the results. >> >> The gitsm checkout dir issue remains, though. > > Sounds good, I've commented on that above. > > Cheers, > > Richard