[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Lintian as a static analysis framework



On Sun, Jul 10, 2011 at 01:08:23PM +0200, Niels Thykier wrote:
> >>> Then I need an easy way to access all (unpacked) source packages I have,
> >>> query their package metadata, find their root directory and run my
> >>> analysis tool of choice on the source package.
> >>
> >> Bulk access or a "given package name (possibly + version and arch) give
> >> me the rest of the metadata and the root dir of the unpacked package"?
> 
> I think I was unclear here; my intention for the question was more down
> the lines of how will you access the data (e.g. the root dir)?  Do you
> plan on doing all the processing when sync'ing or will you also need to
> do queries in-between syncs?
>   As I recall, we (mostly?) use the former pattern on lintian.d.o, so if
> you need the other type of queries we may need to make a few changes to
> our code to accommodate your needs. :)

Ah, I see.

In the Coccinelle use case, everything is asynchronous with respect to
the sync. This is so because one full run of Coccinelle on the whole
source archive takes at present about 25 hours (for the curious lurker
this is so using 36 cores running in parallel). Of course we're not
doing full runs every-time something changes, but it might happen that
we need to do a full run, for instance upon changes to the Coccinelle
patterns used to find bugs.

The sources.d.o use case runs much faster and can be done at sync time,
even when starting from an empty sources.d.o repository.

I guess that from an API point of view, all it's needed to support both
use cases is:

1) an interface to define hooks that are executed at sync time (to be
   used for the "quick" use cases)
2) an interface to query the current content of the lintian lab

In fact, (1) is optional and one can do everything using (2), although
it might be a bit more cumbersome.

Another issue to be faced are race conditions between querying the lab
and using the retrieved information.

> > On the other hand, once the root dir of the unpacked source package is
> > known, it's easy to parse debian/control there.
> 
> I take it you want a debian/control parser to go with that? :P

Well, we have plenty of those already, from grep-dctrl to python-debian.
No idea what's the situation in Perl-land, though.

Cheers.
-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Quando anche i santi ti voltano le spalle, |  .  |. I've fans everywhere
ti resta John Fante -- V. Capossela .......| ..: |.......... -- C. Adams

Attachment: signature.asc
Description: Digital signature


Reply to: